Ir al contenido

Model Context Protocol endpoint

POST/api/mcp

JSON-RPC 2.0 over streamable HTTP: one message or a batch of up to 20. The tools offered follow the key's scopes.

Necesita una clave de API en la cabecera Authorization.

En esta página

Cuerpo

Opción 1: object

CampoTipoDescripción
jsonrpcobligatoriostring
  • exacto: 2.0
idstring | number
methodobligatoriostring
paramsobject

Opción 2: object[]

Esquema JSON
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "jsonrpc": {
          "const": "2.0"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            }
          ]
        },
        "method": {
          "type": "string"
        },
        "params": {
          "type": "object",
          "additionalProperties": {}
        }
      },
      "required": [
        "jsonrpc",
        "method"
      ]
    },
    {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {}
      }
    }
  ]
}

Petición de ejemplo

curl -X POST "https://polaris.example.com/api/mcp" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": "string",
  "method": "string",
  "params": {}
}'

Respuestas

EstadoQué es
200OK

También puede dar los errores comunes 400, 401, 403, 404, 429. Ver errores comunes