-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Claude Desktop invokes MCP server docker image twice on startup #812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Workaround: https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem#build
|
I see the same thing with Claude Desktop, which starts my server twice. In my case, the server starts as a binary (written in Go and compiled). I don't know how to tell Claude Desktop to start it only once. The other client (https://github.com/chrishayuk/mcp-cli) starts it once, as it should. If anybody has figured out how to fix it, please share. |
We've run into the same thing working with https://github.com/geelen/mcp-remote/. Claude Desktop initializes the MCP server process twice, causing two different authentication windows to pop up, which is very confusing for the user. I attempted to use a lockfile so that only one process could perform auth at a time as a workaround, but this resulted in brittle code that we couldn't ship. It would be much better if Claude fixed this issue |
Just to be clear - this is not specific to docker. This is for every MPC server. If you would try to listen to the socket or something like that - it would fail as well. No idea why claude does it, is that an intent or error, would be nice to have a comment from the devs. |
Took me the whole day, running windows claude 0.9.0 and have the same issue with starting twice, can't run my MCP server this way. When will it be fixed anthropic? |
You can code around it quite easily to be honest, not a big deal. Probably a good benchmark that you server isn't that bad that it must run in single instance and can't figure it out. What if you launch several Claude instances? |
I also encountered this issue. I guess maybe they want to test if a MCP server can shutdown itself properly. Anyway my app will open a port but node failed to close it after shutdown. So I have to use |
Closing since his bug looks like its specific to the Claude app and not the servers themselves. For Claude Desktop client issues this is the support link: https://support.anthropic.com/en/articles/9015913-how-to-get-support |
claude_desktop_config.json
When Claude Desktop starts, it starts the docker image twice:
This means if I specify the
--name dbhub
indocker run
, the 2nd invocation will fail due to image name conflict.I know it may not be the best place to report this bug as it seems to be a Claude Desktop bug. But it's on the CUJ when building the MCP server. I did file the bug via the Claude Desktop support link. But the format doesn't allow me to provide detailed info. So I submit here as well.
The repo: https://github.com/bytebase/dbhub/
The text was updated successfully, but these errors were encountered: