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
+25 -11
View File
@@ -43,19 +43,19 @@ fixed. Since then:
- Listmonk mailing lists, with their opt-outs synced to suppression.
- Phase 9: the groundwork for the server and multi-tenant editions.
The local edition runs as before, its database at schema 36 once Phase 10
is merged. The server edition runs; multi-tenant checks its settings but
won't start until Phase 13.
The local edition runs as before, its database at schema 39 with Phase 11.
The server edition runs; multi-tenant checks its settings but won't start
until Phase 13.
**Phase 10 (users, sign-in and roles; the server edition) is built** on
branch `phase10` (2026-11-25), not yet merged: schema 36, a new
`compose.server.yaml` and `install-server.sh`. On the local edition,
the visible changes are posting accounts, Connections, Activity, and a
CSRF token in every form.
**Phase 10 (users, sign-in and roles; the server edition) is built and
merged** (2026-11-25): a new `compose.server.yaml` and `install-server.sh`.
**Next: Phase 11, agents.** Parts 1–4 (agent users and keys, module tools
over MCP, approvals, limits and visibility) are built on branch `phase11`;
part 5 (a JSON API) can wait until someone needs it. Phase 12 still needs who adds Supermarket's client to
**Phase 11 (agents) is built** (2026-11-26): agent users and keys, module
tools over MCP, approvals, limits and visibility, and the JSON API. Schema
39.
**Next: Phase 12, signing in with the Core (OIDC).** Still open: who adds
Supermarket's client to Authelia. Phase 12 still needs who adds Supermarket's client to
Authelia.
**Coming back to it (for the agent working on it):**
@@ -2642,6 +2642,20 @@ single `mcp-token`. A commit after each part.
two agents with the same scopes shared one, and the tools recorded the
first as the writer of what both wrote. Now each agent has its own.
**Part 5 built 2026-11-26** on `phase11`. **Phase 11 is built.**
- `/api/v1`: `GET /api/v1/tools` (what the key may call, with each tool's
input schema) and `POST /api/v1/<tool>` (the arguments as a JSON object;
the tool's answer as JSON). Each call is handed to `/mcp` internally, as
the same JSON-RPC call with the same key and address, so the keys,
scopes, limits, pause, call log, audit and approvals are exactly MCP's:
there's one set of tools, not two.
- Errors are `{"error": …}`: 401 (key), 403 (paused), 404 (a tool the key
isn't given), 400 (arguments), 422 (the tool said no), 429 (calls a
minute). No form token: the API, like `/mcp`, has its key instead.
- `/api/v1/docs` (no key needed) documents every tool, by scope, from the
tools themselves (an in-memory MCP session lists them), with how to call
them and an example.
1. **Agent users and their keys.**
- An admin creates an agent on Settings → Users → *New agent*. It has a
name, a description, and the modules it's given, each *read* or