Skip to content

Support per-repository MCP server configuration (.github/mcp.json) #2528

@nunocorreiavargas

Description

@nunocorreiavargas

Feature Request

Problem

Currently, MCP server configuration in Copilot CLI is stored only at the user level (~/.copilot/mcp-config.json). There is no way to define per-repository MCP servers, unlike custom instructions (.github/copilot-instructions.md) and LSP servers (.github/lsp.json), which already support repo-level configuration.

This means:

  • Teams cannot share MCP server configurations through version control.
  • Developers must manually add/remove MCP servers when switching between projects that need different servers.
  • There is no parity with VS Code, which supports .vscode/mcp.json at the repo level.

Proposed Solution

Support a repo-level MCP config file, for example:

.github/mcp.json

This file would follow the same schema as ~/.copilot/mcp-config.json and be automatically loaded when Copilot CLI starts in a repository that contains it. User-level config would still apply as a fallback/merge.

Additional Context

  • VS Code already supports .vscode/mcp.json for per-repo MCP config. When using Copilot CLI via /ide integration with VS Code, MCP servers defined in .vscode/mcp.json are not inherited by the CLI, which is a surprising gap.
  • Other repo-level configs already exist: .github/copilot-instructions.md, .github/instructions/**/*.instructions.md, .github/lsp.json, .github/agents/. MCP config is the odd one out.
  • A natural precedence order would be: repo-level .github/mcp.json merges with (or overrides) user-level ~/.copilot/mcp-config.json, similar to how VS Code handles workspace vs user settings.

Benefits

  1. Team collaboration — shared MCP servers checked into version control.
  2. Project isolation — different projects can use different MCP servers without manual switching.
  3. Onboarding — new contributors get the right MCP servers automatically.
  4. Parity — consistent experience across VS Code and Copilot CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions