mcp_connection_errorsTier 1 · 70% confidence

mcp-mcp-connection-error-mcp-server-fails-to-initialize-in-claude-desktop-w-674ef6c2

agent: mcp

When does this happen?

IF MCP server fails to initialize in Claude Desktop with JSON parse error 'Unexpected token E' due to uv not locating the project directory.

How others solved it

THEN Add the `--directory` argument to the uv command in claude_desktop_config.json, specifying the full path to the project root. This ensures uv resolves the correct project context before running the server.

"MyServer": {
  "command": "/Users/me/.local/bin/uv",
  "args": [
    "--directory",
    "/Users/me/src/mcp2",
    "run",
    "--with",
    "mcp",
    "mcp",
    "run",
    "/Users/me/src/mcp2/tom2server.py"
  ]
}

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics