Skip to content

/mcp install from registry does not interpolate packageArguments variables #3887

Description

@jsmoorman

Describe the bug

When installing an MCP server via the /mcp command using a registry that follows the MCP Registry schema, Copilot CLI writes the raw variable placeholder (e.g. {ado_org}) literally into ~/.copilot/mcp-config.json instead of substituting the resolved value. This causes the MCP server to fail on startup because npx receives the unsubstituted template string as an argument.

Affected version

GitHub Copilot CLI 1.0.64-3

Steps to reproduce the behavior

  1. Have a registry entry that conforms to the MCP Registry schema, with a packageArguments
    entry using a value template and a variables block with a default:

     "packageArguments": [ {
        "type": "positional",
        "value": "{my_var}",
        "variables": {
          "my_var": {
            "description": "Some variable",
            "default": "some-default-value"
          }
        }
      } ]
    
  2. Install the MCP server via /mcp pointing at the registry URL.

  3. Inspect the generated ~/.copilot/mcp-config.json.

Expected behavior

Expected Behavior

Copilot CLI should:

  1. Parse packageArguments[].variables (and/or inputs) from the registry entry.
  2. Prompt the user for values that have no default, or apply the default silently.
  3. Write the resolved value into args in mcp-config.json:
"args": ["-y", "@some/mcp-package", "some-default-value"]

Actual Behavior

The raw template string is written verbatim into the config:

"args": ["-y", "@some/mcp-package", "{my_var}"]

This is passed directly to npx, causing the MCP server to fail or behave incorrectly
at startup.

Additional context

Workaround

Manually edit ~/.copilot/mcp-config.json and replace the placeholder string with the
intended value.

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions