mirror of
https://github.com/Sun-ZhenXing/mcp-template-python.git
synced 2026-02-04 10:13:31 +00:00
feat: update config & deps
This commit is contained in:
@@ -2,11 +2,7 @@ import contextlib
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from .app.math import mcp as math
|
||||
|
||||
MCP_MAP = {
|
||||
"math": math,
|
||||
}
|
||||
from .config import MCP_MAP
|
||||
|
||||
|
||||
@contextlib.asynccontextmanager
|
||||
@@ -25,6 +21,11 @@ async def root():
|
||||
return {"message": "Welcome to the MCP Template Python Server!"}
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return {"status": "healthy"}
|
||||
|
||||
|
||||
for name, mcp in MCP_MAP.items():
|
||||
app.mount(f"/{name}/compatible", mcp.sse_app())
|
||||
app.mount(f"/{name}", mcp.streamable_http_app())
|
||||
|
||||
Reference in New Issue
Block a user