Run stdio MCP server with Python in Claude Desktop

Mostly, the stdio MCP servers are configurated in claude_desktop_config.json using mcp-remote via node.js . Here are a few notes if you want to run stdio MCP server with Python in Claude Desktop.

run with uv

Use uv run xxx or uv tool run xxx to run a stdio server, the config like

1{
2  "mcpServers": {
3    "your-mcp": {
4      "command": "uv",
5      "args": ["run", "your-mcp-exeutable"]
6    }
7  }
8}

You may change the args to ["tool", "run", "your-mcp-exeutable"] if you are your mcp servers should be run with uv tool. If the mcp server is one of the executables in a package, change args to ["tool", "run", "--from", "your-package", "your-mcp-exeutable"]

other notes

  • For you local python repo, do not directly install editable version like uv tool install -e . or uv tool install .. Build your local repo with uv build, then install the tool via uv tool install your-mcp.whl
  • Strictly no log in stdout, since stdio protocol is very strictly with the output of the mcp server, make sure there is no log output in stdout.