Skip to content

No Module Error - Adding MCP server inside Claude Desktop #1836

Closed as not planned

Description

@aayushrajj

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 folder
  • uv pip install -r requirements.txt - to install all the required packages
  • uv 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

  1. anwarjupiter commented on May 25, 2025

    @anwarjupiter

    I got same error , anyone resolve this please help me

  2. aayushrajj commented on May 27, 2025

    @aayushrajj
    Author

    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.

  3. nadhir-mb commented on May 27, 2025

    @nadhir-mb

    same issue

  4. hemna commented on May 30, 2025

    @hemna

    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.

  5. dougdaley commented on Jun 1, 2025

    @dougdaley

    I'm also facing this issue.

  6. kriomant commented on Jun 1, 2025

    @kriomant

    As a workaround, instead of

        "my-mcp": {
          "command": "/opt/homebrew/bin/uv",
          "args": [
            "run",
            "--with",
            "mcp[cli]",
            "mcp",
            "run",
            "/path/to/project/server.py"
          ],
        }
    

    I use:

        "my-mcp": {
          "command": "/path/to/project/.venv/bin/mcp",
          "args": [
            "run",
            "/path/to/project/server.py"
          ],
        }
    
  7. hemna commented on Jun 4, 2025

    @hemna

    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

    haminfo mcp-server -c /path/to/my/config.conf --loglevel DEBUG
    

    Claude completely fails to do this correctly.

  8. nehapradeep commented on Jun 5, 2025

    @nehapradeep

    I am also facing the same issue, the work around is not working either

  9. kevinhorvatin-netwrix commented on Jun 13, 2025

    @kevinhorvatin-netwrix

    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"
    ],
    }

  10. kaustubhgupta commented on Jun 15, 2025

    @kaustubhgupta

    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" ], }

    This worked, but it defeats the whole purpose of having requirements.xt or pyproject.toml file. I am sure anthropic team will have a better solution to this,

  11. artoroz commented on Jul 30, 2025

    @artoroz

    This can be done using the correct working directory as seen on https://modelcontextprotocol.io/quickstart/server

    So this should be

    "my-mcp": {
        "command": "/opt/homebrew/bin/uv",
        "args": [
            "run",
            "--directory",
            "/path/to/project",
            "run",
            "/path/to/project/server.py"
        ],
    }
    
  12. kaustubhgupta commented on Aug 2, 2025

    @kaustubhgupta

    This can be done using the correct working directory as seen on https://modelcontextprotocol.io/quickstart/server

    So this should be

    "my-mcp": {
        "command": "/opt/homebrew/bin/uv",
        "args": [
            "run",
            "--directory",
            "/path/to/project",
            "run",
            "/path/to/project/server.py"
        ],
    }
    

    Thank you!, For windows as well, this is working

  13. siphamm commented on Aug 20, 2025

    @siphamm

    This can be done using the correct working directory as seen on https://modelcontextprotocol.io/quickstart/server

    So this should be

    "my-mcp": {
        "command": "/opt/homebrew/bin/uv",
        "args": [
            "run",
            "--directory",
            "/path/to/project",
            "run",
            "/path/to/project/server.py"
        ],
    }
    

    Can report this worked!

  14. cliffhall commented on Oct 19, 2026

    @cliffhall
    Member

    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.

  15. added
    closed-out-of-scopeClosed: out of scope here; listings and new servers go to the MCP Registry (#4875)
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-out-of-scopeClosed: out of scope here; listings and new servers go to the MCP Registry (#4875)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions