Skip to content

fix: reject batch requests in streamable HTTP transport - #957

Open
ez-lbz wants to merge 1 commit into
modelcontextprotocol:mainfrom
ez-lbz:fix/reject-jsonrpc-batch-requests
Open

fix: reject batch requests in streamable HTTP transport#957
ez-lbz wants to merge 1 commit into
modelcontextprotocol:mainfrom
ez-lbz:fix/reject-jsonrpc-batch-requests

Conversation

@ez-lbz

@ez-lbz ez-lbz commented Aug 16, 2026

Copy link
Copy Markdown

MCP has removed support for JSON-RPC batches: a POST body must be a single JSON-RPC message. The streamable HTTP server currently decodes a JsonArray body into a List<JSONRPCMessage> and replies with an array response.

This change rejects batch request bodies with 400 Bad Request (JSON-RPC error code -32600), mirroring the handling of other invalid payloads, and replaces the batch-specific tests with one asserting the rejection.

Copilot AI lite review requested due to automatic review settings August 16, 2026 15:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants