From 5c5efdb163c64ebfedf923e6c70e3cdf7a2f9614 Mon Sep 17 00:00:00 2001 From: Boring Date: Sun, 4 Oct 2026 04:29:19 +0000 Subject: [PATCH] Initialize FastMCP lifespan for management discovery --- server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.py b/server.py index a7915bd..69ea9fe 100644 --- a/server.py +++ b/server.py @@ -96,6 +96,8 @@ def inst(s): cache[s]=x.http_app(path="/mcp",transport="streamable-http",stateless_http=True);return cache[s] class Router: async def __call__(self,scope,receive,send): + if scope.get("type")=="lifespan": + await mgmt(scope,receive,send);return h=dict(scope.get("headers",[])).get(b"host",b"").decode().split(":")[0].lower();p=scope.get("path","/") if h=="my.phast.app":await mgmt(scope,receive,send);return if h.endswith(".phast.app"):