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
[Bug] fastmcp run silently drops --path, --stateless and --log-level for SDK MCPServer (v1) servers #5869
fastmcp run accepts --path, --stateless and --log-level for every server type, but silently drops all three when the target module exposes the SDK mcp.server.mcpserver.MCPServer (v1) instead of FastMCP. The server serves the SDK defaults (/mcp for HTTP, /sse for SSE) and remains stateful, while docs/cli/running.mdx documents --path generically for HTTP. Host and port are forwarded correctly, so the omission is easy to miss.
path and stateless are absent (and log_level is likewise ignored). Expected: /custom served in stateless mode for HTTP, and /custom for SSE.
Root cause
fastmcp_slim/fastmcp/cli/run.py:242-243 calls run_v1_server_async(server, host=host, port=port, transport=transport), omitting the already-parsed path, stateless and log_level. run_v1_server_async (same file, ~316-341) has no parameters for them and only builds host/port kwargs. Existing v1 tests assert only the runner method and host/port, so the gap is uncovered.
Suggested fix
Thread path, stateless and log_level into run_v1_server_async and pass the SDK's supported kwargs (streamable_http_path, stateless_http for HTTP/streamable-http; sse_path for SSE). Apply log_level through the SDK server's settings if supported; otherwise document the limitation rather than faking it. Only pass non-None values so SDK defaults are preserved.
Tests
A fix with CLI tests is ready: HTTP/SSE runner kwargs asserted, stateless_http=True only when requested, defaults unchanged when flags are absent. I'll open the linked PR with red/green evidence.
Activity
fix(cli): forward path, stateless and log-level to SDK MCPServer serv…
[4.1] Backport fixes for 4.1.8 (#6415)