Kaballas commited on
Commit
377ab59
·
1 Parent(s): 8e8fff2
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,14 +2,14 @@ from fastapi import FastAPI
2
  from fastapi.routing import APIRoute
3
  from mcp_server_mariadb_vector.server import mcp
4
 
5
- app = FastAPI()
 
6
 
7
  @app.get("/", tags=["health"])
8
  async def root():
9
  return {"status": "ok"}
10
 
11
- # Mount the MCP app at /sse (to match README and default behavior)
12
- app.mount("/sse", mcp.http_app())
13
 
14
  print("Registered routes in main app:")
15
  for route in app.routes:
 
2
  from fastapi.routing import APIRoute
3
  from mcp_server_mariadb_vector.server import mcp
4
 
5
+ mcp_app = mcp.http_app()
6
+ app = FastAPI(lifespan=mcp_app.lifespan)
7
 
8
  @app.get("/", tags=["health"])
9
  async def root():
10
  return {"status": "ok"}
11
 
12
+ app.mount("/sse", mcp_app)
 
13
 
14
  print("Registered routes in main app:")
15
  for route in app.routes: