Repository navigation
feat: notice a pool's upstream an agent has set up itself - #479
Merged
Merged
Conversation
The hub reads the MCP servers Claude Code (.claude.json, user and local scope; a tree's .mcp.json) and Codex (config.toml) have configured, names and URLs only, read only, and matches them to the pool's upstreams by URL. A hook bound to the upstream applies for the agent that has it set up itself; the MCP upstreams page and devstack doctor name the own entry with the command that removes it. Closes #473 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7schmiede
force-pushed
the
feat/upstream-direct
branch
from
November 6, 2026 15:09
5a9a81d to
d2c185d
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A member had a pool's MCP upstream set up in Claude Code directly (
claude mcp add --scope user --transport http …, a service's own setup hint) and had never answered the pool's offer. The agent had the tools, but both hooks of a pool skill bound to that upstream stayed silent for the whole session, and nothing pointed at the cause. Accepting the upstream as well would have given the agent the tools twice (#473).crates/devstack-hub/src/agentmcp.rs): Claude Code's.claude.json(inCLAUDE_CONFIG_DIR, else the home folder;mcpServersuser scope,projects.<folder>.mcpServerslocal scope) and a working tree's.mcp.json(project scope); Codex'sconfig.toml([mcp_servers.<name>]with aurl). Read only, name and URL only, never headers. URLs compare normalised: scheme and host in lower case, default port, user, query and fragment dropped, no trailing/.agenthooks.rs,upstream_there): a hook bound to an upstream applies when it is accepted, as before, or, read only then, when the agent running the hook has a server of its own at the pool's URL.GET /hub/upstreamscarriespool.direct(agent, scope, entry, file, the removal command); the MCP upstreams page shows it under the pool's entry with what to do (accepted: the tools twice; not accepted: use it here, then remove the own entry) and the command;devstack doctorwarns with the same.docs/pool.md,docs/dashboard-api.md; addenda to ADR-0069 (points 4, 6) and ADR-0094 (point 5); CHANGELOG.Review card
~/.claude.json, global and per project, and a working tree's.mcp.json; Codex~/.codex/config.toml), read only, names and URLs only; nothing leaves the machine, nothing is written. If wrong: nothing gained by an attacker; they are the user's own files and no token is read.claude mcp list(slow, starts the servers)upstreamalso applies when the agent has a server of its own whose URL (normalised: scheme, lower-case host, port, path without trailing/) is the pool upstream's URL: a direct configuration counts as the upstream being there (amends ADR-0094 point 5 additively).devstack doctorwarns with the same; the hub never changes an agent's MCP configuration.~/.claude.json)Approved by the owner in the conversation on 2026-11-06: points 4, 5 and 6.
Decided on my own: the page reads the agents' files only when a pool offers upstreams, and for the project scope only the
.mcp.jsonof registered stacks' repositories; Claude Code's local scope counts for a working tree in that folder or below it; Codex has a user scope only, and its "removal command" names the table to delete (there is no stablecodex mcp removeto rely on); the member's own hub upstream of the same name still keeps the pool's out.Verified (Windows 11)
session-starthook bound tonuts-timetrack, the pool's list, the upstream not accepted) and a.claude.jsonfixture viaCLAUDE_CONFIG_DIR: without an own entry, nothing; with an own entry at the pool's URL (trailing/, different case), the hook's text; the installed 0.41.0 binary with the same fixture prints nothing (the issue's case).devstack doctoragainst this machine's real hub state with a.claude.jsonfixture naming the pool's timetrack URL:warn upstream \nuts-timetrack` of pool `default` (…) is also configured directly in Claude Code (user scope, entry `nuts-timetrack`): the agent gets its tools twice; remove the own entry with `claude mcp remove --scope user nuts-timetrack``. Without the fixture, no warning.crmentry with adirectrecord; the page itself was not looked at in a browser (no browser at hand): the text comes fromui/src/lib/upstreams.ts, covered by vitest.cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test -p devstack-hub -p devstack(lib, bins),npm run typecheck,npm test(190),npm run buildgreen.Closes #473
🤖 Generated with Claude Code