Auth context injected by middleware GUARANTEED to exist (middleware catches auth failures)
Logger injected by middleware GUARANTEED to exist
OptionalreqHTTP request object (for HTTP transport scenarios) Optional - present when using HTTP transport with JWT/session auth
Enriched extra with guaranteed auth context and logger Handlers receive this type - never plain ServerContext
Extending
ServerContextis deliberate: this is middleware, so it adds to the SDK's request context rather than replacing it. A handler is still an SDK handler and may need what the SDK put there -signalto honour cancellation,mcpReq._meta.progressTokenand notifications to report progress,mcpReq.idto correlate logs. Narrowing this to{ authContext, logger }would read as a simplification, because the servers in this workspace happen to use none of it, and would silently remove those capabilities from every other consumer.