mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-19 20:55:14 +02:00
- Drop the unused fastmcp wrapper pin (mcp-requirements.txt) and depend on the official SDK directly: mcp>=2.3,<3. The code only ever imported mcp.server.* modules; fastmcp was pulled in solely as a dependency vehicle and its <4 pin kept mcp locked at 1.x. - Migrate to the SDK 2.x API: FastMCP -> MCPServer (mcp.server.mcpserver); transport_security moves from the constructor into streamable_http_app(). - Replace the deprecated SSE transport (spec-deprecated 2025-06-18) with Streamable HTTP at POST/GET/DELETE /v3/mcp/transport, mounted at /v3/mcp. - Run the StreamableHTTP session manager in the FastAPI lifespan (Starlette does not execute mounted sub-app lifespans), entered before startup finishes so no request passes the MCP ready gate first. - Authenticate every request (the SSE wrapper only checked the opening GET and trusted POSTs by session). Add a 5-minute TTL cache for API-key resolutions so the stricter per-request check does not cost a bcrypt round on every call. - Update docs to the new endpoint, auth flow, and client configuration. Wire-format verified unchanged against SDK 1.30 (structured output auto-detection and content conversion are byte-identical for the list[dict] returns used by all tool handlers).