Skip to content

Protocol reference

For people writing their own MCP client, or debugging one. Ready-made clients need none of this.

Transport

Endpoint POST https://<server>/mcp
Transport MCP Streamable HTTP, answering every request with JSON (Content-Type: application/json); no SSE stream
Messages JSON-RPC 2.0: one message, or a batch (an array)
Authentication Authorization: Bearer <personal access token>, on every request
Protocol versions 2025-06-18, 2025-03-26, 2024-11-05; the server answers with the version the client asked for, or the newest it knows
Sessions Stateless. initialize answers with an Mcp-Session-Id header; clients may send it back, nothing depends on it

Other HTTP methods:

Request Answer
GET /mcp 405, Allow: POST, DELETE: there is no server-sent event stream
DELETE /mcp 200: there is no session to end

Methods

Method Answer
initialize Protocol version, capabilities (tools, resources, prompts, logging), server info (clarive, with the server version) and instructions for the agent
ping {}
tools/list The tools the caller may use, all in one answer (no paging)
tools/call Runs a tool: {"name": "job_list", "arguments": {...}}
resources/list, resources/templates/list Empty lists
prompts/list An empty list
logging/setLevel {}
completion/complete No completions
notifications (notifications/initialized, notifications/cancelled...) No answer: HTTP 202

The options of the tool list go in the query string of the URL: mode=compact, namespaces=job,topic and read_only=1 (see Connecting agents).

Errors

Two kinds of error:

  • Tool errors. The operation ran, or was refused, and failed: the answer is a normal tools/call result with "isError": true and the error as text (code: message, plus the details as JSON). The agent is meant to read them.
  • Protocol errors. The request itself is wrong: a JSON-RPC error.
Code HTTP When
-32700 400 The body is not JSON, or not a JSON-RPC message
-32600 400 or 200 Not a valid request (jsonrpc is not "2.0", no method, an empty batch)
-32601 200 Unknown method
-32602 200 Bad parameters: no tool name, an unknown tool or one the caller may not use, arguments that are not an object
-32001 401, 503 No token, a bad one (expired, revoked, disabled, a git-only token), or maintenance mode
-32603 200, 500 Internal error
-32000 405 GET or another unsupported HTTP method

A 401 comes with WWW-Authenticate: Bearer realm="clarive", resource_metadata="https://<server>/.well-known/oauth-protected-resource", where OAuth clients start (see Microsoft Copilot and OAuth), and error="invalid_token" when a token was sent and refused. Every request id in a batch gets its own error, so a client never waits for an answer that will not come.

A session with curl

URL=https://clarive.example.com/mcp
AUTH="Authorization: Bearer $CLARIVE_TOKEN"

curl -s $URL -H "$AUTH" -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'

curl -s "$URL?namespaces=job" -H "$AUTH" -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | jq -r '.result.tools[].name'

curl -s $URL -H "$AUTH" -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"job_list","arguments":{"limit":3,"status":["RUNNING"]}}}'

The answer of the last one:

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [ { "type": "text", "text": "{\n   \"items\" : [ ... ],\n   \"total\" : 2, ... }" } ],
    "structuredContent": { "items": [ ... ], "total": 2, "skip": 0, "limit": 3 },
    "isError": false
  }
}

A tool, as listed

{
  "name": "topic_change_status",
  "title": "Move a topic to another status",
  "description": "Move a topic to another status\n\nThe transition must be allowed by the workflow ...\n\nChanges data.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "mid":        { "type": "string", "description": "Topic mid" },
      "status":     { "type": "string", "description": "New status id or name" },
      "old_status": { "type": "string", "description": "Status id or name the topic must be in now" }
    },
    "required": [ "mid", "status" ]
  },
  "annotations": {
    "title": "Move a topic to another status",
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
  }
}

The REST API

The same operations are a plain REST API, which is simpler for scripts that are not agents: POST /api/v2/call/<operation> with the parameters as a JSON body, and GET /api/v2/ops for the catalog with every operation's JSON schema. See API, MCP and the CLI.