[Claude App] "Could not attach to MCP server github"
Closed this issue · 13 comments
Heya,
Currently trying to set up MCP server github on my Claude app without success - I always get a notification saying "Could not attach to MCP server github". Note that I can see my config on Settings > Developer.
mcp.logs
2024-11-25T21:27:47.135Z [info] Attempting to connect to MCP server github...
2024-11-25T21:27:47.152Z [info] Connected to MCP server github!
Latest version of Claude App
OS: Windows 11
Are you able to get GitHub working with the MCP Inspector? That might help narrow down whether this is an issue in the desktop app or the server configuration.
Are you able to get GitHub working with the MCP Inspector? That might help narrow down whether this is an issue in the desktop app or the server configuration.
Unfortunaly can't get MCP Inspector to work either 😅
🔍 MCP Inspector is up and running at http://localhost:5173 🚀
[server] 'PORT' n'est pas reconnu en tant que commande interne
[server] ou externe, un programme ex�cutable ou un fichier de commandes.
[server] PORT= node C:\Users\Lymdun\AppData\Local\npm-cache\_npx\5a9d879542beca3a\node_modules\@modelcontextprotocol\inspector\server\build\index.js --env npx --args="@modelcontextprotocol/server-github GITHUB_PERSONAL_ACCESS_TOKEN=ghp_rXXXXXX" exited with code 1```
Nevermind, been able to launch it - will open an issue later in Inspector repo, could be easier to launch it from Windows (in my case, had to launch both client & server by myself using npm-cache)
And the error when trying to connect:
Error in /sse route: Error: spawn npx ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn npx',
path: 'npx',
spawnargs: [ '-y', '@modelcontextprotocol/server-github' ]
}
That looks like one of the issues I was seeing here: #37
Can you try replacing the command npx
with the output of running which npx
in your terminal? (ie provide the absolute path to npx)
You're right, got this on my powershell (using "C:\Program Files\nodejs\npx.cmd"):
Spawned stdio transport
Connected MCP client to backing server transport
Created web app transport
Created web app transport
Set up MCP proxy
Received message for sessionId c451b6c5-5e25-4291-b09a-76f1578607d5
Error output from MCP Server:
npm ERR! code ENOENT
npm
ERR!
syscall lstat
npm ERR! path C:\Users\Lymdun\${APPDATA}
npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\Lymdun\${APPDATA}' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: C:\Users\Lymdun\npm-cache\_logs\2024-11-25T22_36_56_428Z-debug-0.log
Fixed by adding APPDATA varenv in inspector, now I can receive messages & use tools without issue.
Unfortunately Claude App stille have the same issue even with a fixed npx command
Note: mcp-server-github.log is empty
Just seen this log from npm-cache while toying with Claude App, looks like it is the culprit:
39 http fetch GET 200 https://registry.npmjs.org/@modelcontextprotocol%2fserver-github 1242ms (cache revalidated)
40 timing arborist:ctor Completed in 0ms
41 timing command:exec Completed in 1259ms
42 verbose stack Error: ENOENT: no such file or directory, lstat 'C:\Users\Lymdun\AppData\Local\AnthropicClaude\app-0.7.1\${APPDATA}'
42 verbose stack at async lstat (node:internal/fs/promises:1014:18)
42 verbose stack at async #loadActual (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\load-actual.js:114:20)
42 verbose stack at async exec (C:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\index.js:193:26)
42 verbose stack at async module.exports (C:\Program Files\nodejs\node_modules\npm\lib\cli-entry.js:61:5)
43 verbose cwd C:\Users\Lymdun\AppData\Local\AnthropicClaude\app-0.7.1
44 verbose Windows_NT 10.0.22631
45 verbose node v21.6.2
46 verbose npm v10.2.4
Error output from MCP Server:
npm ERR! code ENOENT npm ERR! syscall lstat npm ERR! path C:\Users\Lymdun\${APPDATA} npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\Lymdun\${APPDATA}' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: C:\Users\Lymdun\npm-cache\_logs\2024-11-25T22_36_56_428Z-debug-0.log
Did this come after making changes to the server's code, by chance? I'm a bit confused about how the path in this log is being built, or what's logging ENOENT
error messages here.
fwiw, it's likely related to how to spawn npx or the environment. "mcp-server-sqlite" which uses uvx
works for me on windows. I tried github
and puppeteer
, both them using npx
, it looks good on Settings -> Developer and also good in mcp.log which shows they are connected, but after like half or one minute, both them gets error in desktop.
There might be some improvement here,
- the logs show they are connected but actually not, currently it's info level log, it's better to reflect the reality for better feedback
- inspector seems not work on windows, as inspector also uses
npx
- when adding a new server, it seems the user needs to restart windows
Note: everything works perfect for me on macos
Error output from MCP Server:
npm ERR! code ENOENT npm ERR! syscall lstat npm ERR! path C:\Users\Lymdun\${APPDATA} npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, ls
Did this come after making changes to the server's code, by chance? I'm a bit confused about how the path in this log is being built, or what's logging
ENOENT
error messages here.
No, I was using the stock inspector the whole time along with the stock github-server from npm registry
Getting this error too for filesystem, github and memory servers
Sorry folks, we believe there's an issue with Claude Desktop launching MCP servers with npx
on Windows. Working on a fix now!
I think this is the same root cause as #40, so merging with that issue.