MCP Streamable HTTP endpoint (JSON-RPC 2.0)
POST /mcp- who may call it
- Anyone
- no key and no session
- what it costs
- 1 request of the quota
- One for each POST, in the
mcpclass; a tool's route then runs without a second count, but for what that route counts more, as the Community reads do. · tiers and keys - how fresh
- Depends on the request
- MCP tool
- None
- how fresh, by case
- an answer to a JSON-RPC request: checked again every time
- notifications or responses alone: 202 with no body: no cache header
On this page
The Model Context Protocol endpoint: JSON-RPC 2.0 over Streamable HTTP as the MCP specification defines it (initialize, tools/list, tools/call, ping; GET /mcp opens the server-to-client SSE stream; DELETE /mcp ends a session). The tools are the operations of this file marked x-mcp-tool, each with x-mcp-title, x-mcp-description and x-mcp-annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), generated by cmd/mcpgen into internal/mcp/tools.json. tools/list includes a tool only when the caller's key can call it (x-mcp-auth, x-mcp-scopes); a call to a tool left off the list still returns that route's own auth error. Inputs are the operation's parameters or body, outputs the 200 schema rooted at type: object as MCP requires (a 200 schema that is not an object, list_sources' array, gives no output schema and a result that is the text alone), each sibling admitting the absent marker {"present": false}; the structured content is the answer when it is a JSON object, and every result carries the lag heights in _meta.btcintel. A bearer btci_ key is honoured; without one, initialize mints a t1 token and returns it in _meta.btcintel.token and in the instructions. Calls are counted in the mcp route class. Quota exhaustion is a JSON-RPC error with data {code: "quota_exceeded", retry_after}; every other API error is a tool result with isError whose text is the error envelope (with http_status), without structured content, since hosts check structured content against the tool's output schema.
Parameters
The body is application/json.
schema
What it answers
A JSON-RPC 2.0 response (application/json) or an event stream.
schema
Errors
| Status | Code | When |
|---|---|---|
| 429 | quota_exceeded | Quota exceeded at the HTTP level (quota_exceeded, Retry-After). |
Each comes in the one error envelope, and none is cached: an error carries Cache-Control: no-store.
Example
No snippet. This is the MCP endpoint: an agent's client holds a session with it in JSON-RPC, so no one-line snippet can show it. See MCP server.