abdur0001 commited on
Commit
b562fdb
Β·
1 Parent(s): 1c1d75c

fix: add mcp for hf

Browse files
Files changed (1) hide show
  1. server/app.py +22 -0
server/app.py CHANGED
@@ -91,6 +91,28 @@ def state_no_session():
91
  return State()
92
 
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  # ── Endpoints ──────────────────────────────────────────────────────────
95
 
96
  @app.get("/")
 
91
  return State()
92
 
93
 
94
+ @app.post("/mcp")
95
+ def mcp_endpoint(body: dict = {}):
96
+ """Minimal MCP JSON-RPC endpoint for OpenEnv spec compliance."""
97
+ method = body.get("method", "")
98
+ req_id = body.get("id", 1)
99
+ if method == "initialize":
100
+ return {
101
+ "jsonrpc": "2.0",
102
+ "id": req_id,
103
+ "result": {
104
+ "protocolVersion": "2024-11-05",
105
+ "serverInfo": {"name": "sre-incident-response", "version": "1.0.0"},
106
+ "capabilities": {},
107
+ },
108
+ }
109
+ return {
110
+ "jsonrpc": "2.0",
111
+ "id": req_id,
112
+ "result": {},
113
+ }
114
+
115
+
116
  # ── Endpoints ──────────────────────────────────────────────────────────
117
 
118
  @app.get("/")