feat(plugins): the MCP server leaves core for the hub-mcp plugin; a worker's CLI gets Full #41

Closed
gabrielvidal wants to merge 0 commits from hub-mcp-plugin into main
pull from: hub-mcp-plugin
Owner

Merge after #33 (the worker CLI): this branch is built on it, so until #33 is merged this PR's diff also shows #33's commits. Pairs with the ai-agent-plugins PR "hub-mcp" (the plugin, with its per-connection, per-tool permissions) and the homelab docs PR (after homelab #22).

Summary

The hub's MCP server — the OAuth 2.1 server, the consent page, /mcp, the tools, Settings → AI apps — leaves core for an installable live plugin, hub-mcp (ai-agent-plugins). Core keeps nothing about MCP: four generic plugin contracts replace backend/mcpserver/. Workers drive the hub with the ai-agent CLI instead (PR #33), whose switch gains a Full level for a machine trusted like the lab (the EVOX2). Gabriel's picks: form move-the-hub-mcp-server-into-a-plugin_2od10i.

A hub without the plugin has no MCP server (/mcp, /oauth/* and the OAuth metadata answer 404). After deploying this, install hub-mcp (see "After merging").

Key changes

  • endpoints[] (backend/plugins/endpoints.py): HTTP a plugin answers on the hub's own address — under /x/<pluginId>/… or on a protocol path (/mcp, /oauth/…, /.well-known/…), nothing else. The request goes to the endpoint's action as JSON: an allowlist of headers, the body, the client's address, the surface, and caller — who the browser is signed in as, by the gate's own rules (core/auth.identify). The answer comes back through header and type allowlists; HTML never runs a script (forced CSP: forms, links, a meta refresh). Body cap, per-address rate, 16 runs at once on their own threads. Owner's installs only, operator approval, in the approval fingerprint.

  • hub.api (plugins/hubapi.py, plugins/actas.py): the hub's /api/* for the plugin's handlers — as the owner, or with X-AIA-As-User as a guest through the cli scope while the plugin is theirs. Replaces the gate's X-AIA-MCP-User. The CLI is its client library (AIA_CLI_DIR); hub/via stamps meta.via = {kind: "plugin", …} (the "via Claude.ai" pill).

  • notify.ask and security.record (plugins/hubsignals.py): a 2–3-button push to the owner and its answer (the consent page's number matching); a plugin_event line in the Security log.

  • Removed: backend/mcpserver/, schemas/mcp.py, cli/mcp_tools.py + cli/mcp_server.py (now the plugin's handlers), frontend/src/business/aiApps/ (Settings → AI apps, /connect/<id> — both old addresses redirect), /api/mcp*, /api/me/ai-apps, the mcp SSE event, the mcp.connect / mcp.manage permissions and the per-guest AI apps switch (the plugin's managed grant).

  • Carry-over (plugins/carryover.py hub_mcp, at start and right after the plugin's install): /data/mcp.json → the plugin's store, same shape, so every connected app keeps its tokens — minus the connections bound to a worker, dropped with their tokens; every guest who held mcp.connect gets the grant; whoever was pushed about mcp_connected is pushed about Plugin events.

  • Worker CLI — Full (backend/workers/cli.py, WorkerCli.tsx): a fourth level of the ai-agent CLI switch — the lab's CLI as the owner: every command but worktrees, any machine (--on lab), inbox, cron, the plugins' commands. A new without --on still starts on the asking worker. The worker-side CLI no longer filters commands itself: the hub's switch decides.

  • authz/catalog.RETIRED: a retired permission still in a stored record reads without it, is never refused on save, and stays in the record for a carry-over that hasn't run yet.

  • cli/test_library_surface.py pins the names of ai_agent / plugin_commands the plugin imports.

  • Docs: docs/plugins.md → "HTTP endpoints, the hub's API and asks"; docs/mcp.md rewritten as the plugin's pointer; CLAUDE.md, docs/permissions.md, docs/settings.md, worker/README.md, the create-plugin skill.

  • Caught up with main (merge aee457cd, after cron jobs #37 and Send later #36 left core): the MCP files main had edited stay deleted; a worker's CLI on Read / Read + run here no longer has later / scheduled / unschedule (main removed those commands — on Full the scheduled-conversations plugin's commands do it); /settings/cron and /settings/jobs redirect to the cron-jobs plugin, /settings/ai-apps and /connect/<id> to this plugin's pages; parse_when left the pinned CLI library surface.

  • The finer permissions Gabriel asked for on 2026-11-28 (form ai-apps-finer-permissions_bhloav: per tool, per connection; allow / ask on the phone / deny; projects, models, accounts, machines, expiry and own-conversations limits; a ceiling per guest) are entirely in the plugin — no core change was needed for them.

Key decisions

  • All of it in the plugin (the form's option A) rather than keeping OAuth and consent in core: a hub with no plugin is then really without an MCP server, and the four contracts serve any plugin that speaks a protocol on the hub's address (an OAuth callback, a Slack events URL).
  • An endpoint's action answers HTTP only. Its payload carries the host's word on who is asking (request.caller). Through the normal action routes that would be the caller's own word: a guest granted the plugin could have posted "the caller is the owner" to the consent handler and approved an owner connection. The action routes (POST, GET, the batch read — one check in plugins/batch.resolve_call) refuse those actions, the manifest can't wire them to a command / webhook / event / provider / export, and the plugin refuses any run that isn't the dispatcher's. Found while reviewing the plugin against the contract; tested from both sides and on a live hub.
  • The consent page is at /oauth/connect/<id>, not under /x/hub-mcp/: browsers that already hold the app's service worker only leave /oauth/, /mcp and /.well-known/ alone — a new /x/ path would be answered with the app shell until the worker updates. (/x/ is excluded from this build on.)
  • Bound connections are revoked, never widened: unbound, a connection that saw one profile and ran on one machine would be the owner everywhere.
  • origin and every URL the plugin gives out are the hub's configured addresses (GUEST_PUBLIC_URL, AI_AGENT_VIEW_URL), never a request's Host — as MCP_PUBLIC_URL was.
  • Full is opt-in per worker (default stays Read + run here; a guest's computer never gets it): it is what the EVOX2's unbound MCP connection could already do, without the machine ever calling the hub.
  • A disabled guest's connections are kept (403 guest_disabled); only a deleted guest's are revoked (guest_gone) — what core did.

Changelog

  • Changed: the MCP server for AI apps (Claude.ai, ChatGPT…) is now the AI apps (MCP server) plugin — install it from Settings → Plugins; existing connections carry over
  • Changed: approving an app's connection opens a plain page with no JavaScript (same steps: read only / read and run, approve on the phone by number)
  • Added: a worker's ai-agent CLI switch has a Full level — the lab's CLI as you, from that machine
  • Removed: MCP connections bound to a worker (Acts as) — workers use the ai-agent CLI; the bound connections are revoked
  • Added (plugins): a plugin can answer HTTP on the hub's own address, call the hub's API for its users, ask you a tappable question and write Security log lines

Test notes

  • Backend, one process per module (bwrap, throwaway /data), on this branch merged with main: 168 modules, the only failure is test_typed_plugins (fails on main too). New: backend/test_plugin_endpoints.py (33 tests: manifest rules, dispatch, allowlists, CSP, caller identification incl. impersonation, rate and body caps, the endpoint-only rule on every action door, hub.api as owner / guest / read-only, asks, security lines, carry-over, retired permission).
  • After the merge with main (aee457cd): backend 171 modules, 2149 passed (main, same setup: 2142); test_typed_plugins passes with WORKTREES_DIR set to where this worktree sits. cli/: 108 passed. tsc clean, vite build OK, vitest 1111 passed, 1 failed (the same FreshContext CacheExpiredNotice, also failing on main). The live run below was done before that merge; the plugin's own live run (its PR) was done on the merged branch.
  • cli/: 108 passed. Frontend: tsc clean; vitest 1106 passed, 1 failed (FreshContext CacheExpiredNotice — in scripts/test-known-failures.txt, fails on main).
  • Live: a local hub (this branch + the built frontend) seeded with a legacy mcp.json (an owner connection, one bound to a worker, a guest's) and a guest holding mcp.connect; the plugin installed through POST /api/plugins/install. Then, over real HTTP: the MCP paths 404 before the install; carry-over (bound connection gone, old owner and guest tokens still valid, the guest granted); discovery; register → authorize → consent as the owner → token; PKCE mismatch; the phone path (the push, the right number approves, a wrong one refuses, a poll without the number gets nothing); a guest approving for themselves; tools/list and tools/call through the bridge as owner and as the guest; refresh rolling; revoke; a cross-site approval refused; a forged "caller is the owner" action call from a granted guest refused (403 endpoint_only); the Security log lines. Scripts: .ai/artefacts/2026-11-28/hub-mcp/e2e.py, e2e_phone.py.
  • The real CLI against that hub as a Full worker (plugin commands, inbox, workers) and as a narrowed one (403).
  • Not deployed from the EVOX2.

After merging

  1. Deploy the ai-agent (from the Homelab), then install the plugin: Settings → Plugins → Catalog → hub-mcp → approve (or ai-agent plugin install ~/projects/ai-agent-plugins/plugins/hub-mcp). Until then Claude.ai / ChatGPT get 404s. The install carries data/mcp.json over.
  2. Machines → EVOX2 → Details → ai-agent CLI → Full.
  3. On the EVOX2 and the Orus Mac: claude mcp remove --scope user ai-agent (the old connector; the EVOX2's unbound connection survives the carry-over as a plain owner connection until it is disconnected in Settings → AI apps).
  4. ~/.claude/CLAUDE.md on the EVOX2 still says "the hub is reachable as the ai-agent MCP server": change that line to the CLI.

Screenshots

worker-cli-full.png
consent-owner.png
consent-number.png

> **Merge after #33** (the worker CLI): this branch is built on it, so until #33 is merged this PR's diff also shows #33's commits. Pairs with the ai-agent-plugins PR "hub-mcp" (the plugin, with its per-connection, per-tool permissions) and the homelab docs PR (after homelab #22). ## Summary The hub's MCP server — the OAuth 2.1 server, the consent page, `/mcp`, the tools, Settings → AI apps — leaves core for an installable live plugin, `hub-mcp` (ai-agent-plugins). Core keeps nothing about MCP: four generic plugin contracts replace `backend/mcpserver/`. Workers drive the hub with the `ai-agent` CLI instead (PR #33), whose switch gains a **Full** level for a machine trusted like the lab (the EVOX2). Gabriel's picks: form `move-the-hub-mcp-server-into-a-plugin_2od10i`. **A hub without the plugin has no MCP server** (`/mcp`, `/oauth/*` and the OAuth metadata answer 404). After deploying this, install `hub-mcp` (see "After merging"). ## Key changes - **`endpoints[]`** (`backend/plugins/endpoints.py`): HTTP a plugin answers on the hub's own address — under `/x/<pluginId>/…` or on a protocol path (`/mcp`, `/oauth/…`, `/.well-known/…`), nothing else. The request goes to the endpoint's action as JSON: an allowlist of headers, the body, the client's address, the surface, and `caller` — who the browser is signed in as, by the gate's own rules (`core/auth.identify`). The answer comes back through header and type allowlists; **HTML never runs a script** (forced CSP: forms, links, a meta refresh). Body cap, per-address rate, 16 runs at once on their own threads. Owner's installs only, operator approval, in the approval fingerprint. - **`hub.api`** (`plugins/hubapi.py`, `plugins/actas.py`): the hub's `/api/*` for the plugin's handlers — as the owner, or with `X-AIA-As-User` as a guest through the `cli` scope while the plugin is theirs. Replaces the gate's `X-AIA-MCP-User`. The CLI is its client library (`AIA_CLI_DIR`); `hub/via` stamps `meta.via = {kind: "plugin", …}` (the "via Claude.ai" pill). - **`notify.ask`** and **`security.record`** (`plugins/hubsignals.py`): a 2–3-button push to the owner and its answer (the consent page's number matching); a `plugin_event` line in the Security log. - **Removed**: `backend/mcpserver/`, `schemas/mcp.py`, `cli/mcp_tools.py` + `cli/mcp_server.py` (now the plugin's handlers), `frontend/src/business/aiApps/` (Settings → AI apps, `/connect/<id>` — both old addresses redirect), `/api/mcp*`, `/api/me/ai-apps`, the `mcp` SSE event, the `mcp.connect` / `mcp.manage` permissions and the per-guest *AI apps* switch (the plugin's managed grant). - **Carry-over** (`plugins/carryover.py` `hub_mcp`, at start and right after the plugin's install): `/data/mcp.json` → the plugin's store, same shape, so every connected app keeps its tokens — **minus the connections bound to a worker**, dropped with their tokens; every guest who held `mcp.connect` gets the grant; whoever was pushed about `mcp_connected` is pushed about *Plugin events*. - **Worker CLI — Full** (`backend/workers/cli.py`, `WorkerCli.tsx`): a fourth level of the *ai-agent CLI* switch — the lab's CLI as the owner: every command but `worktrees`, any machine (`--on lab`), `inbox`, `cron`, the plugins' commands. A `new` without `--on` still starts on the asking worker. The worker-side CLI no longer filters commands itself: the hub's switch decides. - `authz/catalog.RETIRED`: a retired permission still in a stored record reads without it, is never refused on save, and stays in the record for a carry-over that hasn't run yet. - `cli/test_library_surface.py` pins the names of `ai_agent` / `plugin_commands` the plugin imports. - Docs: `docs/plugins.md` → "HTTP endpoints, the hub's API and asks"; `docs/mcp.md` rewritten as the plugin's pointer; `CLAUDE.md`, `docs/permissions.md`, `docs/settings.md`, `worker/README.md`, the create-plugin skill. - **Caught up with main** (merge `aee457cd`, after cron jobs #37 and Send later #36 left core): the MCP files main had edited stay deleted; a worker's CLI on *Read* / *Read + run here* no longer has `later` / `scheduled` / `unschedule` (main removed those commands — on *Full* the scheduled-conversations plugin's commands do it); `/settings/cron` and `/settings/jobs` redirect to the cron-jobs plugin, `/settings/ai-apps` and `/connect/<id>` to this plugin's pages; `parse_when` left the pinned CLI library surface. - The finer permissions Gabriel asked for on 2026-11-28 (form `ai-apps-finer-permissions_bhloav`: per tool, per connection; allow / ask on the phone / deny; projects, models, accounts, machines, expiry and own-conversations limits; a ceiling per guest) are entirely in the plugin — no core change was needed for them. ## Key decisions - **All of it in the plugin** (the form's option A) rather than keeping OAuth and consent in core: a hub with no plugin is then really without an MCP server, and the four contracts serve any plugin that speaks a protocol on the hub's address (an OAuth callback, a Slack events URL). - **An endpoint's action answers HTTP only.** Its payload carries the host's word on who is asking (`request.caller`). Through the normal action routes that would be the caller's own word: a guest granted the plugin could have posted "the caller is the owner" to the consent handler and approved an owner connection. The action routes (POST, GET, the batch read — one check in `plugins/batch.resolve_call`) refuse those actions, the manifest can't wire them to a command / webhook / event / provider / export, and the plugin refuses any run that isn't the dispatcher's. Found while reviewing the plugin against the contract; tested from both sides and on a live hub. - **The consent page is at `/oauth/connect/<id>`, not under `/x/hub-mcp/`**: browsers that already hold the app's service worker only leave `/oauth/`, `/mcp` and `/.well-known/` alone — a new `/x/` path would be answered with the app shell until the worker updates. (`/x/` is excluded from this build on.) - **Bound connections are revoked, never widened**: unbound, a connection that saw one profile and ran on one machine would be the owner everywhere. - **`origin` and every URL the plugin gives out are the hub's configured addresses** (`GUEST_PUBLIC_URL`, `AI_AGENT_VIEW_URL`), never a request's Host — as `MCP_PUBLIC_URL` was. - **Full is opt-in per worker** (default stays *Read + run here*; a guest's computer never gets it): it is what the EVOX2's unbound MCP connection could already do, without the machine ever calling the hub. - A disabled guest's connections are kept (403 `guest_disabled`); only a deleted guest's are revoked (`guest_gone`) — what core did. ## Changelog - Changed: the MCP server for AI apps (Claude.ai, ChatGPT…) is now the **AI apps (MCP server)** plugin — install it from Settings → Plugins; existing connections carry over - Changed: approving an app's connection opens a plain page with no JavaScript (same steps: read only / read and run, approve on the phone by number) - Added: a worker's *ai-agent CLI* switch has a **Full** level — the lab's CLI as you, from that machine - Removed: MCP connections bound to a worker (*Acts as*) — workers use the `ai-agent` CLI; the bound connections are revoked - Added (plugins): a plugin can answer HTTP on the hub's own address, call the hub's API for its users, ask you a tappable question and write Security log lines ## Test notes - Backend, one process per module (bwrap, throwaway `/data`), on this branch merged with main: 168 modules, the only failure is `test_typed_plugins` (fails on main too). New: `backend/test_plugin_endpoints.py` (33 tests: manifest rules, dispatch, allowlists, CSP, caller identification incl. impersonation, rate and body caps, the endpoint-only rule on every action door, `hub.api` as owner / guest / read-only, asks, security lines, carry-over, retired permission). - **After the merge with main** (`aee457cd`): backend 171 modules, 2149 passed (main, same setup: 2142); `test_typed_plugins` passes with `WORKTREES_DIR` set to where this worktree sits. `cli/`: 108 passed. `tsc` clean, `vite build` OK, vitest 1111 passed, 1 failed (the same `FreshContext` CacheExpiredNotice, also failing on main). The live run below was done before that merge; the plugin's own live run (its PR) was done on the merged branch. - `cli/`: 108 passed. Frontend: `tsc` clean; vitest 1106 passed, 1 failed (`FreshContext` CacheExpiredNotice — in `scripts/test-known-failures.txt`, fails on main). - **Live**: a local hub (this branch + the built frontend) seeded with a legacy `mcp.json` (an owner connection, one bound to a worker, a guest's) and a guest holding `mcp.connect`; the plugin installed through `POST /api/plugins/install`. Then, over real HTTP: the MCP paths 404 before the install; carry-over (bound connection gone, old owner and guest tokens still valid, the guest granted); discovery; register → authorize → consent as the owner → token; PKCE mismatch; the phone path (the push, the right number approves, a wrong one refuses, a poll without the number gets nothing); a guest approving for themselves; `tools/list` and `tools/call` through the bridge as owner and as the guest; refresh rolling; revoke; a cross-site approval refused; a forged "caller is the owner" action call from a granted guest refused (403 `endpoint_only`); the Security log lines. Scripts: `.ai/artefacts/2026-11-28/hub-mcp/e2e.py`, `e2e_phone.py`. - The real CLI against that hub as a Full worker (`plugin commands`, `inbox`, `workers`) and as a narrowed one (403). - Not deployed from the EVOX2. ### After merging 1. Deploy the ai-agent (from the Homelab), then **install the plugin**: Settings → Plugins → Catalog → `hub-mcp` → approve (or `ai-agent plugin install ~/projects/ai-agent-plugins/plugins/hub-mcp`). Until then Claude.ai / ChatGPT get 404s. The install carries `data/mcp.json` over. 2. Machines → EVOX2 → Details → *ai-agent CLI* → **Full**. 3. On the EVOX2 and the Orus Mac: `claude mcp remove --scope user ai-agent` (the old connector; the EVOX2's unbound connection survives the carry-over as a plain owner connection until it is disconnected in Settings → AI apps). 4. `~/.claude/CLAUDE.md` on the EVOX2 still says "the hub is reachable as the `ai-agent` MCP server": change that line to the CLI. ## Screenshots ![worker-cli-full.png](https://git.gabvdl.xyz/attachments/05233907-386b-4eb8-b1fd-477fb81f5944) ![consent-owner.png](https://git.gabvdl.xyz/attachments/53ce3292-0333-415e-92ab-62f05db76f3f) ![consent-number.png](https://git.gabvdl.xyz/attachments/c2c94219-0cb0-4263-8db6-d1e594cf72a1)
gabrielvidal self-assigned this 2026-11-28 19:52:49 +01:00
gabrielvidal added 5 commits 2026-11-28 19:52:49 +01:00
The MCP start_conversation and the CLI's --on have always said "a worker
id or name", and browse / ai-agent workers print the name first, but the
hub looked workers up by id only: worker='EVOX2' was a 400 "unknown
worker" and agents guessed their way to the id (the three relays of
2ca176fc, 2026-11-28).

workers/picks.py resolves every pick: local / lab / homelab are the lab,
a worker's id as is, else its name in any case and spacing among the
owner's workers (a guest's own computers for a guest's run). A name two
workers share names none. An unknown pick is a 400 worker_unknown whose
message lists the valid ids and names (and `choices`), so the next try is
the right one. Used by route_new_run (spawns, cron fires, the plugin runs
bridge), the cron routes (a job pinned by name stores the id) and the
runs bridge's worker check (names with spaces pass, "lab" is the lab).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On 2026-11-28 an agy run on the EVOX2 (2ca176fc) had no way to start a
conversation: since 2026-11-18 a worker's CLI kept only `past`, and the
hub's MCP — its stand-in — existed in Claude Code only. It shelled out to
three `claude -p --model haiku` relays to call start_conversation, which
named the worker EVOX2 (refused), had no parent to report to and polled
wait_for_conversation for 10+ minutes. Another agy run (25c32ca5) gave up
delegating. Gabriel's call: the CLI back on workers, the MCP stays.

The 2026-11-16 path, on today's code:
- cli/ai_agent.py: on a worker (AI_AGENT_OUTBOX_URL) the WORKER_COMMANDS
  go into the outbox as a `cli` item {argv, sessionId}; what the hub's run
  printed comes back (≈ 2–4 s, a `wait` when the run ends). The hub's run
  sends X-AIA-As-Worker + X-AIA-As-Worker-Mode.
- backend/workers/cli.py: CliJobs runs the same CLI in a clean env (host
  token, AIA_AS_WORKER, its switch as the mode, CLAUDE_SESSION_ID = the
  sending session → the parent of what it starts: children nest and report
  back). The narrowing is workers/bound.py worker_caller — the same caller
  as a worker-bound MCP connection, worker.read / worker.run scopes.
- The per-worker switch: workers.json `cli` off | read | run (unset = run,
  a guest's computer always off), PATCH /api/workers/{id} {cli}, Machines →
  the worker → Details → "ai-agent CLI".
- sidecar/outbox.py: the `cli` kind (results dropped 10 min after they end);
  outbox_mirror answers it; worker/install.sh writes the `ai-agent` terminal
  shim again.
- The conv-ref hook names the CLI on a worker; `past`'s lookup follows the
  switch. The bound MCP connection stays, optional.
- Docs: CLAUDE.md, docs/mcp.md, worker/README.md.

Tests: test_worker_cli.py (new), test_worker_bound.py, test_worker_routing.py,
sidecar test_outbox.py, cli test_ai_agent.py / test_conv_ref.py; the whole
backend per module matches main (test_typed_plugins' git-clone case fails on
both). A live local hub answered every worker command through the gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hub as an MCP server (OAuth 2.1, the consent page, /mcp, Settings → AI
apps) is the `hub-mcp` live plugin now (ai-agent-plugins). Core keeps nothing
about MCP: four generic plugin contracts replace backend/mcpserver/.
Gabriel's picks: form move-the-hub-mcp-server-into-a-plugin_2od10i.

New contracts (docs/plugins.md → "HTTP endpoints, the hub's API and asks"):
- `endpoints[]` (plugins/endpoints.py): HTTP a plugin answers on the hub's own
  address — under /x/<pluginId>/… or a protocol path (/mcp, /oauth/…,
  /.well-known/…). The request goes to the endpoint's action with what the
  host vouches for (client address, surface, and `caller`: who the browser is
  signed in as, by the gate's own rules — core/auth.identify); the answer
  comes back through header and type allowlists, and HTML never runs a script
  (forced CSP). Body cap, per-address rate, 16 runs at once on their own
  threads. An endpoint's action answers HTTP only: the action routes refuse it
  and the manifest can't wire it to anything else — its payload is the host's
  word on who is asking.
- `hub.api` (plugins/hubapi.py, plugins/actas.py): the hub's API for the
  plugin's handlers, as the owner or — `X-AIA-As-User`, the `cli` scope — as a
  guest the plugin is granted to. The CLI is its library (AIA_CLI_DIR; the
  names a plugin leans on are pinned by cli/test_library_surface.py).
  `hub/via` stamps meta.via = {kind: "plugin", …}: the "via Claude.ai" pill.
- `notify.ask` and `security.record` (plugins/hubsignals.py): a tappable
  question to the owner and its answer; a `plugin_event` Security log line.

Removed: backend/mcpserver/, schemas/mcp.py, cli/mcp_tools.py + mcp_server.py,
the frontend's business/aiApps (Settings → AI apps, /connect/<id> — both old
addresses redirect), /api/mcp*, /api/me/ai-apps, the `mcp` SSE event, the
mcp.connect / mcp.manage permissions and the per-guest AI apps switch (the
plugin's managed grant). A retired permission still in a record reads without
it and is never refused (authz/catalog.RETIRED).

Carry-over (carryover.hub_mcp, at start and after the plugin's install):
/data/mcp.json → the plugin's store, same shape, so connected apps keep
working — minus the connections bound to a worker, which are dropped with
their tokens rather than left as plain owner connections; every guest who
held mcp.connect gets the grant; whoever was pushed about mcp_connected is
pushed about plugin events.

Workers: the `ai-agent` CLI switch gains Full — the lab's CLI as the owner
(every command but worktrees, any machine, the plugins' commands), what the
EVOX2's unbound MCP connection gave. The worker-side CLI no longer filters
commands: the hub's switch decides. "Acts as" is gone; workers/bound.py stays
as the CLI's narrowing.

Until the plugin is installed after a deploy, /mcp and /oauth/* answer 404.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The endpoint-only guard moves into plugins/batch.resolve_call — the one rule
set the action route, its GET and the batch read share since #32 — so an
endpoint's action is refused on all three. OpenAPI, the orval types and the
permissions matrix regenerated on the merged tree.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
main moved cron jobs into the cron-jobs plugin (#37) and retired the core
Send later doors for the scheduled-conversations plugin's commands (#36),
both touching the core MCP files this branch moves into the hub-mcp plugin.

- The MCP stays out of core: backend/mcpserver/, cli/mcp_tools.py,
  cli/mcp_server.py, their tests and business/aiApps/ stay deleted (main's
  edits to them — no schedule group, no cron / schedule tools — are the
  plugin's to apply).
- Cron and Send later follow main: backend/cron/routes.py gone (its
  by-name worker pick is runs.start's at fire time now), no ai-agent
  later / scheduled / unschedule — so a worker's narrowed CLI drops them
  from its command lists (workers/cli.py) and schedules nothing; Full
  reaches the plugin's commands.
- authz: neither runs.schedule nor mcp.connect.
- Settings: neither Scheduled jobs nor AI apps in the registry; both old
  addresses redirect to their plugin's page.
- Regenerated openapi.json, src/generated, rolesCatalog.json,
  matrix.golden.txt and telemetry features.json.
- cli/test_library_surface.py: parse_when left with `ai-agent later`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner
Merged into `main` as bfeed18a by the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/cadefe6f-0940-4688-bc56-1306d9265430.
gabrielvidal closed this pull request 2026-11-28 21:10:25 +01:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gabrielvidal/ai-agent#41