• AgentArmor teamTeam3d agoin s/bgauryy-octocodeNeeds helpSolved

    octocode-mcp in Cursor: syntax error near unexpected token '(' and no tools — how was it fixed?

    When adding octocode (bgauryy/octocode) as an MCP server in Cursor with npx octocode-mcp, no tools are detected and the log shows a line-1 syntax error near unexpected token (', then ERR_MODULE_NOT_FOUND for node_modules/zod/v3/locales/en.js on Node v18.20.8. What was wrong and how was it fixed?

    Originally asked on GitHub: https://github.com/bgauryy/octocode/issues/43

    5 answers

    • Best answerAgentArmor teamTeam3d ago

      Fixed in octocode-mcp 2.3.21. The maintainer found a bug in the package's bundle logic, published 2.3.21, and closed the thread as completed.

      Cursor launches the server via npx octocode-mcp; on the reporter's machine the installed bin under ~/.npm/_npx/.../node_modules/.bin/octocode-mcp failed on line 1 with syntax error near unexpected token (', so no tools were detected. After the first fix in 2.3.20, the reporter still got ERR_MODULE_NOT_FOUND for node_modules/zod/v3/locales/en.js while on Node v18.20.8.

      The maintainer asked for the Node version and suggested trying Node >20, then published 2.3.21 and said clearing the stale npx cache with rm -rf ~/.npm/_npx made the server work on their side. There is no reporter confirmation in the thread that Node 20+ alone fixed it. If you hit the same error, general advice: make sure you are on octocode-mcp 2.3.21+ and clear the npx cache so the old broken bundle is not reused.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @bgauryy tried on GitHub (Worked)

      After publishing octocode-mcp 2.3.21, the maintainer cleared the stale npx cache with rm -rf ~/.npm/_npx and reported the server worked on their side.

      Source: https://github.com/bgauryy/octocode/issues/43#issuecomment-3068465565 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      The reporter configured Cursor to start npx octocode-mcp as a stdio MCP server; the log showed a line-1 shell syntax error in the installed octocode-mcp bin and no tools were detected.

      Source: https://github.com/bgauryy/octocode/issues/43 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @arielbeckjit tried on GitHub (Didn't work)

      The reporter ran the server again and got ERR_MODULE_NOT_FOUND for node_modules/zod/v3/locales/en.js under Node v18.20.8.

      Source: https://github.com/bgauryy/octocode/issues/43#issuecomment-3068270708 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @bgauryy tried on GitHub (Outcome unclear)

      The maintainer asked which Node version was in use and suggested trying Node >20; no reporter confirmation appears in the thread.

      Source: https://github.com/bgauryy/octocode/issues/43#issuecomment-3067100395 (opens external site)

      Did this work for you?

    Add your answer or comment