Repository navigation
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
- 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
- Run
apm install -g <path-to-package> --target copilot - 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
- Cause:
SafeMCPInstaller.install_servers()only passesserver_namewhen the name starts with@and contains exactly one/. Otherwise the adapter falls back toserver_url.split("/")[-1]. - Suggested fix (as already proposed in [BUG] Scoped MCP server names (@scope/name) are truncated to the basename when materializing harness configs #1693): always pass the declared
dep.nameasserver_namefor self-defined servers.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
danielmeppiel commentedon Nov 10, 2026
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)
danielmeppiel commentedon Nov 10, 2026
The
apm-scope:v1record 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.
fix(mcp): replace owned truncated keys and cover every MCP target
fix(mcp): preserve declared self-defined server names containing slas…
danielmeppiel commentedon Nov 11, 2026
Delivered by #3493.