{"openapi":"3.0.0","info":{"title":"Qode Relay Dev Server","description":"HTTP surface of the relay-dev server. Bridges HTTP requests to the browser extension over MCP (HTTP → McpClient → agent port → relay → extension).","version":"0.1.0"},"servers":[{"url":"http://localhost:7702"}],"paths":{"/sessions":{"get":{"summary":"List all live relay sessions","description":"Returns every session the relay currently knows about, keyed by token, with per-session extension/agent connection state.","responses":{"200":{"description":"The list of live sessions.","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"extensionConnected":{"type":"boolean"},"agentConnected":{"type":"boolean"},"createdAt":{"type":"integer","description":"Session creation time (epoch milliseconds)."}},"required":["token","extensionConnected","agentConnected","createdAt"]}}},"required":["sessions"]},"example":{"sessions":[{"token":"dev-secret","extensionConnected":true,"agentConnected":true,"createdAt":1752345678000}]}}}}}}},"/{token}/status":{"get":{"summary":"Per-session connection and uptime snapshot","description":"Reports whether the extension and agent WebSockets are connected for the given session, plus the session uptime in seconds.","parameters":[{"name":"token","in":"path","required":true,"description":"Session token identifying the relay session.","schema":{"type":"string"}}],"responses":{"200":{"description":"Current session status.","content":{"application/json":{"schema":{"type":"object","properties":{"extensionConnected":{"type":"boolean"},"agentConnected":{"type":"boolean"},"uptime":{"type":"integer","description":"Session uptime in whole seconds."}},"required":["extensionConnected","agentConnected","uptime"]},"example":{"extensionConnected":true,"agentConnected":true,"uptime":42}}}},"404":{"description":"No session exists for the given token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"example":{"error":"unknown session"}}}}}}},"/{token}/tools":{"get":{"summary":"List available MCP tools for a session","description":"Performs a real MCP round-trip to the session's extension and returns its tools list. Requires the extension to be connected.","parameters":[{"name":"token","in":"path","required":true,"description":"Session token identifying the relay session.","schema":{"type":"string"}}],"responses":{"200":{"description":"MCP tools list as returned by the extension.","content":{"application/json":{"schema":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"inputSchema":{"type":"object"}},"required":["name"]}}},"required":["tools"]}}}},"404":{"description":"No session exists for the given token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"example":{"error":"unknown session"}}}},"500":{"description":"Internal error while talking to the MCP client.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Extension not connected — no MCP round-trip is possible.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"example":{"error":"extension not connected"}}}}}}},"/{token}/call":{"post":{"summary":"Invoke a single MCP tool on a session","description":"Calls the named MCP tool with the given arguments via a real round-trip to the session's extension. Requires the extension to be connected. The call is bounded by a 10s timeout.","parameters":[{"name":"token","in":"path","required":true,"description":"Session token identifying the relay session.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tool":{"type":"string","description":"Name of the MCP tool to invoke."},"args":{"type":"object","description":"Arguments passed to the tool.","additionalProperties":true}},"required":["tool","args"]},"example":{"tool":"Page_navigate","args":{"url":"https://example.com"}}}}},"responses":{"200":{"description":"Tool result as returned by the extension.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"No session exists for the given token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"example":{"error":"unknown session"}}}},"500":{"description":"Internal error while talking to the MCP client.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Extension not connected — no MCP round-trip is possible.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"example":{"error":"extension not connected"}}}},"504":{"description":"The MCP tool call timed out (10s budget exceeded).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"example":{"error":"Error: timeout"}}}}}}},"/status":{"get":{"summary":"Legacy aggregate connection snapshot","description":"Backward-compatible aggregate status across all sessions: each flag is true if ANY session has that side connected. Uptime is the process uptime in seconds. Prefer GET /{token}/status.","deprecated":true,"responses":{"200":{"description":"Aggregate relay status.","content":{"application/json":{"schema":{"type":"object","properties":{"extensionConnected":{"type":"boolean"},"agentConnected":{"type":"boolean"},"uptime":{"type":"integer","description":"Process uptime in whole seconds."}},"required":["extensionConnected","agentConnected","uptime"]},"example":{"extensionConnected":true,"agentConnected":true,"uptime":42}}}}}}},"/openapi.json":{"get":{"summary":"This OpenAPI document","description":"Serves the OpenAPI 3.0 spec describing this server.","responses":{"200":{"description":"The OpenAPI 3.0 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/explorer":{"get":{"summary":"HTML tool explorer UI","description":"Serves an HTML page for browsing and invoking MCP tools.","responses":{"200":{"description":"The tool explorer HTML page.","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/":{"get":{"summary":"Redirect to the tool explorer","description":"Redirects to /explorer.","responses":{"302":{"description":"Redirect to /explorer.","headers":{"Location":{"description":"Always /explorer.","schema":{"type":"string"}}}}}}}}}