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:Authentication
/mcp/serverrequires a valid Clerk bearer token./internal/tools/mcprequires the internal service token and thex-allternit-user-idheader.
Supported JSON-RPC methods
Tool catalog
Thetools/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):
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 theMCP-Protocol-Versionheader). Results carryresultType: "complete"and_meta["io.modelcontextprotocol/serverInfo"]; list and read results also carryttlMsandcacheScope: "private". An unknown version is refused with-32022and the list of supported versions. - 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05. Send
initializefirst, as before. An unknown version ininitializegets2025-06-18.
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
MCP Events (mcp.allternit.com)
The public edge athttps://mcp.allternit.com/mcp (agents server, scope agents:read) and https://mcp.allternit.com/mcp/bots/<bot id> (vendor 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.
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.
Error codes
JSON-RPC errors are returned with standard JSON-RPC error codes:
HTTP status codes: