-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Hi,
I'm encountering an issue where the claude-code-mcp server crashes shortly after a client (Claude desktop app) successfully connects and sends the initialize message.
Symptoms:
The server starts successfully using npm start (Claude Code MCP server started message appears).
The Claude desktop client connects to the server (ws://localhost:3005).
The server logs show the initialize message being received from the client.
Immediately after the initialize message, the server attempts to run an npm command to fetch a package named codemcp.
This results in an npm error code E404 / npm error 404 Not Found - GET https://registry.npmjs.org/codemcp because this package does not exist in the public npm registry.
Due to the npm error, the server process exits unexpectedly, and the connection to the client is closed.
Steps to Reproduce:
Clone the repository.
Run npm install and npm run build.
Run npm start.
Configure the Claude desktop app to use the local MCP server at ws://localhost:3005.
Observe the server logs in the terminal.
Expected Behavior:
The server should successfully process the initialize message and remain running, ready for further communication with the Claude client. It should not attempt to install external npm packages during runtime after initialization.
Actual Behavior:
The server crashes due to an npm E404 error while trying to fetch a non-existent package codemcp immediately after client initialization.
Environment:
OS: macOS 14.5 (Intel Core i9)
Node.js: v20.12.2 (Managed via ASDF)
npm: v10.5.0
Relevant Log Snippet:
2025-04-18T00:52:51.706Z [codemcp] [info] Initializing server...
2025-04-18T00:52:51.871Z [codemcp] [info] Server started and connected successfully
2025-04-18T00:52:52.457Z [codemcp] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/codemcp - Not found
npm error 404
npm error 404 'codemcp@*' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm error A complete log of this run can be found in: /Users/office/.npm/_logs/2025-04-18T00_52_52_180Z-debug-0.log
2025-04-18T00:52:54.805Z [codemcp] [info] Server transport closed
2025-04-18T00:52:54.806Z [codemcp] [info] Client transport closed
2025-04-18T00:52:54.806Z [codemcp] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. console.error('...') in JavaScript, print('...', file=sys.stderr) in python) and it will appear in this log.
2025-04-18T00:52:54.806Z [codemcp] [error] Server disconnected. For troubleshooting guidance, please visit our debugging documentation {"context":"connection"}
2025-04-18T00:52:54.807Z [codemcp] [info] Client transport closed