Skip to content

[BUG] Self-defined MCP server names with a "/" are truncated to the last segment in the harness config #3456

Closed

Description

Describe the bug
When a self-defined MCP server in apm.yml has a registry-style name containing a / (e.g. com.azure.dev/mcp-remote-azure-devops), apm install writes the harness config entry under the last segment only (mcp-remote-azure-devops).

#1693 / #1699 fixed this for npm-style @scope/name, but only when the name starts with @ and has exactly one /. Reverse-DNS names as used by the official MCP registry (com.example/server, io.github.owner/server) are still truncated.

This matters because Copilot's MCP private registry enforcement matches on the config key. The truncated key is not in the registry, so the server is blocked:

1 MCP server was blocked by policy: 'mcp-remote-azure-devops'

Using the full name com.azure.dev/mcp-remote-azure-devops as the key is allowed. There is no way to get that key through APM today.

This is fully blocking us from setting up MCP servers through APM as this (the fixed MCP server name) is an organization policy.

To Reproduce

  1. Create apm.yml:
    name: repro
    version: 1.0.0
    targets: [copilot]
    dependencies:
      apm: []
      mcp:
        - name: com.azure.dev/mcp-remote-azure-devops
          registry: false
          transport: http
          url: https://mcp.dev.azure.com/my-org
  2. Run apm install -g <path-to-package> --target copilot
  3. Open ~/.copilot/mcp-config.json

Actual:

{
  "mcpServers": {
    "mcp-remote-azure-devops": {
      "type": "http",
      "url": "https://mcp.dev.azure.com/my-org",
      "tools": ["*"],
      "id": ""
    }
  }
}

Expected behavior
The config key is the declared name, exactly as written: com.azure.dev/mcp-remote-azure-devops.

Environment (please complete the following information):

  • OS: Windows 11 Enterprise
  • Python Version: 3.14.5 (pip install) / bundled binary
  • APM Version: 0.29.0 and 0.35.0 (both reproduce)
  • Copilot CLI: 1.0.105

Logs
The install output shows the full name, but the written key is truncated:

|  [>]  com.azure.dev/mcp-remote-azure-devops (self-defined, http)
  + com.azure.dev/mcp-remote-azure-devops
|  [+]  com.azure.dev/mcp-remote-azure-devops -> Copilot (configured)

Additional context

Activity

  1. added
    type/bug
    on Nov 3, 2026
  2. danielmeppiel commented on Nov 10, 2026

    @danielmeppiel
    Collaborator

    Decision: approve
    Area: project
    Scope: Use the declared name of a self-defined MCP server (registry: false) as its native configuration key in every MCP target adapter whenever the name contains a slash, including reverse-DNS names such as com.example/server, extending the declared-name fix made for @scope/name in #1693/#1699, while registry-resolved server keys stay unchanged.
    Done when: Tests through SafeMCPInstaller and each affected adapter show the exact declared key for a reverse-DNS self-defined name (http and stdio), two declared names sharing a final segment do not collide, @scope/name, plain names and registry-backed names keep today's keys, lockfile mcp_target_servers matches the written key so reinstall, uninstall and drift checks work, a registry lookup failure does not raise, and a previously APM-written truncated entry is replaced only when ownership records prove APM wrote it, otherwise left in place with names-only guidance; tests fail on current main.
    Out of scope: Registry naming semantics, MCP policy matching changes, Copilot private-registry behavior, forced deletion or migration of user-edited entries, and other MCP issues (#3404, #3498, #3499).
    Review contact: Daniel Meppiel (@danielmeppiel)

  3. danielmeppiel commented on Nov 10, 2026

    @danielmeppiel
    Collaborator

    The apm-scope:v1 record above was approved by Daniel Meppiel (@danielmeppiel) at Gate B on 2026-11-10 in the coordinator session of the issue-reduction program. It is the scope a fix for this issue will be reviewed against.

    Review contact: Daniel Meppiel (@danielmeppiel).

    Linked pull requests:


    Generated by autopilot-issue-triage-worker. This comment is AI-generated and may contain errors.

  4. added
    status/accepted
    on Nov 10, 2026
  5. danielmeppiel commented on Nov 11, 2026

    @danielmeppiel
    Collaborator

    Delivered by #3493.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/acceptedtype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions