Task capability not configured at the server level when expected
Initial Checks
- [x] I confirm that I'm using the latest version of MCP Python SDK
- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue
Description
The enable_tasks() method doesn't properly set the tasks.requests.tools.call capability on the server, causing compatibility issues with clients that assert against server capabilities before attempting task support on a tool invocation.
Identified during https://github.com/strands-agents/sdk-python/pull/1475.
Example Code
Python & MCP Python SDK
Python 3.12.9
MCP SDK 1.25.0
Have a potential fix, putting up pr
This was fixed in #1854 (merged Jan 15) — the TasksToolsCapability() was missing the call=TasksCallCapability() argument in update_capabilities().
Before the fix:
capabilities.tasks.requests = ServerTasksRequestsCapability(
tools=TasksToolsCapability() # call was None
)
After #1854:
capabilities.tasks.requests = ServerTasksRequestsCapability(
tools=TasksToolsCapability(call=TasksCallCapability())
)
This should be available in SDK versions > 1.25.0. Can this issue be closed?
This is still a problem, was that reverted? Relevant code is here.
@LucaButBoring The fix is present on main and was included in v1.26.0 (released Jan 24). The line you linked (experimental.py:L81) shows:
capabilities.tasks.requests = ServerTasksRequestsCapability(
tools=TasksToolsCapability(call=TasksCallCapability())
)
That call=TasksCallCapability() argument is the fix from #1854. Before the fix it was just TasksToolsCapability() with no call.
Are you maybe running an older SDK version? Check with pip show mcp — you need >= 1.26.0.
It looks fixed on main, but I am on 1.26.0 - this is the line from the commit at which that was released from: https://github.com/modelcontextprotocol/python-sdk/blob/3d9d34552a9ab8988acf8d06e4a705bd799fc32b/src/mcp/server/lowlevel/experimental.py#L82
You're absolutely right, apologies for the incorrect info! I double-checked:
- PR #1854 was merged to
mainon Jan 15 - v1.26.0 was tagged on Jan 24 from the
v1.xbranch
The fix commit (b26e5b9) is on main but was never backported to v1.x, so it's not in any release yet.
# v1.26.0 (v1.x branch) — still has the bug:
tools=TasksToolsCapability()
# main — has the fix:
tools=TasksToolsCapability(call=TasksCallCapability())
This needs a backport to v1.x to ship in the next release. I can open a cherry-pick PR if the maintainers would like.
Opened #2137 to backport the fix to v1.x so it ships in the next release.
Fixed in #1854 (main) and #2137 (v1.x backport).