Mark SSE transport as deprecated in favor of Streamable HTTP#2310
Open
alexchenai wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
Mark SSE transport as deprecated in favor of Streamable HTTP#2310alexchenai wants to merge 1 commit intomodelcontextprotocol:mainfrom
alexchenai wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Add DeprecationWarning and docstring deprecation notices to: - sse_client() in client/sse.py - SseServerTransport in server/sse.py - MCPServer.run(transport="sse"), run_sse_async(), and sse_app() The HTTP+SSE transport was replaced by Streamable HTTP in protocol revision 2025-03-26. The TypeScript SDK already marks SSEClientTransport as deprecated; this brings the Python SDK into alignment. Closes modelcontextprotocol#2278 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
warnings.warn(..., DeprecationWarning, stacklevel=2)runtime warnings and.. deprecated::docstring markers to all SSE transport entry pointsSSEClientTransportas@deprecatedFiles changed
src/mcp/client/sse.py—sse_client(): deprecation warning + docstringsrc/mcp/server/sse.py—SseServerTransportclass: deprecation warning in__init__, module docstring, and class docstringsrc/mcp/server/mcpserver/server.py—run(transport="sse"),run_sse_async(), andsse_app(): deprecation warnings + docstringsContext
The HTTP+SSE transport was replaced by Streamable HTTP in protocol revision 2025-03-26. The spec now refers to it as the "deprecated HTTP+SSE transport".
Closes #2278
Test plan
DeprecationWarningis emitted when callingsse_client()DeprecationWarningis emitted when instantiatingSseServerTransportDeprecationWarningis emitted when callingMCPServer.run(transport="sse")DeprecationWarningis emitted when callingrun_sse_async()andsse_app()🤖 Generated with Claude Code