Settings → MCP: the parts #153 deferred #171

Open
opened 2026-09-17 12:21:58 +02:00 by lz · 0 comments
Owner

Follow-up to #153. That issue was written before #170 and named four sections; the panel ships the two that have something behind them. This tracks the rest.

Design record, including why each was deferred rather than faked: docs/superpowers/specs/2026-09-17-mcp-settings-panel-design.md.

The common thread: each of these needs backend work first. Built as UI over what exists today, every one of them would be a control with nothing on the other side of it.

1. Connected clients, and real revocation

The substantial one, and the only one with a user-visible gap today.

cimd_clients is (url, added_at) — it answers who may register, not who has connected. #153 asked for "name, whether CIMD-verified, granted scopes, last used, revoke"; none of that is in the table, and none of it can be — name and scopes live in the grant, and last-used is recorded nowhere.

Removing an allowlist entry revokes nothing. It stops the next authorization. An already-connected client keeps working:

  • its access token for 5 minutes (accessTokenTTL: 300, oauth/config.ts);
  • its refresh chain until 14 days after the original grant — an absolute deadline, not a rolling one, because oauth/config.ts:189 hands a rotated token its predecessor's remainingTTL for clientAuthMethod === 'none', which Claude is.

So there is currently no way, from any surface, to disconnect a client. Real revocation is AccessToken.revokeByGrantId against the grant. Needs: a query surface over the adapter's grant rows, a DTO, a route, and UI — plus a live drive proving revocation actually disconnects, since this is exactly the kind of thing that passes a unit test and does nothing.

The panel today is careful not to imply otherwise: the remove confirmation says removal does not disconnect, and names the 14 days.

2. External OIDC authorization server

#153 wants a Built into Nexus / External OIDC provider segmented control, described as "the pluggable seam made visible". The seam does not exist:

  • deriveIssuer(publicUrl) always returns Nexus's own origin;
  • there is no issuer entry in settings/registry.ts;
  • there is no second token verifier.

A segmented control with one reachable position is a control over nothing, so the panel ships one honest line instead: "Nexus issues the tokens itself. Pointing this at an external OIDC provider is not built yet."

When this is built it becomes an enum SettingDef with an options array rendered by SettingField.svelte (Conventions → Settings), not a third hand-written enum control. One setting must drive both the advertised authorization_servers and the active verifier, so the two cannot disagree — that is the property the milestone description calls unrepresentable rather than merely tested for.

3. DCR toggle

providerDepsFromSingletons hardcodes allowDcr: false (singletons.ts:298), commented "DCR (#153) is out of scope on this branch". The seam exists; the setting does not.

Low value: MCP 2026-07-28 deprecated DCR in favour of CIMD — the mechanism the panel already manages — so this would exist to switch on a deprecated path. Note allowDcr feeds getProvider's memo key, so flipping it rebuilds the Provider. Fine, but real work.

4. Kill switch

Considered during #153 and deliberately declined for now.

Not an enable — the signing key and public_url already decide whether MCP serves, and a second source of truth would let the panel read "enabled" beside an endpoint returning 503. The argument for it is narrower: with §1 deferred, nothing in the UI can cut off an already-connected client, and unsetting the env var needs shell access and a restart — which is what you do not have on a phone, the scenario this milestone exists for.

Shape if revisited: one bool SettingDef plus a check in /api/mcp, labelled "Serve MCP requests", off meaning reject everything now, including clients already connected. Largely obsoleted by §1, which solves the same problem precisely instead of bluntly.

Not in scope, here or anywhere

Fetching or previewing a CIMD document, from the server or the browser. #152's original body described resolving the document on add; #169 reversed that — resolution happens inside the OAuth flow via the library's allowFetch/allowClient, both bound to the allowlist, and nothing under src/lib/server/cimd/ calls fetch.

Nexus runs network_mode: host with the Docker API on 127.0.0.1:2375. A "validate by fetching" button is a server-side request to an operator-supplied URL sitting next to the Docker socket. The allowlist being an exact string comparison is the whole security property; a reachability chip per entry is the one feature that must never be built.

