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
{{ message }}
Repository navigation
MCPServer.add_tool() missing execution parameter for task support declaration (spec compliance gap) #2156
The MCP spec (2025-11-25) requires tools to declare task support via execution.taskSupport in the tools/list response:
In the result of tools/list, tools declare support for tasks via execution.taskSupport, which if present can have a value of "required", "optional", or "forbidden".
While server.experimental.enable_tasks() correctly handles server-level capabilities and task handler registration, there is no way to set execution.taskSupport on individual tools through the high-level API.
Current behavior
MCPServer.add_tool() (and the internal Tool model in mcp/server/mcpserver/tools/base.py) does not accept an execution parameter. Tools registered via add_tool() will always have execution: null in the tools/list response, which per spec means taskSupport defaults to "forbidden".
This means even when enable_tasks() is called and the server declares tasks.requests.tools.call capability, clients like the MCP Inspector see taskSupport as "forbidden" and disable the "Run as task" option.
Expected behavior
MCPServer.add_tool() should accept an optional execution parameter (of type ToolExecution) so developers can declare taskSupport per tool:
frommcp.typesimportToolExecution, TASK_OPTIONALmcp.add_tool(
my_handler,
name="long_running_tool",
description="A tool that takes a while",
execution=ToolExecution(taskSupport=TASK_OPTIONAL),
)
Workaround
Currently the only workaround is to monkey-patch the tools/list handler to inject execution.taskSupport into the response:
This won't work anyway, there's no way to return a CreateTaskResult object from an MCPServer registered tool. Getting Tasks support into MCPServer will require quite a bit more work.
Activity
feat: add execution parameter to add_tool() for task support declaration
feat: add execution parameter to MCPServer.add_tool() and list_tools()
feat: add execution parameter to add_tool() for task support declaration
maxisbey commentedon Mar 2, 2026
This won't work anyway, there's no way to return a
CreateTaskResultobject from an MCPServer registered tool. Getting Tasks support into MCPServer will require quite a bit more work.Closing this for now.