-
Notifications
You must be signed in to change notification settings - Fork 155
Add 'apm config' surface for persistent MCP registry URL (item 4b from #810) #818
Copy link
Copy link
Open
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).area/docs-sitedocs/src/content (Starlight), README, doc generation.docs/src/content (Starlight), README, doc generation.area/mcp-configMCP server configuration depth, transports, variable resolution.MCP server configuration depth, transports, variable resolution.enhancementDeprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.priority/lowAccepted but not time-sensitiveAccepted but not time-sensitivestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.One manifest, every target. Multi-target deploy, marketplace, packaging, install.type/featureNew capability, new flag, new primitive.New capability, new flag, new primitive.
Milestone
Metadata
Metadata
Assignees
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).area/docs-sitedocs/src/content (Starlight), README, doc generation.docs/src/content (Starlight), README, doc generation.area/mcp-configMCP server configuration depth, transports, variable resolution.MCP server configuration depth, transports, variable resolution.enhancementDeprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.priority/lowAccepted but not time-sensitiveAccepted but not time-sensitivestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.One manifest, every target. Multi-target deploy, marketplace, packaging, install.type/featureNew capability, new flag, new primitive.New capability, new flag, new primitive.
Type
Projects
Status
Todo
Background
PR #810 ships
apm install --mcp NAME ...for declaratively adding MCP servers toapm.yml, withMCP_REGISTRY_URLas the env-var-based registry override. PR #810 is also addingapm install --mcp --registry <url>(item 4a from the same review) for one-shot installs against a non-default registry.This issue tracks the third (and final) layer of the precedence chain: persistent, cross-platform configuration.
Problem
Env vars are awkward on Windows (no
.bashrc-style equivalent for terminal profiles; setting them per-shell is cumbersome). Enterprise teams that consistently use a private MCP registry need a way to set this once, persistently, in a wayapmitself manages.Proposed solution
Add
apm config set mcp-registry-url <url>(andapm config get/apm config unset).Final precedence chain (after this issue lands)
apm install --mcp --registry <url>(CLI flag — already in PR feat(install): add --mcp flag for declaratively adding MCP servers to apm.yml #810)MCP_REGISTRY_URLenv var (already shipped)apm config get mcp-registry-url(this issue)https://api.mcp.github.comThe first non-empty / non-null value wins.
Design surface to resolve
apm configalready exist? If not, this issue includes designing the surface (storage location, file format, scoping — global vs project). If it exists, just add the new key.~/.config/apm/config.yaml(XDG) on Linux/macOS,%APPDATA%/apm/config.yamlon Windows.mcp.registry-url(ormcp_registry_url) — needs decision, with room to grow (othermcp.*keys later).set: same URL allowlist as--mcp --registry(http/httpsonly; rejectfile://,ws://, etc.). Reuse_ALLOWED_URL_SCHEMESfrommodels/dependency/mcp.py.apm config get mcp-registry-urlprints the value or "(unset)" — never crashes.apm install --mcporapm mcp searchresolves the registry from this layer (not env, not flag), emit a single-line diagnostic naming the source:Registry: https://corp.mcp.example.com (from apm config). Mirrors the existing env-var diagnostic.Acceptance criteria
apm config set mcp-registry-url https://corp.mcp.example.comwrites to user configapm config get mcp-registry-urlreturns the stored valueapm config unset mcp-registry-urlremoves itfile://,ws://,javascript:) rejected atsettimeapm install --mcp NAME(no--registry, no env) uses the configured value--registryflag overrides config; env var overrides config; config overrides defaultdocs/src/content/docs/guides/mcp-servers.mdwith the full precedence chainAddedwith the issue + PR number suffixOut of scope
MCP_REGISTRY_URLusers — env keeps working at higher precedence; no migration needed.Panel context
This issue was distilled from a multi-expert review (supply-chain security, devx-ux, cli-logging, python-architecture) of PR #810. When this is implemented, invoke the APM Review Panel skill (
.github/skills/apm-review-panel/).References
--mcpand--registryflag +MCP_REGISTRY_URLenv var)