Skip to content

Return 202 Accepted for SSE responses per MCP spec#245

Open
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:fix_sse_response_status
Open

Return 202 Accepted for SSE responses per MCP spec#245
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:fix_sse_response_status

Conversation

@koic
Copy link
Member

@koic koic commented Feb 27, 2026

Motivation and Context

StreamableHTTPTransport#send_response_to_stream returned 200 with { accepted: true } body, but the MCP spec requires 202 with empty body when a response is sent via SSE stream. This has been a requirement since Streamable HTTP was introduced in protocol version 2025-03-26.

How Has This Been Tested?

Added a repro test to verify the fix and prevent regression.

Breaking Changes

None. This fixes behavior that was incorrect with respect to the specification.

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

`StreamableHTTPTransport#send_response_to_stream` returned 200 with
`{ accepted: true }` body, but the MCP spec requires 202 with empty body
when a response is sent via SSE stream. This has been a requirement since
Streamable HTTP was introduced in protocol version 2025-03-26.

- https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#sending-messages-to-the-server
- https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#sending-messages-to-the-server
@koic koic force-pushed the fix_sse_response_status branch from 389c4bb to a02a457 Compare February 28, 2026 09:00
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