diff --git a/src/monarch_mcp_custom/server.py b/src/monarch_mcp_custom/server.py index 0336172..4f16212 100644 --- a/src/monarch_mcp_custom/server.py +++ b/src/monarch_mcp_custom/server.py @@ -177,20 +177,14 @@ async def health_check(request): # --- ASGI App Setup --- -def create_app(): - """Create the Starlette application with MCP at /.""" +def create_app() -> Starlette: + """Create the Starlette application with health check and MCP.""" mcp_app = mcp.http_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. + # Add health check route directly to the MCP app + mcp_app.add_route("/health", health_check, methods=["GET"]) - return Starlette( - routes=[ - Route("/health", health_check, methods=["GET"]), - Mount("/", app=mcp_app), - ], - lifespan=mcp_app.lifespan, - ) + return mcp_app app = create_app()