from fastapi import FastAPI from fastapi.routing import APIRoute from mcp_server_mariadb_vector.server import mcp # Create the main FastAPI app app = FastAPI() # Create a health endpoint on the main FastAPI app @app.get("/", tags=["health"]) async def root(): return {"status": "ok"} # Mount the MCP HTTP app at /api mcp_app = mcp.http_app() app.mount("/api", mcp_app) print("Registered routes in main app:") for route in app.routes: if isinstance(route, APIRoute): print(route.path, route.methods) else: print(route.path, type(route)) # Try to access the routes in the mounted app (mcp_app) if possible print("\nAttempting to inspect MCP app routes:") try: for route in mcp_app.routes: print(route.path, getattr(route, "methods", type(route))) except Exception as e: print(f"Couldn't inspect MCP app routes: {e}")