Initialize FastMCP lifespan for management discovery
This commit is contained in:
1 parent
a94f8997b9
commit
5c5efdb163
1 file changed
+2
@@ -96,6 +96,8 @@ def inst(s):
|
|||||||
cache[s]=x.http_app(path="/mcp",transport="streamable-http",stateless_http=True);return cache[s]
|
cache[s]=x.http_app(path="/mcp",transport="streamable-http",stateless_http=True);return cache[s]
|
||||||
class Router:
|
class Router:
|
||||||
async def __call__(self,scope,receive,send):
|
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","/")
|
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=="my.phast.app":await mgmt(scope,receive,send);return
|
||||||
if h.endswith(".phast.app"):
|
if h.endswith(".phast.app"):
|
||||||
|
|||||||
Reference in new issue
Block a user