Skip to content

Remove batching support from StreamableHttpServerTransport #372

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

halter73
Copy link
Contributor

@halter73 halter73 commented May 1, 2025

I closed #158 which was our issue tracking support for JSON-RPC batching because the requirement has been removed from the draft specification as of modelcontextprotocol/modelcontextprotocol#416, and the feature didn't seem particularly useful. The SDK never sent batched messages.

I removed the batching support from the client in my Streamable HTTP client PR (#356), and this follows up to do the same thing for the server.

@stephentoub We could now more conveniently update the StreamableHttpServerTransport.HandlePostRequest(IDuplexPipe httpBodies, CancellationToken cancellationToken) method to take a duplex Stream instead of an IDuplexPipe without introducing extra copying if you also want to do that as part of this change.

@stephentoub
Copy link
Contributor

We could now more conveniently update the StreamableHttpServerTransport.HandlePostRequest(IDuplexPipe httpBodies, CancellationToken cancellationToken) method to take a duplex Stream instead of an IDuplexPipe without introducing extra copying if you also want to do that as part of this change.

Sounds good, either in this PR or a follow-up. Thanks!

We should also consider having ctors on StreamServer/ClientTransport, accepting a single duplex Stream rather than one for each direction, but that can also be a separate thing.

@halter73 halter73 merged commit bac97ef into modelcontextprotocol:main May 1, 2025
19 of 21 checks passed
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.

[2025-03-26 spec] Implement JSON-RPC batching
2 participants