-
Notifications
You must be signed in to change notification settings - Fork 161
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The StreamableHttpClientTransport
client violates the MCP specification when connecting to servers that don't support SSE and only use JSON responses
To Reproduce
Steps to reproduce the behavior:
- Client sends POST initialize request
- Server responds with 200 OK, Content-Type: application/json
- Client sends POST notifications/initialized
- Server responds with 202 Accepted
- Client attempts GET request to open SSE stream
- Server responds with 200 OK, Content-Type: application/json (or 405 Method Not Allowed)
- Client throws SSEClientException instead of gracefully handling JSON-only mode
Expected behavior
- If the input contains any number of JSON-RPC requests, the server MUST either return Content-Type: text/event-stream, to initiate an SSE stream, or Content-Type: application/json, to return one JSON object. The client MUST support both these cases.
spec
Additional context
The startSseSession()
method doesn't handle the case where the server returns application/json
instead of
text/event-stream
, which is a valid response indicating the server operates in JSON-only mode.
joaoseidel
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working