Skip to content

Fast MCP Server Initializes Twice #301

@dino-su

Description

@dino-su

Describe the bug

When running Fast MCP Server with the current configuration, the server initializes twice in quick succession (within ~1 second). This can be observed in the logs where the "Initializing server..." message appears twice, followed by two successful connections and identical initialize method calls.

To Reproduce

  1. Configure Fast MCP Server with the following settings:
"git": {
  "command": "uv",
  "args": [
    "run",
    "--with",
    "mcp[cli]",
    "mcp",
    "run",
    "fastmcp_git_servers.py"
  ]
}
  1. Start the Claude Desktop app
  2. Observe the duplicate initialization messages

Observation

The server initializes twice as shown in the logs below. Note the timestamps showing two initialization sequences less than 1 second apart:

2025-03-16T13:52:00.467Z [Git] [info] Initializing server...
2025-03-16T13:52:00.491Z [Git] [info] Server started and connected successfully
2025-03-16T13:52:00.495Z [Git] [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}
2025-03-16T13:52:01.398Z [Git] [info] Initializing server...
2025-03-16T13:52:01.707Z [Git] [info] Server started and connected successfully
2025-03-16T13:52:01.708Z [Git] [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}

Expected behavior
The server should initialize only once per execution.

Desktop (please complete the following information):

  • OS: macOS Sonoma 14.2.1
  • Claude Desktop: 0.8.1
  • Python SDK: 1.4.0

Additional context

The non-fast MCP server implementation doesn't have this problem. The key difference appears to be in how the server is launched:

"git": {
  "command": "uv",
  "args": [
    "--directory",
    "src/non-fast-mcp-server",
    "run",
    "git"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions