Repository navigation
Description
Problem
Global MCP installs have exactly one reconciliation domain: every apm install -g --only mcp reconciles the whole MCP surface across every target it has previously touched. --target is per-invocation only, so:
- Sequential per-target invocations delete each other's servers (pass 1
--target claudewith server A, pass 2--target codexwith server B → A is removed as stale). - Per-server-per-agent scoping is inexpressible at global scope. A fleet where server X should reach only Claude Code and server Y only Codex cannot be modeled — a union-target invocation deploys every server (including auth headers) to every target.
Verified on apm-cli 0.28.0.
Current behavior
The documented per-dependency targets field works for package (apm:) dependencies, but on dependencies.mcp entries the key is not part of the model — it is swept into the harness-specific extra passthrough (with an unknown-key warning) and flattened verbatim into the deployed config (e.g. it appears as a bogus targets property inside the ~/.claude.json server object), with no scoping effect.
Request
Honor targets: on dependencies.mcp entries with the same semantics as package dependencies: effective reach = install targets ∩ per-dependency targets, omitted = all install targets, and reconciliation/stale-pruning computed per target from the intersection rather than the whole surface.
Related
- feat(mcp): support env-backed HTTP headers for Codex remotes #1761 (env-backed HTTP headers for Codex remotes) — same motivation: per-target differences in what should reach each harness.
- [BUG]
apm install -g --mcpis rejected outright: "MCP servers are project-scoped" #2548 — the imperative-g --mcppath; the declarative manifest path this request builds on is the working one.
Context: building fleet tooling that generates ~/.apm/apm.yml per host from a shared config; per-agent MCP scoping is currently the one thing forcing servers to stay outside APM.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Aug 17, 2026
Triage Panel Verdict -- #2606
Title: feat(mcp): per-dependency
targetsscoping fordependencies.mcpentriesAuthor:
@lkshrkType: Feature request (well-specified, bounded scope)
Panel synthesis
DevX UX Expert
The request is for
targets:ondependencies.mcpentries to mirror the behavior already supported onapm:package dependencies. This is a critical consistency gap: users who adopt APM's declarative manifest model for MCP legitimately expect the same scoping semantics across all dependency kinds. The current behavior -- silently discardingtargets:and deploying every MCP server to every harness -- is a confusing and invisible trap. The fix is bounded: honortargets:in the MCP dependency model and thread it through reconciliation/stale-pruning, mirroring the existingapm:package path. High DevX value; the author's real-world fleet context makes the motivation concrete.Supply Chain Security Expert
Per-target MCP scoping has direct security implications. MCP servers frequently carry auth headers (Bearer tokens, API keys scoped to a specific harness). Today those credentials reach every configured target uniformly; there is no way to constrain a credential-bearing server to only the harness that needs it. Honoring
targets:ondependencies.mcpcloses this credential-broadcast exposure. The author's reference to #1761 (env-backed HTTP headers for Codex remotes) underscores the security motivation. This issue warrantsarea/mcp-trustandtheme/securityin addition toarea/mcp-config.APM CEO Arbiter
Clean, well-scoped feature request from a fleet-tooling user who demonstrably understands the APM model. The implementation path is clear: extend
DependencyMCPto propagatetargetsthrough reconciliation, mirroring the existing package-dependency code path. Related issues #1761 and #2548 confirm an emerging multi-harness/fleet pattern. This is the kind of bounded, high-clarity feature that belongs in the next minor release. Decision: ACCEPT.Decision
type/featuretheme/security,theme/governancearea/mcp-config,area/mcp-trustpriority/high0.29.0status/triagedSuggested next action: Design the
DependencyMCP.targetsfield propagation through the reconciliation engine, ensuring effective-reach = install targets ∩ per-dependencytargets, with stale-pruning computed per-target from the intersection. Cross-reference #1761 and #2548 for related prior art.4 remaining items
docs(changelog): reference #3951 for #2606
fix(mcp): fold panel follow-ups for per-target MCP pruning
fix(mcp): keep retained MCP claims correct across exclude and retarget
danielmeppiel commentedon Nov 19, 2026
Moved to 0.38 by the 0.37 architecture review: the structural fix belongs to the 0.38 plan/apply track. 0.37 carries a fallback (release note, clearer message, or for #2606 a key denylist) via #3983.
danielmeppiel commentedon Nov 19, 2026
Correction: back in 0.37 (maintainer decision). The full fix ships in 0.37 via #3983, not a fallback.
Merge PR A head; bundle MCP servers survive targets: deselection (#3955…
fix(pack): a root MCP server targeted away from Claude is not shipped
test(architecture): track the bundle-owned clause in the #2606 mutati…
fix(mcp): honor per-dependency targets for dependencies.mcp entries (m…