File size: 804 Bytes
644bdfe 2617623 644bdfe 2617623 644bdfe 2617623 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from fastapi import FastAPI
from fastmcp import create_server # β import the FastMCP factory
# ββ Parent FastAPI app βββββββββββββββββββββββββββββββββββββββββββ
app = FastAPI()
# ββ Mount the existing FastMCP server under /sse/ ββββββββββββββββ
#
# FastMCP already returns a FastAPI/Starlette app, so you can plug it
# straight into your main application.
#
vector_app = create_server(transport="sse") # keep any flags you need
app.mount("/sse", vector_app) # /sse/ now serves the API
# ββ Minimal health-check route for Hugging Face and Docker βββββββ
@app.get("/", tags=["health"])
async def root():
return {"status": "ok"}
|