Repository navigation
Description
Is your feature request related to a problem? Please describe.
Inline MCP dependency declarations in apm.yml currently only support HTTP-based servers (type http/sse) that use a url field. There is no support for stdio type MCP servers that use command, args, and env fields.
This means packages cannot declare dependencies on tools like @playwright/mcp or @azure/mcp which run as local subprocesses via stdio transport. The _install_inline_mcp_deps() function in cli.py requires a url field and skips any entry missing it, making stdio entries silently ignored.
Describe the solution you'd like
-
apm.ymlformat: Support an additional inline MCP shape for stdio servers:dependencies: mcp: - name: microsoft-playwright type: stdio command: npx args: ["@playwright/mcp@latest"] env: {}
-
_install_inline_mcp_deps(): Branch ontype— ifstdio, build{"type": "stdio", "command": ..., "args": ..., "env": ...}instead of requiringurl. Only validatecommandis present (noturl). -
Writers (
_write_inline_mcp_vscode,_write_inline_mcp_copilot): Already type-agnostic — they write theserver_configdict as-is. No changes needed. -
Deduplication:
_deduplicate_mcp_deps()already deduplicates dicts byname— no changes needed. -
Tests: Add test cases for stdio parsing, config writing, and dedup alongside existing HTTP tests.
Describe alternatives you've considered
- Registry-only approach: Users declare stdio MCP servers via registry strings (e.g.
npx @playwright/mcp@latest), but this doesn't support customargsorenvconfiguration and conflates the registry model with local execution. - Separate
stdiosection: A newdependencies.mcp_stdiokey, but this fragments the MCP config and complicates transitive collection.
Additional context
The change is small — primarily a type check branch in _install_inline_mcp_deps() (~10 lines). The downstream writers and dedup logic are already generic enough to handle it. Related to the transitive MCP dependencies feature on branch feat/transitive-mcp-dependencies.
Example use case: distributing a skill-playwright package that declares Playwright MCP as a stdio dependency, automatically configured across all consuming projects.
Activity
danielmeppiel commentedon Mar 2, 2026
Thanks for the suggestion and for thinking through the alternatives!
I'm closing this as won't-fix after researching the MCP ecosystem in depth. Here's why:
The MCP Registry already supports stdio servers natively.
The MCP Registry (v0.1 API, schema frozen since Oct 2025) models stdio servers with full metadata:
transport.type: "stdio",runtimeHint(npx/uvx/docker),runtimeArguments,environmentVariables, and package identifiers. For example, io.github.mleoca/ucn is a stdio server registered with its npm package and transport type.Regarding the "registry-only approach" alternative you considered — the registry schema does support custom args and env configuration. It models what a server expects (which env vars, which args, transport type). What it doesn't provide is project-specific values (your actual
API_KEY, your--workspace ./src). That's a config overlay concern — but it's a fundamentally different feature from what this issue proposes.What this means for APM:
{name: ..., command: ..., args: [...]}) would duplicate what the registry already provides, create a parallel config format to maintain, and bypass the registry's versioning/validation.If a future need arises for project-specific overrides on top of registry metadata (env var values, arg overrides), that would be a separate, cleaner feature — not inline server definitions replacing registry lookups.
APM's position: Stay registry-first. The registry is the source of truth for server metadata. The investment goes into deeper registry integration rather than inventing a parallel inline format.
lirantal commentedon Apr 20, 2026
Daniel Meppiel (@danielmeppiel) would like to re-visit this with a question - from your statement of:
Does it mean that I can't just declare an ad-hoc MCP server and must count on the MCP server being published to the registry?
Meaning, given that an MCP server is a one-off project on GitHub that I'd then install in my AI agent through something like:
Is there no existing way to declare that for apm currently?
lirantal commentedon Apr 20, 2026
Oh the above was confusing because the following
apm.yamlseems to work just fine....mcp: - name: nodejs-api-docs registry: false transport: stdio command: "npx mcp-server-nodejs-api-docs"I feel like we need a good docs section covering this kind of config Daniel Meppiel (@danielmeppiel) because I couldn't find it
also, is it possible to somehow use the apm CLI to end up with that config or does an MCP server setup like this require manual edit to the yaml config?
danielmeppiel commentedon Apr 21, 2026
Reopening this -- the original close was technically right (the feature exists) but the framing was misleading and missed three real DX gaps your conversation surfaced. Thanks for pushing on it, Liran Tal (@lirantal).
Yes, this works today -- here is the canonical snippet
Run
apm installand APM writes the entry to.vscode/mcp.json/.cursor/mcp.json/ etc. for the targets you have configured.Two things to note:
registry: falseopts out of the registry resolution, which is what you want for a self-defined server.commandis the binary,argsis the list. Do not put the whole shell line incommand:-- APM does not split on whitespace. (We are about to make that mistake loud rather than silent -- see issue 1 below.)Three issues filed off this conversation
This is what was actually missing -- not capability, but discoverability, ergonomics, and validation:
feat(validation): warn or error on shell-string command in MCP stdio entries. Todaycommand: "npx mcp-server-foo"is silently accepted; we will surface it at parse time with a fix-it message.feat(cli): extend 'apm install --mcp' for declarative MCP server addition. So you can doapm install --mcp nodejs-api-docs -- npx -y mcp-server-nodejs-api-docsinstead of hand-editingapm.yml. Mirrorsnpm installsemantics.docs: consolidate MCP coverage into a single canonical guide. Right now MCP coverage is spread across 24 doc pages with the declaration syntax duplicated three times and no dedicatedMCP Serversguide -- which is the structural reason you bounced. We will addguides/mcp-servers.mdwith a "Quick start: add a one-off MCP server" section right at the top (this snippet, basically) and shrink the duplicates.I am sequencing them validation -> CLI -> docs so the new guide can reference shipped behavior, not "coming soon" placeholders.
To answer your original question directly
No. Set
registry: falseand providetransport+command/args(orurlfor http/sse/streamable-http). This will be much easier to find once #808 ships -- and once #807 ships you will not need to touchapm.ymlat all for the common case.danielmeppiel commentedon Apr 21, 2026
W3 (CLI gap) shipped: PR #810
apm install --mcp NAME ...is now the canonical way to add an MCP server declaratively. The lirantal use case from this thread:Mirrors how packages already work. Also accessible as
apm mcp installfor discoverability.Roadmap status:
apm.ymlwith shell-string commands now fails fast with a fix-it message--mcpflag + breaking security hardening onMCPDependency.validate()Cc Liran Tal (@lirantal) — your feedback drove the whole tranche. Both PRs are independently mergeable.
danielmeppiel commentedon Apr 21, 2026
Roadmap update — final tranche shipped (W2 in review).
Following the panel + doc-architect plan, three workstreams shipped from your original confusion report:
commandin MCP stdio entriesapm install --mcp <id> -- <argv...>declarative add (mirrors npminstall)docs/guides/mcp-servers.md+ drift fixesW2 leads with the exact stdio shape you brought to the original report, so future visitors land on a one-line answer instead of scrolling Copilot/IDE primers. The won't-fix close on this issue stands -- no capability gap -- but the discoverability gap your feedback exposed is now closed end-to-end.
Thanks again for the signal.
danielmeppiel commentedon Apr 21, 2026
Update: W2 (docs) folded into W3 PR #810. Single PR now ships both the
apm install --mcpcode and the consolidated MCP guide that documents it. Roadmap stands; #811 closed.fix(mcp): honour MCP_REGISTRY_URL in search/list/show; diagnose regis…
feat(install): add --mcp flag for declaratively adding MCP servers to…
fix(mcp): address PR #809 review (tab whitespace + CHANGELOG PR ref)
feat(validation): reject shell-string command in MCP stdio entries (#809
refactor: remove inline dict MCP installation pipeline
feat(install): add --mcp flag for declaratively adding MCP servers to…
feat(validation): reject shell-string command in MCP stdio entries (#809