Skip to content

feat: add Streamable HTTP transport support - #250

Open
bhongong wants to merge 1 commit into
idosal:mainfrom
bhongong:feat/streamable-http
Open

feat: add Streamable HTTP transport support#250
bhongong wants to merge 1 commit into
idosal:mainfrom
bhongong:feat/streamable-http

Conversation

@bhongong

Copy link
Copy Markdown

Summary

MCP clients using the Streamable HTTP transport (type: "http") send POST requests with JSON payloads and Accept: application/json, but without the text/event-stream header. The existing routing only matched requests with Accept: text/event-stream, causing Streamable HTTP requests to fall through to the React Router handler and fail with a 405 error.

Changes

Added an isStreamableHttp check in src/index.ts that detects requests with:

  • POST method + Content-Type: application/json, or
  • Accept: application/json (GET for OAuth discovery)

And routes them to MyMCP.serve() — the proper Streamable HTTP handler.

Related

Closes #244

MCP clients using the HTTP transport (type: "http") send POST requests
with JSON payloads and Accept: application/json, but without the
text/event-stream header. The existing routing only matched requests
with Accept: text/event-stream, causing Streamable HTTP requests to
fall through to the React Router handler and fail.

This adds an isStreamableHttp check that detects requests with:
- POST method + Content-Type: application/json, or
- Accept: application/json (GET for OAuth discovery)

And routes them to MyMCP.serve() — the proper Streamable HTTP handler.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 this pull request may close these issues.

Streamable HTTP error

1 participant