Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -3,8 +3,8 @@ from fastapi import FastAPI, Request
|
|
| 3 |
from fastapi.responses import HTMLResponse, FileResponse
|
| 4 |
from fastapi.staticfiles import StaticFiles
|
| 5 |
from fastapi.templating import Jinja2Templates
|
| 6 |
-
from
|
| 7 |
-
from
|
| 8 |
import os
|
| 9 |
|
| 10 |
|
|
@@ -12,8 +12,8 @@ import os
|
|
| 12 |
@contextlib.asynccontextmanager
|
| 13 |
async def lifespan(app: FastAPI):
|
| 14 |
async with contextlib.AsyncExitStack() as stack:
|
| 15 |
-
await stack.enter_async_context(
|
| 16 |
-
await stack.enter_async_context(
|
| 17 |
yield
|
| 18 |
|
| 19 |
|
|
@@ -39,8 +39,8 @@ async def index(request: Request):
|
|
| 39 |
return templates.TemplateResponse("index.html", {"request": request, "base_url": base_url})
|
| 40 |
|
| 41 |
|
| 42 |
-
app.mount("/
|
| 43 |
-
app.mount("/
|
| 44 |
|
| 45 |
PORT = int(os.environ.get("PORT", "10000"))
|
| 46 |
|
|
|
|
| 3 |
from fastapi.responses import HTMLResponse, FileResponse
|
| 4 |
from fastapi.staticfiles import StaticFiles
|
| 5 |
from fastapi.templating import Jinja2Templates
|
| 6 |
+
from pokemon.pokemon_server import mcp as pokemon_mcp
|
| 7 |
+
from geogussr_server import mcp as geogussr_mcp
|
| 8 |
import os
|
| 9 |
|
| 10 |
|
|
|
|
| 12 |
@contextlib.asynccontextmanager
|
| 13 |
async def lifespan(app: FastAPI):
|
| 14 |
async with contextlib.AsyncExitStack() as stack:
|
| 15 |
+
await stack.enter_async_context(pokemon_mcp.session_manager.run())
|
| 16 |
+
await stack.enter_async_context(geogussr_mcp.session_manager.run())
|
| 17 |
yield
|
| 18 |
|
| 19 |
|
|
|
|
| 39 |
return templates.TemplateResponse("index.html", {"request": request, "base_url": base_url})
|
| 40 |
|
| 41 |
|
| 42 |
+
app.mount("/geoguessr", geogussr_mcp.streamable_http_app())
|
| 43 |
+
app.mount("/Pokemon", pokemon_mcp.streamable_http_app())
|
| 44 |
|
| 45 |
PORT = int(os.environ.get("PORT", "10000"))
|
| 46 |
|