Skip to content

Could not Connect to MCP server weather #1286

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

Open
agarwalsourabh55 opened this issue Apr 6, 2025 · 2 comments
Open

Could not Connect to MCP server weather #1286

agarwalsourabh55 opened this issue Apr 6, 2025 · 2 comments

Comments

@agarwalsourabh55
Copy link

Hi,

I'm using Windows as my operating system and running WSL within Visual Studio as my coding environment. I'm currently working through the basic "example server" tutorial from the MCP documentation (https://modelcontextprotocol.io/quickstart/server), but the MCP server doesn't seem to start when using the Claude Desktop app.

I've followed all the steps in the guide, and while the tools are accessible through the latest Interpreter tool, the server still isn’t spawning. I'm attaching the config file for reference.

{
    "mcpServers": {
        "weather": {
            "command": "/home/sourabh/.local/bin/uv",
            "args": [
                "--directory",
                "/Users/Sourabh/Downloads/mcpnew/weather",
                "run",
                "weather.py"
            ]
        }
    }

2025-04-05T20:35:33.613Z [weather] [info] Initializing server... 2025-04-05T20:35:33.634Z [weather] [error] spawn /home/sourabh/.local/bin/uv ENOENT {"context":"connection","stack":"Error: spawn /home/sourabh/.local/bin/uv ENOENT\n at ChildProcess._handle.onexit (node:internal/child_process:285:19)\n at onErrorNT (node:internal/child_process:483:16)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)"} 2025-04-05T20:35:33.635Z [weather] [error] spawn /home/sourabh/.local/bin/uv ENOENT {"stack":"Error: spawn /home/sourabh/.local/bin/uv ENOENT\n at ChildProcess._handle.onexit (node:internal/child_process:285:19)\n at onErrorNT (node:internal/child_process:483:16)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)"} 2025-04-05T20:35:33.639Z [weather] [info] Server transport closed 2025-04-05T20:35:33.639Z [weather] [info] Client transport closed 2025-04-05T20:35:33.640Z [weather] [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-05T20:35:33.640Z [weather] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}

above are the logs from the Claude Desktop MCP Server.

I tried different combination of path, tried relative path as well(although it is not recommended) its still getting stucked.

@ron-42
Copy link

ron-42 commented Apr 7, 2025

{
  "mcpServers": {
    "weather-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/home/ronak/Desktop/weather",
        "run",
        "weather.py"
      ]
    },
    "server-health-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/home/ronak/Desktop/weather",
        "run",
        "server-health.py"
      ]
    }
  }
}``

These are the mcp server that i made in Cursor, and it is working totally fine. Just change command to 'uv' in your server configuration. Probably it'll work.

@aabrego
Copy link

aabrego commented Apr 23, 2025

I was getting the same error and I fixed it by using the absolute path to my uv installation. @agarwalsourabh55 what's the ouptut when you execute this in your terminal? You need to make sure uv path used is the right one.

/home/sourabh/.local/bin/uv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants