Repository navigation
Description
I am trying to add a MCP server in claude desktop. After properly installing required packages, still getting errors.
Also, I have added a simple MCP server earlier in the claude desktop that is running properly.
Steps that I did for creating and adding the server to claude destop-
uv add "mcp[cli]"- To add mcp cli in the project folderuv pip install -r requirements.txt- to install all the required packagesuv run mcp install main.py- to add the server inside claude desktop
I am seeing a successful installation message in the terminal, but when I open claude desktop it shows the server fails to run due to a missing module error in the error logs.
ERROR LOGS -
2025-05-19T13:44:08.019Z [TestServer] [info] Initializing server...
2025-05-19T13:44:08.050Z [TestServer] [info] Server started and connected successfully
2025-05-19T13:44:08.052Z [TestServer] [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}
Failed to run server: No module named 'fitz'
2025-05-19T13:44:09.663Z [TestServer] [info] Server transport closed
2025-05-19T13:44:09.664Z [TestServer] [info] Client transport closed
2025-05-19T13:44:09.664Z [TestServer] [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-05-19T13:44:09.664Z [TestServer] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-05-19T13:44:09.664Z [TestServer] [info] Client transport closed
Can anyone please help on what I might be doing wrong for this one?
Activity
anwarjupiter commentedon May 25, 2025
I got same error , anyone resolve this please help me
aayushrajj commentedon May 27, 2025
No, still haven't found anything resolves this issue.
Any server with no additional packages, are getting added onto Claude Desktop properly and working. But whenever I try to add a server with tools using some packages it gives error while adding it to Claude Desktop.
nadhir-mb commentedon May 27, 2025
same issue
hemna commentedon May 30, 2025
I have this same problem. I even tried running with uv run --directory /path/to/my/mcp.py
fails.
Looks like the integration of Claude Desktop doesn't really work for python mcp servers that need a virtual environment setup with all the required installed packages.
dougdaley commentedon Jun 1, 2025
I'm also facing this issue.
kriomant commentedon Jun 1, 2025
As a workaround, instead of
I use:
hemna commentedon Jun 4, 2025
unfortunately, that doesn't work for python scripts that are wrapped in click.
my python project generates an executable that needs a command and a config option on the commandline, such as
Claude completely fails to do this correctly.
nehapradeep commentedon Jun 5, 2025
I am also facing the same issue, the work around is not working either
kevinhorvatin-netwrix commentedon Jun 13, 2025
I ran into the same problem, I was able to address it by adding another "--with", "pyjwt" before the "run"
so basically this:
"my-mcp": {
"command": "/opt/homebrew/bin/uv",
"args": [
"run",
"--with",
"mcp[cli]",
"--with",
"pyjwt",
"mcp",
"run",
"/path/to/project/server.py"
],
}
kaustubhgupta commentedon Jun 15, 2025
This worked, but it defeats the whole purpose of having
requirements.xtorpyproject.tomlfile. I am sure anthropic team will have a better solution to this,artoroz commentedon Jul 30, 2025
This can be done using the correct working directory as seen on https://modelcontextprotocol.io/quickstart/server
So this should be
kaustubhgupta commentedon Aug 2, 2025
Thank you!, For windows as well, this is working
siphamm commentedon Aug 20, 2025
Can report this worked!
cliffhall commentedon Oct 19, 2026
Thank you for the report. This looks like it belongs to the Python SDK rather than to the reference servers, which are built on it. Please file it there. If it turns out to reproduce only through one of these servers on the v2 release, open a fresh issue here with the steps.
This is part of the backlog triage in #4875.