feat(agents): McpRegistryPort + DefaultMcpRegistry adapter #527
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!527
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/516"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Extracts the MCP-server /
allowedToolsassembly out ofagent-runner.tsandforeman.tsinto a hexagonal port + adapter pair (M25 / #516), so every dispatch path consults a single source of truth for forge selection (MF-1/2/5), the dual-mount flag (MF-5), and per-forge token injection (MF-4).domain/ports/mcp-registry-port.tsexposingserversFor(agent, binding)+allowedTools(agent, binding)over a minimal structuralAgentInstance(subset ofResolvedAgentandWorkerConfig).infrastructure/agents/default-mcp-registry.tscarrying the Forgejo dual-mount, theFORGE_TYPE/token wiring, and themcp__penpot__*allowlist gate; adualMount: falseconfig flip is the single switch for the MF-5 cutover.agent-runner.tsandforeman.tsnow build their MCP servers + tool allowlist through the adapter;mcp-config.tsconstants stay in place until every callsite migrates.Closes #516
Test plan
bun x turbo run test— 2458 pass / 0 fail (incl. 13 newdefault-mcp-registry.test.tscases for forge selection, MF-5 dual-mount, penpot gating, base allowlist, legacy fallback)bun x turbo run typecheck— clean across all 4 workspacesbun x @biomejs/biome@^2 check ./format .— clean (the 2 remaining infos are pre-existing inworkdir.test.ts)🤖 Generated with Claude Code
Port interface, adapter, and both migration sites are correct — forge selection, dual-mount flag, and per-forge token isolation all verified; 13 unit tests cover the required AC scenarios plus edge cases (GitLab, penpot gating, back-compat fallback,
reconfigure()), CI green (run #2474).Nit not worth blocking: the AC text says
McpServerSpecshould come fromdomain/agent/types.ts, but it's redeclared in the port file; the self-contained approach is sound (keeps the port from importing infrastructure types), though worth noting if a shared type location gets formalised in a later M25 issue.Rebase aborted — design superseded on
main.origin/mainalready carriesMcpRegistryPort+DefaultMcpRegistry(commitef7b74e) with a different shape:AgentInstance = ResolvedAgent(wide); this PR uses a narrow structural interface (name/type/forgejo_token/tokens/penpot_mcp).agent.token; this PR readsagent.forgejo_token.mf5DualMount; this PR's isdualMount.agent-runner.ts/foreman.tsonbuildMcpSetup; this PR migrates them, passingWorkerConfigwhich doesn't structurally satisfy main'sAgentInstance = ResolvedAgent.Add/add conflicts on
mcp-registry-port.ts,default-mcp-registry.ts, and the test file aren't resolvable without re-engineering either the port surface or the call-sites — both are design decisions, not rebase work.Recommend closing this PR. The remaining value (migrating
agent-runner.ts+foreman.tscallsites onto main's port) should land as a fresh issue against the now-merged port shape.899073aead7b9e5229487b9e5229482714a8c07b2714a8c07b2db7a19a9f