You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add SEP-3415 Events Extension Protocol Support #3881
The Python SDK should implement the Events extension as defined in SEP-3415, including event discovery, capability negotiation, event subscriptions, and the supported delivery mechanisms (polling, push streams, and webhooks). The implementation should also cover subscription lifecycle management, cursor-based event recovery, and relevant security requirements.
Tests, documentation, and usage examples should be included to ensure interoperability and provide a reference for developers building event-driven MCP clients and servers in Python.
I would like to help implement the reference implementation for SEP-3415 in the Python SDK.
Looking at how extensions and subscription streams are structured in the SDK today (src/mcp/client/extension.py for capability negotiation and src/mcp/client/subscriptions.py / src/mcp/shared/subscriptions.py for SEP-2575 streams):
Proposed Incremental Roadmap:
Types & Capability Negotiation:
Define the Pydantic wire models for event descriptors, subscription requests/responses, delivery parameters, and cursor pagination under src/mcp/shared/events.py (or extending mcp_types).
Wire capability advertisement into ClientCapabilities / ServerCapabilities and extension negotiation.
Client-side Subscription & Delivery Drivers:
Implement events/subscribe, events/unsubscribe, and polling/stream consumer drivers with cursor-based replay and bounded event backlog protection (mirroring the _MAX_PENDING_EVENTS safety in client/subscriptions.py).
Server-side Handlers & Lifecycle:
Add server subscription state tracking, event dispatching helpers, and transport delivery adapters.
Testing & Examples:
Add unit tests across crossed streams (jsonrpc_pair) asserting clean capability negotiation, subscription lifecycle, and cursor resume/recovery, along with client/server usage examples.
Question for Maintainers:
Would you prefer this delivered as a single cohesive PR, or staged starting with Phase 1 (types, capability models, and client subscription driver)?
If this approach aligns with the SDK's design direction, could you please assign this issue to me so I can prepare the PR?
Activity
[-]Add SEP-3415 Events Extension[/-][+]Add SEP-3415 Events Extension Protocol Support[/+]Pranjulchaurasiya commentedon Nov 21, 2026
Hi @vijaydeepsinha,
I would like to help implement the reference implementation for SEP-3415 in the Python SDK.
Looking at how extensions and subscription streams are structured in the SDK today (
src/mcp/client/extension.pyfor capability negotiation andsrc/mcp/client/subscriptions.py/src/mcp/shared/subscriptions.pyfor SEP-2575 streams):Proposed Incremental Roadmap:
Types & Capability Negotiation:
src/mcp/shared/events.py(or extendingmcp_types).ClientCapabilities/ServerCapabilitiesand extension negotiation.Client-side Subscription & Delivery Drivers:
events/subscribe,events/unsubscribe, and polling/stream consumer drivers with cursor-based replay and bounded event backlog protection (mirroring the_MAX_PENDING_EVENTSsafety inclient/subscriptions.py).Server-side Handlers & Lifecycle:
Testing & Examples:
jsonrpc_pair) asserting clean capability negotiation, subscription lifecycle, and cursor resume/recovery, along with client/server usage examples.Question for Maintainers:
Would you prefer this delivered as a single cohesive PR, or staged starting with Phase 1 (types, capability models, and client subscription driver)?
If this approach aligns with the SDK's design direction, could you please assign this issue to me so I can prepare the PR?
(Prepared with AI assistance)