mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
feat: implement standard MCP protocol with SSE transport
- Use FastMCP (Anthropic MCP SDK) for tool registration and SSE transport - Mount SSE app under /v3/mcp/transport with JWT token authentication - Token passed via ?token=<jwt> query parameter on SSE connection - Token validated against GNS3 auth_service and stored in contextvars - Tool handlers create Gns3Connector with JWT token to call GNS3 REST API - 7 project tools: list_projects, get_project, create_project, delete_project, open_project, close_project, get_project_stats - Unauthenticated SSE connections return 401
This commit is contained in:
3 files changed
+288
-332
No files matched your search
@@ -83,6 +83,9 @@ def get_application() -> FastAPI:
|
||||
|
||||
app = get_application()
|
||||
|
||||
# Register MCP SSE transport routes (Starlette-level, for raw ASGI access)
|
||||
mcp.register_starlette_routes(app)
|
||||
|
||||
# Monkey Patch uvicorn signal handler to detect the application is shutting down
|
||||
app.state.exiting = False
|
||||
unicorn_exit_handler = UvicornServer.handle_exit
|
||||
|
||||
Reference in new issue
Block a user