Skip to content

fix: accept JSON-only Accept in streamable JSON mode#2046

Open
raashish1601 wants to merge 1 commit into
modelcontextprotocol:v1.xfrom
raashish1601:codex/json-accept-json-response
Open

fix: accept JSON-only Accept in streamable JSON mode#2046
raashish1601 wants to merge 1 commit into
modelcontextprotocol:v1.xfrom
raashish1601:codex/json-accept-json-response

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • allow streamable HTTP JSON response mode to accept POST requests with Accept: application/json
  • keep the existing stricter application/json + text/event-stream requirement for streaming POST responses
  • add regression coverage for JSON response mode with a JSON-only Accept header

Fixes #1944.

Validation

  • npm test -- test/server/streamableHttp.test.ts
  • npm run typecheck
  • npx prettier --check src/server/webStandardStreamableHttp.ts test/server/streamableHttp.test.ts .changeset/fix-json-response-accept.md
  • git diff --check
  • npx tsc -p tsconfig.prod.json --pretty false
  • npx tsc -p tsconfig.cjs.json --pretty false

npm run build still fails on Windows before TypeScript starts because build:esm uses POSIX shell syntax (mkdir -p ... && ...). The direct ESM and CJS TypeScript build commands above both pass.

@raashish1601 raashish1601 requested a review from a team as a code owner May 11, 2026 15:22
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

🦋 Changeset detected

Latest commit: 4a29aa3

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@modelcontextprotocol/sdk@2046

commit: 4a29aa3

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.

1 participant