Skip to content

Commit 2628e01

Browse files
Merge pull request #217 from modelcontextprotocol/jerome/fix/request-context-typing
Updated typing on request context for the server to use server session
1 parent a50cf92 commit 2628e01

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mcp/server/fastmcp/server.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from mcp.server.lowlevel.server import (
3535
lifespan as default_lifespan,
3636
)
37+
from mcp.server.session import ServerSession
3738
from mcp.server.sse import SseServerTransport
3839
from mcp.server.stdio import stdio_server
3940
from mcp.shared.context import RequestContext
@@ -597,7 +598,7 @@ def my_tool(x: int, ctx: Context) -> str:
597598
The context is optional - tools that don't need it can omit the parameter.
598599
"""
599600

600-
_request_context: RequestContext | None
601+
_request_context: RequestContext[ServerSession, Any] | None
601602
_fastmcp: FastMCP | None
602603

603604
def __init__(

0 commit comments

Comments
 (0)