@@ -85,7 +85,7 @@ async def main():
8585from mcp .server .lowlevel .func_inspection import create_call_wrapper
8686from mcp .server .lowlevel .helper_types import ReadResourceContents
8787from mcp .server .models import InitializationOptions
88- from mcp .server .session import ServerSession
88+ from mcp .server .session import ServerSession , ServerTransportSession
8989from mcp .shared .context import RequestContext
9090from mcp .shared .exceptions import McpError
9191from mcp .shared .message import ServerMessageMetadata , SessionMessage
@@ -102,7 +102,7 @@ async def main():
102102CombinationContent : TypeAlias = tuple [UnstructuredContent , StructuredContent ]
103103
104104# This will be properly typed in each Server instance's context
105- request_ctx : contextvars .ContextVar [RequestContext [ServerSession , Any , Any ]] = contextvars .ContextVar ("request_ctx" )
105+ request_ctx : contextvars .ContextVar [RequestContext [ServerTransportSession , Any , Any ]] = contextvars .ContextVar ("request_ctx" )
106106
107107
108108class NotificationOptions :
@@ -231,7 +231,7 @@ def get_capabilities(
231231 @property
232232 def request_context (
233233 self ,
234- ) -> RequestContext [ServerSession , LifespanResultT , RequestT ]:
234+ ) -> RequestContext [ServerTransportSession , LifespanResultT , RequestT ]:
235235 """If called outside of a request context, this will raise a LookupError."""
236236 return request_ctx .get ()
237237
0 commit comments