xxx
Browse files
app.py
CHANGED
@@ -10,13 +10,22 @@ app = FastAPI()
|
|
10 |
async def root():
|
11 |
return {"status": "ok"}
|
12 |
|
13 |
-
# Mount the MCP HTTP app
|
14 |
-
|
|
|
15 |
|
16 |
-
print("Registered routes:")
|
17 |
for route in app.routes:
|
18 |
if isinstance(route, APIRoute):
|
19 |
print(route.path, route.methods)
|
20 |
else:
|
21 |
print(route.path, type(route))
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
async def root():
|
11 |
return {"status": "ok"}
|
12 |
|
13 |
+
# Mount the MCP HTTP app at /api
|
14 |
+
mcp_app = mcp.http_app()
|
15 |
+
app.mount("/api", mcp_app)
|
16 |
|
17 |
+
print("Registered routes in main app:")
|
18 |
for route in app.routes:
|
19 |
if isinstance(route, APIRoute):
|
20 |
print(route.path, route.methods)
|
21 |
else:
|
22 |
print(route.path, type(route))
|
23 |
|
24 |
+
# Try to access the routes in the mounted app (mcp_app) if possible
|
25 |
+
print("\nAttempting to inspect MCP app routes:")
|
26 |
+
try:
|
27 |
+
for route in mcp_app.routes:
|
28 |
+
print(route.path, getattr(route, "methods", type(route)))
|
29 |
+
except Exception as e:
|
30 |
+
print(f"Couldn't inspect MCP app routes: {e}")
|
31 |
+
|