Skip to content

fix(transport): answer malformed Streamable HTTP bodies with 400 - #1464

Open
DaleSeo wants to merge 1 commit into
mainfrom
fix/streamable-http-malformed-body-400
Open

DaleSeo wants to merge 1 commit into
mainfrom
fix/streamable-http-malformed-body-400

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Motivation and Context

According to the transport spec, StreamableHttpService should respond to a POST body that isn’t a JSON-RPC message with 400 Bad Request and a JSON-RPC parse error, instead of 415 Unsupported Media Type.

How Has This Been Tested?

Added tests

Breaking Changes

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Every malformed body gets -32700, including valid JSON of the wrong shape (e.g. null), where -32600 would be more precise. Telling the two apart means re-parsing the body, and serde's limits (trailing bytes, number range, recursion depth) make that re-parse misclassify some inputs. The spec doesn't require the split, so this keeps one path.

@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-transport Transport layer changes labels Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@michaelneale is on triage rotation this week and is the reviewer for this one.

Labels come from the PR labeler. Please review the change.

Automated triage. Labels are a first pass and the assigned maintainer has the final say.

@DaleSeo DaleSeo self-assigned this Nov 16, 2026
@DaleSeo
DaleSeo marked this pull request as ready for review November 16, 2026 19:28
@DaleSeo
DaleSeo requested a review from a team as a code owner November 16, 2026 19:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T19:29:21.088217Z db18239 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-16T19:31:02.194796Z db18239 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-test Testing related changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant