Admin guide AI
MCP server for AI tools
The /mcp endpoint that lets Claude, ChatGPT, Codex, Gemini and Cursor drive boards. Protocol versions, the built-in OAuth authorization server, settings, hosting rewrites and operations.
On this page
Every Archipelego server is also an MCP server at /mcp. AI tools connect to it and read or change boards. A person consents first, in the browser, board by board. The design is in docs/architecture/mcp-server.md in the repository.
What it speaks
| Transport | Streamable HTTP, POST /mcp. No sessions, so GET and DELETE answer 405 |
| Protocol versions | 2026-07-28 (stateless, server/discover), and 2025-11-25, 2025-06-18 and 2025-03-26 through initialize |
| Features | 14 tools with output schemas and annotations, resources and resource templates, subscriptions/listen for live boards, four prompts, completion, confirmation of removals by input requests, and the MCP Apps extension (a board map) |
| Authorization | OAuth 2.1 with PKCE. Clients identify by Client ID Metadata Document, or register dynamically (RFC 7591) |
The server needs no AI key: the AI tool brings its own model. That suits the public instance, which holds no AI credentials.
Endpoints
| Path | Purpose |
|---|---|
/mcp |
The MCP endpoint |
/.well-known/oauth-protected-resource/mcp |
Protected resource metadata (RFC 9728) |
/.well-known/oauth-authorization-server |
Authorization server metadata (RFC 8414) |
/oauth/authorize, /oauth/token, /oauth/register, /oauth/revoke |
The authorization server |
/connect |
The consent page, part of the app |
/api/oauth/consent, /api/oauth/consent/info |
Called by the consent page |
/api/canvases/{id}/agents |
The share sheet's list of connected tools (editors only) |
Settings
| Variable | Default | Meaning |
|---|---|---|
ARCHIPELEGO_MCP |
on | off turns the MCP server and its OAuth endpoints off |
ARCHIPELEGO_PUBLIC_URL |
the request's address | The canonical address, e.g. https://archipelego.example.com. It is used in the metadata, as the token audience and in board links. Set it whenever the app and the server answer on different addresses |
ARCHIPELEGO_APP_URL |
ARCHIPELEGO_PUBLIC_URL |
Where the app's /connect page lives, if different |
ARCHIPELEGO_MCP_ORIGINS |
any | Browser origins allowed to call /mcp, separated by commas. Leave it unset: tokens are bearer tokens, never cookies |
ARCHIPELEGO_OPENAI_APPS_CHALLENGE |
none | The token the ChatGPT plugin directory asks to find at /.well-known/openai-apps-challenge. It is public; set it only while you list your instance in ChatGPT |
Signing tokens needs no secret of its own: the key is derived from ARCHIPELEGO_SECRET. Changing that secret disconnects every tool.
Behind a proxy or Firebase Hosting
Send /mcp, /oauth/, /.well-known/oauth- and /.well-known/openai-apps-challenge to the server, and keep /connect on the app. The public deployment (deploy/firebase) adds these Firebase Hosting rewrites to Cloud Run and sets ARCHIPELEGO_PUBLIC_URL.
Firebase Hosting ends requests after 60 seconds. Tools that listen to a board through subscriptions/listen reconnect when the stream ends, or can use the Cloud Run address directly.
Who may do what
- A connection (a grant) lists boards, each with read or read and edit, chosen by the person who connected the tool.
- On every call, the server checks that person's own access again: their account, or the board pass of their browser.
- The tool loses a board as soon as the person would: the board becomes private, its code changes, or they are removed. The tool never gets more than the person.
- A locked map refuses changes to blocks, connections, layers and features.
- Boards a tool creates are owned by the person if they were signed in. Otherwise the person's browser can protect or claim them.
- Grants are files in
DATA_DIR/agent-grants/, next toaccess/. Back them up with the rest of the data folder.
Operations
- Logs: the server logs
GrantIssued,BoardAddedToGrantandGrantRevokedwith the grant id and the tool's name. - Limits:
- 120 calls a minute per connection;
- 20 authorizations a minute and 30 token requests a minute per address;
- 200 items per call.
- Tokens:
- Access tokens last an hour.
- Refresh tokens last 90 days and rotate at each use. Presenting an old one revokes the connection.
- A connection unused for 90 days expires.
- Revoking:
- Editors disconnect a tool from a board in the share sheet.
- To cut every tool at once, delete the files in
agent-grants/or changeARCHIPELEGO_SECRET.
Security notes
- Fetching a Client ID Metadata Document is limited: https only, public addresses only, no redirects, 16 KB and 5 seconds.
- Board content is written by participants. Tool descriptions and the server's instructions tell agents to treat it as data. See Security for prompt injection.