anil988 commited on
Commit
02d3c7e
Β·
1 Parent(s): 674b3ef

Fix: Enabled POST on MCP discovery to resolve platform 405 error

Browse files
Files changed (1) hide show
  1. 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 SSE Discovery) ──────────────────────────────────
81
 
82
- @app.get("/mcp")
83
- async def mcp_discovery():
84
- """Initial Discovery JSON"""
 
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",