Skip to content

Conversation

@hdu-sdlzx
Copy link

@hdu-sdlzx hdu-sdlzx commented Dec 16, 2025

Fixes #1303

Motivation and Context

We should handle all possible and valid HTTP status code.

How Has This Been Tested?

Tested with my local MCP server which returns 204.

Breaking Changes

No

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

@hdu-sdlzx hdu-sdlzx requested a review from a team as a code owner December 16, 2025 05:15
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 16, 2025

Open in StackBlitz

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

commit: e291f72

Copy link
Contributor

@felixweinberger felixweinberger left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! However, I don't think we should accept 204 here. The MCP spec explicitly requires 202 Accepted for notifications - accepting 204 would mask bugs in non-compliant servers.

See: https://modelcontextprotocol.io/specification/draft/basic/transports#sending-messages-to-the-server

The fix should be in the server returning 204 (looks like the Inspector based on the stack trace).

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.

Invalid MCP server response code for notificcations

2 participants