Follow-up to #153. That issue was written before #170 and named four sections; the panel ships the two that have something behind them. This tracks the rest. Design record, including why each was deferred rather than faked: `docs/superpowers/specs/2026-09-17-mcp-settings-panel-design.md`. The common thread: each of these needs **backend work first**. Built as UI over what exists today, every one of them would be a control with nothing on the other side of it. ## 1. Connected clients, and real revocation The substantial one, and the only one with a user-visible gap today. `cimd_clients` is `(url, added_at)` — it answers *who may register*, not *who has connected*. #153 asked for "name, whether CIMD-verified, granted scopes, last used, revoke"; none of that is in the table, and none of it can be — `name` and scopes live in the grant, and last-used is recorded nowhere. **Removing an allowlist entry revokes nothing.** It stops the *next* authorization. An already-connected client keeps working: - its access token for 5 minutes (`accessTokenTTL: 300`, `oauth/config.ts`); - its refresh chain until **14 days after the original grant** — an absolute deadline, not a rolling one, because `oauth/config.ts:189` hands a rotated token its predecessor's `remainingTTL` for `clientAuthMethod === 'none'`, which Claude is. So there is currently no way, from any surface, to disconnect a client. Real revocation is `AccessToken.revokeByGrantId` against the grant. Needs: a query surface over the adapter's grant rows, a DTO, a route, and UI — plus a live drive proving revocation actually disconnects, since this is exactly the kind of thing that passes a unit test and does nothing. The panel today is careful not to imply otherwise: the remove confirmation says removal does not disconnect, and names the 14 days. ## 2. External OIDC authorization server #153 wants a *Built into Nexus / External OIDC provider* segmented control, described as "the pluggable seam made visible". The seam does not exist: - `deriveIssuer(publicUrl)` always returns Nexus's own origin; - there is no issuer entry in `settings/registry.ts`; - there is no second token verifier. A segmented control with one reachable position is a control over nothing, so the panel ships one honest line instead: *"Nexus issues the tokens itself. Pointing this at an external OIDC provider is not built yet."* When this is built it becomes an enum `SettingDef` with an `options` array rendered by `SettingField.svelte` (Conventions → Settings), **not** a third hand-written enum control. One setting must drive both the advertised `authorization_servers` and the active verifier, so the two cannot disagree — that is the property the milestone description calls unrepresentable rather than merely tested for. ## 3. DCR toggle `providerDepsFromSingletons` hardcodes `allowDcr: false` (`singletons.ts:298`), commented *"DCR (#153) is out of scope on this branch"*. The seam exists; the setting does not. Low value: MCP 2026-07-28 deprecated DCR in favour of CIMD — the mechanism the panel already manages — so this would exist to switch on a deprecated path. Note `allowDcr` feeds `getProvider`'s memo key, so flipping it rebuilds the Provider. Fine, but real work. ## 4. Kill switch Considered during #153 and deliberately declined for now. Not an *enable* — the signing key and `public_url` already decide whether MCP serves, and a second source of truth would let the panel read "enabled" beside an endpoint returning 503. The argument for it is narrower: with §1 deferred, nothing in the UI can cut off an already-connected client, and unsetting the env var needs shell access and a restart — which is what you do not have on a phone, the scenario this milestone exists for. Shape if revisited: one bool `SettingDef` plus a check in `/api/mcp`, labelled "Serve MCP requests", off meaning *reject everything now, including clients already connected*. Largely obsoleted by §1, which solves the same problem precisely instead of bluntly. ## Not in scope, here or anywhere **Fetching or previewing a CIMD document**, from the server or the browser. #152's original body described resolving the document on add; #169 reversed that — resolution happens inside the OAuth flow via the library's `allowFetch`/`allowClient`, both bound to the allowlist, and nothing under `src/lib/server/cimd/` calls `fetch`. Nexus runs `network_mode: host` with the Docker API on `127.0.0.1:2375`. A "validate by fetching" button is a server-side request to an operator-supplied URL sitting next to the Docker socket. The allowlist being an **exact string comparison** is the whole security property; a reachability chip per entry is the one feature that must never be built.
lz added this to the MCP support (#140) milestone 2026-09-17 12:21:58 +02:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lz/agent-nexus#171
No description provided.