Phase 11, part 5: the JSON API

/api/v1 offers the MCP tools as plain HTTP for scripts: GET /api/v1/tools
lists what a key may call, POST /api/v1/<tool> calls one with JSON. Each
call goes through /mcp internally, so keys, scopes, limits, logging and
approvals are the same. /api/v1/docs documents every tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 11:22:22 -07:00
co-authored by Claude Opus 5.5
parent 6bf0517163
commit aa6c3ca390
10 changed files with 387 additions and 13 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ The old terminal app used `http://localhost:8080/callback`; you can remove that
- The port is published on `127.0.0.1` only, so other machines can't reach it, whatever the firewall says.
- The local edition has no login, so it protects itself from web pages open in the same browser: it only answers requests addressed to `localhost` (against DNS rebinding), and refuses form posts that don't come from its own pages: each form carries a random token that another site can't know, and the browser's `Origin` must be the app's own.
- The container runs as you, with a read-only filesystem, no Linux capabilities and `no-new-privileges`. It can write only its data folder.
- `/mcp` requires an agent's key (Settings → Agents). The key in `mcp-token` belongs to the built-in Hermes agent, which may work the CRM queue and read the Market; each agent gets only the tools for what it was given.
- `/mcp`, and the same tools as a JSON API at `/api/v1` (documented at `/api/v1/docs`), require an agent's key (Settings → Agents). Anything an agent asks to send out waits on Approvals for a person, unless that kind was allowed on its own. The key in `mcp-token` belongs to the built-in Hermes agent, which may work the CRM queue and read the Market; each agent gets only the tools for what it was given.
## The server edition