www
Browse files
app.py
CHANGED
|
@@ -2,15 +2,14 @@ from fastapi import FastAPI
|
|
| 2 |
from fastapi.routing import APIRoute
|
| 3 |
from mcp_server_mariadb_vector.server import mcp
|
| 4 |
|
| 5 |
-
# Create the main FastAPI app
|
| 6 |
app = FastAPI()
|
| 7 |
|
| 8 |
-
# Create a health endpoint on the main FastAPI app
|
| 9 |
@app.get("/", tags=["health"])
|
| 10 |
async def root():
|
| 11 |
return {"status": "ok"}
|
| 12 |
|
| 13 |
-
app
|
|
|
|
| 14 |
|
| 15 |
print("Registered routes in main app:")
|
| 16 |
for route in app.routes:
|
|
@@ -19,11 +18,3 @@ for route in app.routes:
|
|
| 19 |
else:
|
| 20 |
print(route.path, type(route))
|
| 21 |
|
| 22 |
-
# Try to access the routes in the mounted app (mcp_app) if possible
|
| 23 |
-
print("\nAttempting to inspect MCP app routes:")
|
| 24 |
-
try:
|
| 25 |
-
for route in app.routes:
|
| 26 |
-
print(route.path, getattr(route, "methods", type(route)))
|
| 27 |
-
except Exception as e:
|
| 28 |
-
print(f"Couldn't inspect MCP app routes: {e}")
|
| 29 |
-
|
|
|
|
| 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 /mcp
|
| 12 |
+
app.mount("/mcp", mcp.http_app())
|
| 13 |
|
| 14 |
print("Registered routes in main app:")
|
| 15 |
for route in app.routes:
|
|
|
|
| 18 |
else:
|
| 19 |
print(route.path, type(route))
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|