mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-26 23:54:35 +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).
11 lines
572 B
Plaintext
11 lines
572 B
Plaintext
# ==============================================================================
|
|
# GNS3 MCP (Model Context Protocol) Service Dependencies
|
|
# ==============================================================================
|
|
# Install with: pip install gns3-server[ai-features]
|
|
# Or directly: pip install -r mcp-requirements.txt
|
|
# ==============================================================================
|
|
|
|
# The official MCP SDK only — the server code imports mcp.server.mcpserver
|
|
# directly (no fastmcp wrapper). mcp 2.x: FastMCP was renamed to MCPServer.
|
|
mcp>=2.3.0,<3
|