Closed
Labels
spec-2026-07-28Concerns the SDK's implementation of the 2026-07-28 MCP spec revisionConcerns the SDK's implementation of the 2026-07-28 MCP spec revisionv2Affects the v2 line (2.x on main)Affects the v2 line (2.x on main)
Milestone
Description
The handler-facing context: per-request client identity/capabilities/version reachable from handlers, transport info under a namespace, legacy session surface quarantined. Several other issues in this milestone add fields to this object, so settling its shape early unblocks them.
What's in it
- Layered/namespaced shape (e.g.
ctx.transport.…; legacy-only verbs/state quarantined). - Per-request client info / capabilities / protocol version reachable from handlers (fed from
_metain the modern era, from the connection in legacy). - Per-request
logLevelgate: nonotifications/messageunless the request opted in. - OTel and user
meta=keys coexist with the envelope. - Typed per-transport context replaces the raw-Starlette-
Requestcarrier; auth/headers reachable.
Conformance
- (SDK API surface — proven via in-repo tests)
- Together with Backwards compatibility & version negotiation, New HTTP serving path (modern + dual-era), Capabilities API + server/discover handler, subscriptions/listen: the per-request-logging and capability-enforcement checks inside
server-statelessrun (not skip) and pass
Dependencies
- Depends on: none
References
Metadata
Metadata
Assignees
Labels
spec-2026-07-28Concerns the SDK's implementation of the 2026-07-28 MCP spec revisionConcerns the SDK's implementation of the 2026-07-28 MCP spec revisionv2Affects the v2 line (2.x on main)Affects the v2 line (2.x on main)
Activity
maxisbey commentedon Jul 1, 2026
Shipped in v2.0.0b1: typed per-transport context, per-request client identity/capabilities/version from the envelope, the per-request logLevel gate, and OTel/user meta coexistence. This issue's conformance bar — the per-request-logging and capability-enforcement checks inside
server-statelessrunning and passing — is met. Some context-API ergonomic refinements remain tracked as post-beta polish.AI Disclaimer
cclabadmin commentedon Jul 11, 2026
Hello @maxisbey , I can still reproduce a request-scoped
notifications/messageonv2.0.0b1when the originating 2026-07-28 request does not includeio.modelcontextprotocol/logLevel.I reproduced this with the
simple-streamablehttp-statelessexample server onv2.0.0b1(0da9092). The request used a valid 2026-07-28 envelope and the requiredMcp-MethodandMcp-Nameheaders; the only relevant field omitted from_metawasio.modelcontextprotocol/logLevel:{ "jsonrpc": "2.0", "id": 1001, "method": "tools/call", "params": { "name": "start-notification-stream", "_meta": { "io.modelcontextprotocol/protocolVersion": "2026-07-28", "io.modelcontextprotocol/clientInfo": {"name": "repro", "version": "0.1.0"}, "io.modelcontextprotocol/clientCapabilities": {} }, "arguments": {"interval": 1, "count": 1, "caller": "rc-repro"} } }The request returned HTTP 200 and emitted the following request-scoped log notification on that request's response stream before the final response:
{"jsonrpc":"2.0","method":"notifications/message","params":{"level":"info","logger":"notification_stream","data":"Notification 1/1 from caller: rc-repro"}}The reproduced example path calls
ctx.session.send_log_message(..., related_request_id=ctx.request_id).ServerSession.send_log_message()forwards the log notification through the request-scoped channel, but I do not see a check forio.modelcontextprotocol/logLevelin the originating request's_meta.Context.log()also appears to send a request-scopednotifications/messagewithout consulting that metadata.Since #2895 lists the per-request
logLevelgate as completed, I wanted to flag that this request-scopedServerSession.send_log_message()path still reproduces onv2.0.0b1. Is this an uncovered path in the current implementation, or am I missing another condition required for the gate to apply?