Skip to content

Mark SSE transport as deprecated in favor of Streamable HTTP#2310

Open
alexchenai wants to merge 1 commit intomodelcontextprotocol:mainfrom
alexchenai:deprecate-sse-transport
Open

Mark SSE transport as deprecated in favor of Streamable HTTP#2310
alexchenai wants to merge 1 commit intomodelcontextprotocol:mainfrom
alexchenai:deprecate-sse-transport

Conversation

@alexchenai
Copy link

Summary

  • Adds warnings.warn(..., DeprecationWarning, stacklevel=2) runtime warnings and .. deprecated:: docstring markers to all SSE transport entry points
  • Aligns the Python SDK with the TypeScript SDK, which already marks SSEClientTransport as @deprecated
  • Follows the wording from the TypeScript SDK: acknowledges that some servers/clients still use SSE during the migration period

Files changed

  • src/mcp/client/sse.pysse_client(): deprecation warning + docstring
  • src/mcp/server/sse.pySseServerTransport class: deprecation warning in __init__, module docstring, and class docstring
  • src/mcp/server/mcpserver/server.pyrun(transport="sse"), run_sse_async(), and sse_app(): deprecation warnings + docstrings

Context

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

  • Verify DeprecationWarning is emitted when calling sse_client()
  • Verify DeprecationWarning is emitted when instantiating SseServerTransport
  • Verify DeprecationWarning is emitted when calling MCPServer.run(transport="sse")
  • Verify DeprecationWarning is emitted when calling run_sse_async() and sse_app()
  • Existing SSE tests continue to pass (warnings do not break functionality)

🤖 Generated with Claude Code

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>
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.

Mark SSE transport as deprecated

1 participant