Overview

The MCP Servers API lets allternit-api act as an MCP server. External MCP clients can connect to /mcp/server with a Clerk bearer token and call the same tool registry exposed by the REST tool routes. The surface uses the MCP Streamable HTTP transport: single JSON-RPC requests with plain JSON responses, stateless and without server-initiated push. An internal variant at /internal/tools/mcp is available for the local Gizzi runtime’s MCP client, gated by the internal service token and x-allternit-user-id.

Base URL

Clerk-authenticated surface:
Internal surface:
For local development:

Authentication

  • /mcp/server requires a valid Clerk bearer token.
  • /internal/tools/mcp requires the internal service token and the x-allternit-user-id header.
See Authentication.

Supported JSON-RPC methods

Tool catalog

The tools/list response includes:
  • Native host tools: shell.exec, file.read, file.write, file.list, file.exists, file.remove, system.info, system.env, http.get, http.post, time.now.
  • Office-engine Markdown conversion tools.
  • Tools from attached MCP servers registered in the dispatcher.

Attached servers

The same /mcp mount also serves the routes that manage which external MCP servers are attached (their tools then appear in tools/list):

Tasks and forms from attached servers

Allternit talks to attached servers through the Rust MCP client (mcp/mcp-client). It supports two parts of the protocol that long-running tools use:
  • Tasks (extension io.modelcontextprotocol/tasks, SEP-2663). A client built with McpClient::with_tasks() lists the extension in each request’s _meta client capabilities. A server may then answer tools/call with resultType: "task", and call_tool returns ToolOutcome::Task. The client follows the task with tasks/get, answers input_required with tasks/update inputResponses, and stops it with tasks/cancel. A completed task carries its CallToolResult in result. A JSON-RPC error makes the task failed; a tool result with isError: true is still completed. tasks/result is sent only to a server that negotiated 2025-11-25, the one version that has it. A client without with_tasks() never gets a task, because the server must answer it directly.
  • Elicitation (elicitation/create, form and URL mode). The host installs a ServerRequestHandler with with_server_request_handler. The handler answers both a task’s inputRequests and the elicitation/create requests that legacy-era servers send on the stdio or HTTP stream. Without a handler, every elicitation is declined, so the server is never left waiting.
The user proxy that gizzi-code connects to does not pass tasks or forms through yet. Until it does, it does not declare tasks, so attached servers answer directly. A tool that only works as a task is refused with -32021, and the user proxy declines a server’s form.

Protocol versions

The server speaks both MCP eras on the same endpoint:
  • 2026-07-28 (stateless). No handshake. Put the version in every request’s params._meta["io.modelcontextprotocol/protocolVersion"] (and the MCP-Protocol-Version header). Results carry resultType: "complete" and _meta["io.modelcontextprotocol/serverInfo"]; list and read results also carry ttlMs and cacheScope: "private". An unknown version is refused with -32022 and the list of supported versions.
  • 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05. Send initialize first, as before. An unknown version in initialize gets 2025-06-18.
If you send Mcp-Method or Mcp-Name headers, they must match the body; a mismatch is HTTP 400 with -32020. An Mcp-Name in the =?base64?…?= form is decoded before the comparison. List results (tools/list, prompts/list, resources/list, resources/templates/list) come back in one canonical order in both eras: ascending by name, uri or uriTemplate (byte order). The same rule applies on every Allternit MCP endpoint, including attached servers’ tools and the connector endpoints.

Initialize (legacy clients)

Example request

Example response

List tools

Example response

Call a tool

Request body

Tools whose names contain a . are first dispatched to attached MCP servers; otherwise they run through the internal tool registry.

Example request

Example response

Internal MCP endpoint

The internal endpoint uses the same JSON-RPC contract but is intended for peer services.

Required headers

Phones, numbers and mailboxes from coding agents

With a Platform API project key (Authorization: Bearer alt_live_…, scopes phones, numbers, messaging, mail), https://mcp.allternit.com/mcp also serves the phone, number and mailbox tools. The ready-made Claude Code plugin and Codex skill are in Claude Code and Codex add-ons.

MCP Events (mcp.allternit.com)

The public edge at https://mcp.allternit.com/mcp (agents server, scope agents:read) and https://mcp.allternit.com/mcp/bots/<bot id> (connected bot connector, scope bots:act) supports the MCP Events extension with webhook delivery. Both advertise it in server/discover (and in a legacy initialize answer):
The edge answers these itself; your computer doesn’t need to be awake. Subscriptions last 24 hours by default, up to 7 days (ttlMs: null is clamped to 7 days); subscribe again before refreshBefore to keep them. Deliveries are signed with Standard Webhooks using the whsec_ secret you supply, and carry X-MCP-Subscription-Id. See the MCP Events guide for the event catalog, the verification challenge, and delivery rules. Owners see and end subscriptions through the cloud API: GET /api/v1/mcp/approvals lists each approved app’s subscriptions, DELETE /api/v1/mcp/events/subscriptions/:id ends one (the callback gets a signed terminated message, reason: "ended_by_owner"), and GET /api/v1/events/catalog returns every event with a plain-words title and the servers that offer it. Fields and errors are in Seeing and ending subscriptions.

Mail tools for project keys (mcp.allternit.com)

A Platform API project key (alt_live_… / alt_test_…) with the mail scope gets five tools on https://mcp.allternit.com/mcp, answered by the edge itself: mailbox_create, mailbox_list, mail_list, mail_read and mail_read_otp. With the agents scope too, tools/list shows them next to the agents server’s tools. With mail alone, the edge answers initialize, tools/list, tools/call and ping and nothing reaches a computer. Fields and errors are those of Mailboxes; a refused call comes back as a tool result with isError: true and the /v1 error code in the text. Opening https://mcp.allternit.com/ (or the server URL in a browser) shows a short page with the server URLs, protocol versions and event catalog.

Result schemas, feedback and connected apps (mcp.allternit.com)

Every tool the edge itself serves (phone, mail, decide, respond and submit_feedback) lists an outputSchema next to its inputSchema. Each schema is the real result shape of that tool (properties, types, required), so a client can generate typed stubs from it. A tool relayed from a runtime keeps the schema the runtime gave it, or a generic object. When a call returns a JSON object, the result carries it as structuredContent and also as text in content, so older clients keep working. submit_feedback takes { "tool": "<tool name>", "message": "<optional note>" } and returns { "ok": true }. The edge writes one log line with your user id, the tool and the first 500 characters of the message. It stores nothing else and relays nothing to a computer. It is listed on every tools/list answer, so an app can show a “Report a problem” action for it. GET /api/v1/mcp/approvals items have two read fields for the Connected apps list: Disconnect an app with DELETE /api/v1/mcp/approvals/:id for each of its rows. The Server Card at https://mcp.allternit.com/.well-known/mcp lists the server name, description, the three remote URLs and the OAuth protected-resource metadata.

Error codes

JSON-RPC errors are returned with standard JSON-RPC error codes: HTTP status codes: