-
Notifications
You must be signed in to change notification settings - Fork 156
feat(cli): extend 'apm install --mcp' for declarative MCP server addition #807
Copy link
Copy link
Closed
Labels
cliDeprecated: use area/cli. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use area/cli. Kept for issue history; will be removed in milestone 0.10.0.dxenhancementDeprecated: 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.needs-designDeprecated: use status/needs-design. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use status/needs-design. Kept for issue history; will be removed in milestone 0.10.0.
Metadata
Metadata
Assignees
Labels
cliDeprecated: use area/cli. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use area/cli. Kept for issue history; will be removed in milestone 0.10.0.dxenhancementDeprecated: 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.needs-designDeprecated: use status/needs-design. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use status/needs-design. Kept for issue history; will be removed in milestone 0.10.0.
Context: Surfaced via #122 and the followup conversation with @lirantal -- there is no CLI path to add an MCP server today; users must hand-edit
apm.yml.apm mcptoday is read-only (list/search/show).Proposed change
Extend
apm install(the canonical add-and-deploy verb, mirroringnpm install) with an explicit--mcpflag for MCP server entries. Reuses the already-existing--only [apm|mcp]vocabulary on the same command.Discoverability bridge: thin alias
apm mcp install <args>delegates toapm install --mcp <args>for users arriving viaapm mcp --help. Pure delegation, no code duplication.Why
--mcpflag instead of auto-detection of positional shapeAuto-detecting "is this an MCP registry name?" by string pattern is fragile and surprising -- a typo'd APM package name could silently land as an MCP entry. Explicit flag keeps the contract unambiguous.
Security-correctness by construction
After
--,argv[0]becomescommand(string), rest becomesargs(list). Noshell=True, no whitespace-splitting. Same boundary that closes the validation gap in [link-to-w4-issue].Defaults logic
transport: stdiowhen--is presenttransport: httpwhen--urlis presenttransportfrom--transportif explicitly set (overrides above)registry: falsewhen--or--urlis usedregistry: truewhen only a registry name is given (no--, no--url)Scope
apm install:--mcp,--transport,--url,--env(repeatable)--boundarydependencies.mcpentries (idempotency, name collision warn).vscode/mcp.json,.cursor/mcp.json, etc.apm mcp installdocs/src/content/docs/reference/cli-commands.mdWorkstream: Sequential after validation warn ([link-to-w4-issue]); blocks docs consolidation ([link-to-w2-issue]) Quick Start which references the new CLI.