Skip to content

fix(mcphttp): cap JSON-RPC response bodies - #357

Merged
BaaRai merged 1 commit into
BaaRai:mainfrom
Coff0xc:fix/mcp-rpc-limit
Nov 19, 2026
Merged

BaaRai merged 1 commit into
BaaRai:mainfrom
Coff0xc:fix/mcp-rpc-limit

Conversation

@Coff0xc

@Coff0xc Coff0xc commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Streamable HTTP decoded the whole JSON-RPC response with no byte limit, so a remote MCP server could force an unbounded allocation.

Cap JSON bodies and SSE data payloads at 8 MiB.

Tested: go test ./mcphttp pass.

Copilot AI balanced review requested due to automatic review settings November 19, 2026 02:18

Copilot AI left a comment

Copy link
Copy Markdown

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 insufficient remaining quota. Try requesting a review at a lower effort level.

Streamable HTTP decoded the whole response with no byte limit, so a
remote MCP server could force an unbounded allocation.
@BaaRai
BaaRai merged commit b8ec69d into BaaRai:main Nov 19, 2026
5 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.

3 participants