Skip to content

Conversation

@corvid-agent
Copy link
Contributor

Summary

  • Nested try/catch blocks in WebStandardStreamableHTTPServerTransport.handlePostRequest were returning error responses without invoking the onerror callback, making transport errors invisible to consumers
  • JSON parsing errors (req.json() failures) now call onerror before returning the error response
  • JSON-RPC message validation errors (Zod schema parse failures) now call onerror
  • writeSSEEvent failures now call onerror instead of silently returning false

Closes #1395

Test plan

  • pnpm typecheck:all passes
  • pnpm --filter @modelcontextprotocol/server test — all 37 tests pass
  • Verify onerror fires for invalid JSON request body
  • Verify onerror fires for malformed JSON-RPC messages
  • Verify onerror fires when SSE stream write fails

🤖 Generated with Claude Code

Nested try/catch blocks in WebStandardStreamableHTTPServerTransport's
handlePostRequest were returning error responses without invoking the
onerror callback, making transport errors invisible to consumers.

Fixes: - JSON parsing errors (req.json() failures) now call onerror
- JSON-RPC message validation errors now call onerror
- writeSSEEvent failures now call onerror instead of silently
  returning false

Closes modelcontextprotocol#1395

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@corvid-agent corvid-agent requested a review from a team as a code owner February 13, 2026 05:23
@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: 22d4881

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

This PR includes changesets to release 4 packages
Name Type
@modelcontextprotocol/server Patch
@modelcontextprotocol/express Patch
@modelcontextprotocol/hono Patch
@modelcontextprotocol/node Patch

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

pkg-pr-new bot commented Feb 13, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1529

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1529

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1529

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1529

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1529

commit: 22d4881

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.

Some transport errors are silently swallowed due to missing onerror callback usage

1 participant