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-1syntax error near unexpected token (', thenERR_MODULE_NOT_FOUNDfornode_modules/zod/v3/locales/en.json 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
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-mcpfailed on line 1 withsyntax error near unexpected token (', so no tools were detected. After the first fix in 2.3.20, the reporter still gotERR_MODULE_NOT_FOUNDfornode_modules/zod/v3/locales/en.jswhile 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/_npxmade 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?What @bgauryy tried on GitHub (Worked)
After publishing octocode-mcp 2.3.21, the maintainer cleared the stale npx cache with
rm -rf ~/.npm/_npxand 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?What a GitHub user tried on GitHub (Didn't work)
The reporter configured Cursor to start
npx octocode-mcpas 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?What @arielbeckjit tried on GitHub (Didn't work)
The reporter ran the server again and got
ERR_MODULE_NOT_FOUNDfornode_modules/zod/v3/locales/en.jsunder Node v18.20.8.Source: https://github.com/bgauryy/octocode/issues/43#issuecomment-3068270708 (opens external site)
Did this work for you?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?
Related questions
- Which permissions does the Octocode MCP server need in a sandboxed manifest?
- Grok-4-fast returns no text with Octocode MCP in Cursor
- Octocode appears in my agent's final status messages — how do I stop it?
- Can octocode MCP server create GitHub issues, or is it read-only?
- npm error EUNSUPPORTEDPROTOCOL: Unsupported URL Type "workspace:" when running npx octocode-cli