Skip to content

Timeout Error When Connecting Claude Desktop to Local HTTP SSE MCP Server Using Bridge #5

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

Closed
wmxl opened this issue Mar 30, 2025 · 1 comment · Fixed by #6
Closed

Comments

@wmxl
Copy link

wmxl commented Mar 30, 2025

Description

I'm trying to connect Claude Desktop to a local MCP server running over HTTP with SSE transport. I'm using a bridge to convert between stdio (which Claude Desktop supports) and HTTP SSE (which my server uses).

Environment

Issue

The connection times out during initialization. Claude Desktop sends the initialize request, but after 60 seconds, it times out with error -32001.

Log Output

2025-03-30T08:13:04.000Z [Claude Gateway Example] [info] Initializing server...
2025-03-30T08:13:04.010Z [Claude Gateway Example] [info] Server started and connected successfully
2025-03-30T08:13:04.013Z [Claude Gateway Example] [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}
-- Connecting to MCP server at http://localhost:8080/api/sse?apiKey=zym
--- SSE backend connected
-- MCP stdio to SSE gateway running - connected to http://localhost:8080/api/sse?apiKey=zym
--> {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
2025-03-30T08:13:05.303Z [Claude Gateway Example] [info] Initializing server...
2025-03-30T08:13:05.321Z [Claude Gateway Example] [info] Server started and connected successfully
2025-03-30T08:13:05.327Z [Claude Gateway Example] [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}
-- Connecting to MCP server at http://localhost:8080/api/sse?apiKey=zym
--- SSE backend connected
-- MCP stdio to SSE gateway running - connected to http://localhost:8080/api/sse?apiKey=zym
--> {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
2025-03-30T08:14:04.011Z [Claude Gateway Example] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-30T08:14:04.012Z [Claude Gateway Example] [info] Client transport closed
2025-03-30T08:14:04.014Z [Claude Gateway Example] [info] Server transport closed
2025-03-30T08:14:04.014Z [Claude Gateway Example] [info] Client transport closed
2025-03-30T08:14:04.014Z [Claude Gateway Example] [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-03-30T08:14:04.014Z [Claude Gateway Example] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
--> {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-30T08:14:04.039Z [Claude Gateway Example] [info] Server transport closed
2025-03-30T08:14:04.039Z [Claude Gateway Example] [info] Client transport closed
2025-03-30T08:14:05.329Z [Claude Gateway Example] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-30T08:14:05.329Z [Claude Gateway Example] [info] Client transport closed
2025-03-30T08:14:05.330Z [Claude Gateway Example] [info] Server transport closed
2025-03-30T08:14:05.330Z [Claude Gateway Example] [info] Client transport closed
2025-03-30T08:14:05.330Z [Claude Gateway Example] [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-03-30T08:14:05.330Z [Claude Gateway Example] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
--> {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-30T08:14:05.343Z [Claude Gateway Example] [info] Server transport closed
2025-03-30T08:14:05.343Z [Claude Gateway Example] [info] Client transport closed

I also found that when I do claude_gateway http://localhost:8080/api/sse\?apiKey\=zym
the apiKey my server receive is actually zym/sse, so I have to remove the /sse part

@dforsber
Copy link
Collaborator

Thank you for reporting. The query parameter fixed itself with the latest mcp sdk update. I fixed the endpoint also to use the advertised endpoint without merging query parameters.

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

Successfully merging a pull request may close this issue.

2 participants