Spaces:
Sleeping
Sleeping
Fix: Enabled POST on MCP discovery to resolve platform 405 error
Browse files- backend/main.py +5 -4
backend/main.py
CHANGED
|
@@ -77,11 +77,12 @@ async def process_synthesis(text: str, key: str):
|
|
| 77 |
a = agent_action(record, t, k=key)
|
| 78 |
return {"triage": t, "action": a}
|
| 79 |
|
| 80 |
-
# ββ MCP Standard (Optimized
|
| 81 |
|
| 82 |
-
@app.
|
| 83 |
-
async def mcp_discovery():
|
| 84 |
-
"""Initial Discovery
|
|
|
|
| 85 |
return {
|
| 86 |
"transport": "sse",
|
| 87 |
"endpoint": "https://anil988-codeblue-context.hf.space/mcp/sse",
|
|
|
|
| 77 |
a = agent_action(record, t, k=key)
|
| 78 |
return {"triage": t, "action": a}
|
| 79 |
|
| 80 |
+
# ββ MCP Standard (Optimized Discovery) ββββββββββββββββββββββββββββββββββ
|
| 81 |
|
| 82 |
+
@app.api_route("/mcp", methods=["GET", "POST", "OPTIONS"])
|
| 83 |
+
async def mcp_discovery(req: Request):
|
| 84 |
+
"""Initial Discovery (Supports both GET/POST for platform validation)"""
|
| 85 |
+
if req.method == "OPTIONS": return Response(status_code=204)
|
| 86 |
return {
|
| 87 |
"transport": "sse",
|
| 88 |
"endpoint": "https://anil988-codeblue-context.hf.space/mcp/sse",
|