Skip to content

feat(pool): a pool names MCP upstreams for its members (ADR-0069 option B) - #349

Merged
7schmiede merged 1 commit into
mainfrom
feat/pool-upstreams
Oct 28, 2026
Merged

7schmiede merged 1 commit into
mainfrom
feat/pool-upstreams

Conversation

@7schmiede

Copy link
Copy Markdown
Member

A pool's coordinator keeps a list of MCP upstreams for its members; each member's hub offers them in the dashboard and uses one only once its user accepted it, with that user's own login (ADR-0069 option B, postponed there until now).

Review card

Approved by the owner in the conversation on 2026-10-28: all five points.

Category Point Beats Reversing costs
concept A pool names MCP upstreams for its members (name, URL, prefix, allowlist, how it logs in, a public client id), never a secret or a token; logging in and the tokens stay in each member's hub (ADR-0069 point 3 unchanged). Everyone types them in by hand; a central gateway holding everyone's tokens (option E). Remove the endpoint and the coordinator's file; hubs forget the pool entries.
trust An entry is always a URL upstream, never a command. If wrong: whoever holds the coordinator or an admin's machine runs code on every member's machine. Commands, with the member confirming them. Allowing commands later is cheap (a new field); forbidding them again breaks pools that use them.
trust An entry is used only once the member accepted it in the dashboard; a pool that changes its URL has it accepted again. If wrong: a coordinator points every member's agents, and what they send, at a server of its choosing and feeds them tool descriptions, without anyone clicking. Entries active at once (no click at all for login kinds none and token). An acceptance kept per member in the hub.
concept The member's own configuration goes first: an entry with a name or prefix the member already uses is not taken, a declined entry stays declined, and two pools' entries with one prefix are neither taken until the member gives one another. The pool overrides the member's entries. Changing the precedence later moves tool names agents rely on.
contract The list lives with the coordinator (upstreams.json in its directory); an admin changes it with the CLI or in the pool area of the dashboard, each change in audit.jsonl; members read it with GET /v1/upstreams, a coordinator of an earlier release answers 404, read as an empty list. A field in the pool overview or in members.json. Endpoint and file are part of the pool protocol, which users outside the maintainers have (since 0.20.0); additive, nothing breaks.

Decided on my own: the CLI is devstack pool upstreams [list|add|remove]; the hub asks its pools every minute in a background thread (a coordinator that does not answer takes up to 15 s, so not in a request) and at once after its own admin changed a list, keeping the lists in pool-upstreams.json and the last one of a pool that does not answer; an accepted entry is <pool>:<name> in the hub (keychain entry, tool descriptions); the dashboard says "from pool X"; an entry the pool drops, or of a pool the machine left, goes with its decision and login; the URL is https:// only (a pool's localhost is each member's own machine) and a token login names no environment variable (a pool could otherwise send a member's environment to its URL); a change of prefix, allowlist or login kind by the pool needs no new acceptance, only a new URL does; a pool names at most 64 entries; the ADR is an addendum to ADR-0069.

Found on the way

The hub's upstream tests failed now and then on Windows, on main too: the Windows Credential Manager lost writes and deletes made side by side from several threads, and the tests also wrote into the user's real keychain service under shared names (tracker). The hub now makes one keychain call at a time (parallel tool calls refreshing tokens could hit the same), and each test uses a keychain service of its own. 8 runs in a row green afterwards.

Checked

  • cargo fmt, cargo clippy --workspace --all-targets clean
  • cargo test -p devstack-node -p devstack-hub -p devstack -p devstack-skills (Windows): green; new crates/devstack-node/tests/upstreams.rs (members read, only admins change, audited, https only) and hub tests (accept, URL change, a pool that does not answer, decline, own-first, two pools with one prefix, dropped entry and pool left)
  • ui: build and vitest green; the pages screenshotted in mock mode (pool entries on MCP upstreams, the list in the pool area)
  • Not tried against a real coordinator with a real MCP server yet; macOS and Linux only through CI

🤖 Generated with Claude Code

…on B)

A pool's coordinator keeps a list of MCP upstreams (name, https URL,
prefix, allowlist, how it logs in; never a secret, never a command) in
upstreams.json. Admins change it with `devstack pool upstreams add|remove`
or in the pool area of the dashboard, each change audited; members read it
with GET /v1/upstreams (404 from an earlier coordinator reads as none).

Each member's hub asks its pools every minute, off the requests, and
offers the entries on the MCP upstreams page. One is used, as
`<pool>:<name>`, only once the user accepted it at the URL the pool names;
a new URL asks again and forgets the old login. The user's own upstreams
go first, a declined entry stays declined, two pools' entries with one
prefix wait for the user to give one another, and an entry the pool drops
or of a pool left goes with its login.

The Windows Credential Manager lost writes and deletes made side by side
(seen in the hub's tests, which also shared the user's keychain service):
the hub now makes one keychain call at a time, and its tests use a
keychain service each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede force-pushed the feat/pool-upstreams branch from 55d7d2b to d203b6e Compare October 28, 2026 14:05
@7schmiede
7schmiede merged commit 9b04ea0 into main Oct 28, 2026
13 checks passed
@7schmiede
7schmiede deleted the feat/pool-upstreams branch October 28, 2026 14:11
@7schmiede 7schmiede mentioned this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant