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 βββββββ | |
async def root(): | |
return {"status": "ok"} | |