Skip to content

[FEATURE] Support workspace-level (.mcp.json) and global (-g) MCP configurations for Copilot CLI #2047

Description

@Skolim007

[FEATURE] Support workspace-level (.mcp.json) and global (-g) MCP configurations for Copilot CLI

Is your feature request related to a problem? Please describe.

Currently, managing MCP servers for the GitHub Copilot CLI is limited because APM's copilot integration target is hard-coded to global scope.

Specifically:

  • Running apm integration install copilot always writes the configuration globally to ~/.copilot/mcp-config.json, even when run without -g / --global inside an APM project workspace.
  • The APM CLI's Copilot integration does not support project-scoped installations.

Since the GitHub Copilot CLI itself supports project-scoped MCP configurations loaded from .mcp.json or .github/mcp.json at the workspace root, forcing all installations to be global causes environment pollution. This leads to configuration bloat, potential tool argument conflicts between different workspaces, and prevents workspace-specific tools from being checked into version control.

The official Copilot CLI documentation is not fully clear here but as on the main MCP config section it does nto vocer taht option (https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli/overview#add-an-mcp-server), though it is officially documented as supproted behaviour here (https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#mcp-server-loading-priority)

Warning message from Copilot CLI that currently this config is not supported.
Image

Working (manually created) project-level .mcp.json config

Image

Describe the solution you'd like

Extend APM's Copilot integration to support both project-local and user-global installation scopes:

  1. Install-Write Path (CopilotClientAdapter):
    • By default (project scope), write the configuration locally to <project_root>/.mcp.json.
    • Only write to the user-global ~/.copilot/mcp-config.json when the --global / -g flag is explicitly provided.
  2. Runtime-Read Path (CopilotRuntime):
    • Discover and read MCP configurations following the Copilot CLI's official loading priority:
      1. Current working directory .mcp.json
      2. Current working directory .github/mcp.json
      3. User-global fallback ~/.copilot/mcp-config.json
    • Ensure the parser supports the workspace-scoped "mcpServers" root key (used in .mcp.json) in addition to the global "servers" key.

Describe alternatives you've considered

  • Manually maintaining local configuration files: Copying and pasting MCP configurations manually to .mcp.json when working in a specific project. This is error-prone and bypasses APM's dependency resolution, updating, and installation workflows.
  • Injecting all project configurations into global config: Keeping the current global-only behavior. This is undesirable because it exposes all workspace tools to Copilot in every directory, increasing startup overhead and causing command/context pollution.

Additional context

  • Official Reference: GitHub Copilot CLI's MCP server loading priority documentation.
  • mcp.json migration: Official docs how to migrate form VS Code format to .mcp.json https://gh.io/copilotcli-mcpmigrate
  • Parity: Other client adapters in APM (like Cursor and Windsurf) already support project-local scoping. Implementing this will achieve feature parity for the Copilot integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mcp-configMCP server configuration depth, transports, variable resolution.area/mcp-trustTransitive MCP trust prompts, consent contract, transport security.status/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/featureNew capability, new flag, new primitive.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions