Skip to content

[BUG] First MCP tool call fails with "Connection closed" error after marketplace installation #8468

@hannesrudolph

Description

@hannesrudolph

Type

Bug

Problem / Value

When installing an MCP server from the marketplace, the first tool call immediately after installation fails with "MCP error -32000: Connection closed". The second identical call succeeds. This creates confusion for users who see the server status as "Running" but cannot use it immediately, requiring them to retry their workflow.

Context

Affects users on macOS who install MCP servers from the marketplace and attempt to use them immediately. The server shows "Running" status in the UI, but the first tool call fails. This happens specifically with the first tool call after a fresh installation - subsequent calls work correctly.

Reproduction

  1. Steps:

    • Install an MCP server from the marketplace (e.g., context7)
    • Wait for server status to show "Running"
    • Have the AI assistant call a tool from the newly installed MCP server
    • Observe error: "MCP error -32000: Connection closed"
    • Retry the exact same tool call
    • Second attempt succeeds
  2. Expected result: First tool call should succeed when server status shows "Running"

  3. Actual result: First tool call fails with connection error; only second attempt succeeds

Constraints/Preferences

The UI should not show "Running" status until the server is fully ready to accept tool calls, or there should be retry logic to handle the connection initialization race condition gracefully.

Metadata

Metadata

Assignees

Labels

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions