Skip to content

Context object (layered, per-request) #2895

@maxisbey

Description

@maxisbey

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 _meta in the modern era, from the connection in legacy).
  • Per-request logLevel gate: no notifications/message unless the request opted in.
  • OTel and user meta= keys coexist with the envelope.
  • Typed per-transport context replaces the raw-Starlette-Request carrier; 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-stateless run (not skip) and pass

Dependencies

  • Depends on: none

References

Metadata

Metadata

Assignees

Labels

spec-2026-07-282026-07-28 MCP spec release workv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions