Skip to content

[FEATURE] Support stdio MCP servers in inline dependency declarations #122

@sergio-sisternes-epam

Description

@sergio-sisternes-epam

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

  1. apm.yml format: Support an additional inline MCP shape for stdio servers:

    dependencies:
      mcp:
        - name: microsoft-playwright
          type: stdio
          command: npx
          args: ["@playwright/mcp@latest"]
          env: {}
  2. _install_inline_mcp_deps(): Branch on type — if stdio, build {"type": "stdio", "command": ..., "args": ..., "env": ...} instead of requiring url. Only validate command is present (not url).

  3. Writers (_write_inline_mcp_vscode, _write_inline_mcp_copilot): Already type-agnostic — they write the server_config dict as-is. No changes needed.

  4. Deduplication: _deduplicate_mcp_deps() already deduplicates dicts by name — no changes needed.

  5. 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 custom args or env configuration and conflates the registry model with local execution.
  • Separate stdio section: A new dependencies.mcp_stdio key, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageNew issue, not yet reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions