Skip to content

The API as tools for AI agents

Every installation serves a Model Context Protocol endpoint next to its API. An MCP client such as Claude Code connects with an API token and gets one tool per read operation: customers, tenants, users, projects, releases, the licence, the brand and Private AI, as the token's scopes allow.

Read-only by construction.

Tools are generated from the API's GET operations only. No POST, PUT, PATCH or DELETE operation is ever a tool, so there are no write tools to call, whatever the token may do. Give an agent a token that carries only *-read-global keys anyway: it keeps the agent read-only if that ever changes, and a token is an operator credential.

Connect Claude Code

shell
claude mcp add --transport http ataila https://portal.example.com/api/v1/mcp --header "Authorization: Bearer <token>"

If the portal's certificate comes from a private certificate authority, Claude Code (a Node program) must trust it, for example with NODE_EXTRA_CA_CERTS=/path/to/ca.pem in its environment.

Any other MCP client

A client that reads the common JSON configuration takes the same three facts: the URL, the transport and the header.

json
{
  "mcpServers": {
    "ataila": {
      "type": "http",
      "url": "https://portal.example.com/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

Try it by hand

shell
curl -s https://portal.example.com/api/v1/mcp \
  -H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"whoami_get","arguments":{}}}'

The endpoint

URL https://<your portal>/api/v1/mcp
Transport MCP Streamable HTTP, stateless: every message is a POST answered with application/json. No SSE stream, no Mcp-Session-Id. GET answers 405, DELETE answers 204.
Protocol versions 2025-11-25, 2025-06-18, 2025-03-26. initialize echoes the client's version when it is one of these, else answers 2025-11-25. The MCP-Protocol-Version request header is not enforced.
Methods initialize, notifications/initialized (202, no body), ping, tools/list, tools/call. Any other method is JSON-RPC error -32601; a body that is not JSON is -32700 with HTTP 400. Batches are accepted.
Capabilities Tools only: no prompts, no resources, no logging.
Server Name ataila-cloud-platform; its version is the platform release.
On and off The same switch as the rest of /api/v1: while the API is off, the endpoint answers 404.

Authentication

The same bearer credential as every other /api/v1 operation: Authorization: Bearer <token>, with a personal token (ataila_pat_…) or a service-account token (ataila_sat_…); as on every operation, a portal session JWT is accepted as well. A missing or invalid credential is an HTTP 401 problem document, not a JSON-RPC error. A token's IP allowlist, when one is set, applies to the tool calls too. It is compared with the client address as the installation records it, which is the real client only where the installation's entry point passes that address on; where it does not, a token allowlisted to a client's address is refused: the allowlist fails closed. A revoked token stops at once on the API worker that revoked it and wherever the shared cache answers; while the shared cache is unreachable, another worker may accept it for up to 30 seconds more.

Tools

  • One tool per read operation of /api/v1, generated from the API's own routes and contract. The name is the operation id, the title its summary, the description its summary and description.
  • Arguments are the operation's path parameters (required) and query parameters (required only when the operation requires them). Unknown or missing arguments are JSON-RPC error -32602, and nothing is sent. A path argument must be a single path segment.
  • tools/list shows only what the caller may call with its effective permissions. The operations still enforce them: calling an unlisted tool returns the operation's own 403 as a tool error.
  • Results are one text item holding the API's JSON answer, plus structuredContent with the same JSON. An error answer is isError: true with the problem document as the text.
  • Lists are paged: pass a page's next_cursor as cursor to get the next.
  • The licence bundle is always null over MCP. Tool results land in a model's context, and the bundle is the one read whose value is itself a credential. Every member the contract marks SENSITIVE is nulled, and the tool's description says so. A result that carried a non-null secret would be withheld as an error.

In API 1.0.0 (platform release 1.0.187) there are 47 tools. Each links to its operation in the reference:

Rate limit, licence and records

  • A tool call costs two requests. The POST counts once against the token's 600 requests per minute, and every tools/call in it counts once more (the read it makes). A batch costs one plus one per tools/call. initialize, ping and tools/list cost only the POST.
  • Each tool call runs as a GET through /api/v1 with the caller's credential, so it gets exactly the answer a direct call would, including 429 rate_limited.
  • The licence treats the endpoint as a read: it works in every licence state.
  • Reads are not audited, so neither the POST nor its tool calls write audit records. Changes, which the API makes only through its own write operations, are.