-
Notifications
You must be signed in to change notification settings - Fork 230
MCP server fails to start: FastMCP.tool() does not accept timeout kwarg #377
Description
Bug Description
The MCP server fails to start because FastMCP.tool() does not support the timeout keyword argument. Several tool registrations pass timeout= to the @mcp.tool() decorator, which causes a TypeError at import time.
Error
TypeError: FastMCP.tool() got an unexpected keyword argument 'timeout'
Affected Files
databricks_mcp_server/tools/pipelines.pyline 156:@mcp.tool(timeout=300)databricks_mcp_server/tools/pdf.pyline 14:@mcp.tool(timeout=300.0)databricks_mcp_server/tools/pdf.pyline 104:@mcp.tool(timeout=60.0)
Environment
- mcp: 1.26.0
- fastmcp: 2.14.5
- OS: Windows 11
- Python: 3.12 (ai-dev-kit venv)
- AI Dev Kit version: 0.1.6
Root Cause
FastMCP.tool() in fastmcp 2.14.5 does not accept a timeout parameter. The decorator signature only supports name, description, annotations, and tags. The timeout kwarg was likely intended for a newer or different version of FastMCP that hasn't been released yet, or for a custom wrapper.
Workaround
Adding kwargs.pop("timeout", None) to the patched_tool() function in server.py (the existing Windows compatibility patch in _patch_tool_decorator_for_windows) strips the unsupported kwarg before it reaches FastMCP.tool():
@functools.wraps(original_tool)
def patched_tool(fn=None, *args, **kwargs):
# Strip kwargs not supported by FastMCP.tool()
kwargs.pop("timeout", None)
# Handle @mcp.tool("name") — returns a decorator
if fn is None or isinstance(fn, str):
...Suggested Fix
Either:
- Remove
timeout=from the@mcp.tool()decorators inpipelines.pyandpdf.py - Pin a fastmcp version that supports
timeoutinpyproject.toml/requirements.txt - Add the
kwargs.pop("timeout", None)workaround toserver.py's existingpatched_tool()function
Reproducibility
This breaks on every fresh install or update of ai-dev-kit v0.1.6 when using fastmcp 2.14.5. The MCP server cannot start at all — no tools are available.