Overview

The Model Context Protocol (MCP) is an open standard for connecting agents to external tools and data sources. Allternit supports MCP in three ways:
  1. MCP connectors — a persisted catalog of remote MCP servers.
  2. Attached MCP servers — live JSON-RPC proxies that register their tools into the Allternit dispatcher.
  3. Allternit as an MCP server — expose the native tool belt to external MCP clients.

Base URL

All MCP routes are mounted under:
Local development:

Tool naming

Tools from an attached MCP server are namespaced under the server ID to avoid collisions:
Native tools and server-side tools have no namespace prefix. When the MCP server surface receives a namespaced call, it dispatches to the attached server; otherwise it runs the tool through the native tool executor.

Authentication

  • Connector and attached-server REST routes use the standard Allternit session.
  • The /mcp/server JSON-RPC route also accepts optional tunnel-auth headers for mTLS/OAuth-gated deployments:
    • x-allternit-tunnel-id
    • x-allternit-client-cert-thumbprint
    • x-allternit-oauth-issuer
    • x-allternit-oauth-audience

Tunnel authentication

When a request to /mcp/server includes x-allternit-tunnel-id, the gateway loads the tunnel’s auth policy and enforces any configured checks. The policy is fail-closed: if a check is configured but not satisfied, the request is rejected with JSON-RPC error -32001. Issuer comparison is case-insensitive and ignores a trailing slash. If no audience is configured, any audience is accepted.

REST endpoints

List connectors

Response:

Create a connector

Response (HTTP 201):

Test a connection

Response:

Attach a server

Attaching a server initializes an MCP session, fetches its tool catalog, and caches it in the dispatcher.
Response (HTTP 201):

List attached servers

Response:

Detach a server

Response:

OAuth callback

The OAuth callback route renders an HTML result page. It is called by the OAuth provider after the user authorizes a connector. The handler exchanges the authorization code for tokens when a token endpoint is discoverable.
On success the browser receives a page confirming the connection.

MCP server surface

Allternit can also expose its tool registry as an MCP server at /mcp/server. The endpoint speaks JSON-RPC over plain HTTP POST. It supports single requests (not batches) and is stateless.

Methods

Initialize

Response:

List tools

Response:

Call a tool

Response:
If the tool name contains a ., the dispatcher first tries the attached MCP server namespace; otherwise the native tool executor is used. Errors are returned with isError: true rather than a JSON-RPC error object.

Bundled vs remote servers

For production deployments, prefer remote MCP servers with tunnel-based authentication.

Error codes