You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
417 B
Python
23 lines
417 B
Python
from __future__ import annotations
|
|
|
|
from contextlib import asynccontextmanager
|
|
|
|
from starlette.applications import Starlette
|
|
from starlette.routing import Mount
|
|
|
|
from app.mcp import mcp
|
|
|
|
|
|
@asynccontextmanager
|
|
async def lifespan(_: Starlette):
|
|
async with mcp.session_manager.run():
|
|
yield
|
|
|
|
|
|
app = Starlette(
|
|
routes=[
|
|
Mount("/mcp", app=mcp.streamable_http_app()),
|
|
],
|
|
lifespan=lifespan,
|
|
)
|