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"}