MCP Streamable HTTP endpoint (JSON-RPC 2.0)
POST /mcp- quién puede llamarla
- Cualquiera
- sin clave y sin sesión
- qué cuesta
- 1 petición de la cuota
- 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. · niveles y claves - cuán reciente
- Según la petición
- Herramienta MCP
- Ninguna
- cuán reciente, según el caso
- an answer to a JSON-RPC request: se comprueba cada vez
- notifications or responses alone: 202 with no body: sin cabecera de caché
En esta página
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.
Parámetros
El cuerpo es application/json.
esquema
Qué responde
A JSON-RPC 2.0 response (application/json) or an event stream.
esquema
Errores
| Estado | Código | Cuándo |
|---|---|---|
| 429 | quota_exceeded | Quota exceeded at the HTTP level (quota_exceeded, Retry-After). |
Cada uno llega en el sobre de error único, y ninguno se guarda en caché: un error lleva Cache-Control: no-store.
Ejemplo
Sin fragmento. Este es el endpoint MCP: el cliente de un agente mantiene con él una sesión en JSON-RPC, así que ningún fragmento de una línea puede mostrarlo. Ver Servidor MCP.