Skip to content

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.

Needs an API key in the Authorization header.

On this page

Request body

Option 1: object

FieldTypeDescription
jsonrpcrequiredstring
  • exactly: 2.0
idstring | number
methodrequiredstring
paramsobject

Option 2: object[]

JSON schema
{
  "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": {}
      }
    }
  ]
}

Example request

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": {}
}'

Responses

StatusMeaning
200OK

Can also answer the common errors 400, 401, 403, 404, 429. See common errors