Skip to content

Accept header error with streamable http transport #69

@djoreilly

Description

@djoreilly

To reproduce run the mcp server from https://github.com/modelcontextprotocol/python-sdk/tree/main/examples/servers/simple-streamablehttp, and try to connect to it

$ go run cmd/mcptools/main.go tools http://localhost:3000/mcp
Error: init error: failed to send initialized notification: notification failed with status 406: {"jsonrpc":"2.0","id":"server-error","error":{"code":-32600,"message":"Not Acceptable: Client must accept both application/json and text/event-stream"}}
Example: mcp tools npx -y @modelcontextprotocol/server-filesystem ~
exit status 1
$ uv run mcp-simple-streamablehttp --port 3000
INFO:     Started server process [86552]
INFO:     Waiting for application startup.
2025-07-21 12:12:47,808 - mcp.server.streamable_http_manager - INFO - StreamableHTTP session manager started
2025-07-21 12:12:47,808 - mcp_simple_streamablehttp.server - INFO - Application started with StreamableHTTP session manager!
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:3000 (Press CTRL+C to quit)
INFO:     127.0.0.1:34240 - "POST /mcp HTTP/1.1" 307 Temporary Redirect
2025-07-21 12:12:50,553 - mcp.server.streamable_http_manager - INFO - Created new transport with session ID: e7a9db2c46594bbbba66f854d26545bb
INFO:     127.0.0.1:34240 - "POST /mcp/ HTTP/1.1" 200 OK
INFO:     127.0.0.1:34250 - "POST /mcp HTTP/1.1" 307 Temporary Redirect
INFO:     127.0.0.1:34250 - "POST /mcp/ HTTP/1.1" 406 Not Acceptable

This is fixed in mcp-go mark3labs/mcp-go@ffc63d9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions