You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In Tool.from_function, the detection of Context parameters only matches the bare Context type. Functions annotated with parameterized generics such as Context[ServerSession, MyContext] are not recognized, causing tool.context_kwarg to remain None.
Describe the bug
In
Tool.from_function
, the detection ofContext
parameters only matches the bareContext
type. Functions annotated with parameterized generics such asContext[ServerSession, MyContext]
are not recognized, causingtool.context_kwarg
to remainNone
.To Reproduce
Screenshots

Environment:
Additional context
Suggest one-line fix at
mcp/server/fastmcp/tools/base.py:56
:and a unit test to verify:
The text was updated successfully, but these errors were encountered: