Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/apm_cli/adapters/client/copilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ def get_config_path(self):
"""Get the path to the Copilot CLI MCP configuration file.
Returns:
str: Path to ~/.copilot/mcp-config.json
str: Project .mcp.json or the user-scope ~/.copilot/mcp-config.json.
"""
if not self.user_scope:
return str(self.project_root / ".mcp.json")
copilot_dir = Path.home() / ".copilot"
return str(copilot_dir / "mcp-config.json")

Expand Down
14 changes: 14 additions & 0 deletions src/apm_cli/integration/mcp_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,20 @@ def _gate_project_scoped_runtimes(
)
from apm_cli.integration.targets import RUNTIME_TO_CANONICAL_TARGET

# ``copilot`` is a user-facing target shared historically with the
# ``vscode`` alias. For an explicit project-scoped Copilot target,
# route the legacy VS Code runtime slot to the Copilot CLI adapter so
# MCP configuration lands in the CLI-supported project .mcp.json.
explicit_tokens = (
[explicit_target]
if isinstance(explicit_target, str)
else list(explicit_target or [])
)
if not user_scope and explicit_tokens == ["copilot"]:
target_runtimes = list(dict.fromkeys(
"copilot" if runtime == "vscode" else runtime for runtime in target_runtimes
))

if target_decision is not None and target_decision.canonical_targets is not None:
active = set(target_decision.canonical_targets)
out = [
Expand Down