From 92fa2c3f1126674663ae280aea3996e166a20ea2 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 24 Dec 2025 04:56:33 +0000 Subject: [PATCH] refactor: mount FastMCP app at root and retain /health for compatibility --- src/monarch_mcp_custom/server.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/monarch_mcp_custom/server.py b/src/monarch_mcp_custom/server.py index 369aac7..0336172 100644 --- a/src/monarch_mcp_custom/server.py +++ b/src/monarch_mcp_custom/server.py @@ -184,12 +184,13 @@ def create_app(): # FastMCP.http_app() already includes its own health check and SSE routes. # By default it uses /sse for the stream and /messages for POSTs. - routes = [ - Route("/health", health_check, methods=["GET"]), - Mount("/mcp", app=mcp_app), - ] - - return Starlette(routes=routes, lifespan=mcp_app.lifespan) + return Starlette( + routes=[ + Route("/health", health_check, methods=["GET"]), + Mount("/", app=mcp_app), + ], + lifespan=mcp_app.lifespan, + ) app = create_app()