Skip to content

Add support for repo-specific / folder-specific MCP configs #288

Closed

Description

@rishitank

Describe the feature or problem you'd like to solve

I want to be able to support sourcing the MCP configuration from multiple sources - ideally a global config and a project-specific config. The reason for this is that for some projects I need specific MCP servers e.g. neo4j memory MCP server, whereas for other projects it would not be applicable (or would have a different neo4j MCP server config for example).

Proposed solution

A simple solution would be to provide a repeatable --mcp-config flag that would be able to source a MCP config from multiple places and internally you could concatenate the MCP configuration. This could also work by having the global MCP config in your ~/.copilot directory being loaded automatically, with support for additional source of MCP configurations.

Example prompts or workflows

When starting a new session I would say:
Read your neo4j memory to understand the structure, patterns, rules and features of this codebase, all the previous work that has been implemented so far and all the learnings that have come from it.

Additional context

No response

Activity

  1. kvenkatrajan commented on Oct 13, 2025

    @kvenkatrajan

    +1 - This would also help open up creating subagents (with specific mcp tools) to operate on specific directories of a repo. Currently we are limited to the set of tools for a given global configuration.

    @RyanHecht @skylar-anderson

  2. ellismg commented on Oct 16, 2025

    @ellismg
    Contributor

    I merged in a change to the CLI to add --additional-mcp-config, which allows you to pass either a JSON document or a path to a JSON file.

    The --additional-mcp-config flag that allows you to temporarily add or override MCP server configurations for a single CLI session without modifying your ~/.copilot/mcp-config.json file.

    You can pass MCP server configuration in two ways:

    1. Inline JSON:
    copilot --additional-mcp-config '{"mcpServers": {"my-tool": {...}}}'
    
    1. From a file (prefix with @):
    copilot --additional-mcp-config @/path/to/config.json
    

    You can also pass the flag multiple times (later values override earlier ones):

    copilot --additional-mcp-config @base.json --additional-mcp-config @overrides.json
    

    This should ship in today's release of the CLI (and should be there now if you install the @prerelease tagg). You'll see the new flag in --help.

  3. kvenkatrajan commented on Oct 16, 2025

    @kvenkatrajan

    great thank you!

  4. roperi commented on Feb 1, 2026

    @roperi

    additional-mcp-config

    @ellismg Excuse my ignorance as I might be missing something but shouldn't have been easier just to add a mcp-config.json file in your repo my-cool-repo/.github/ folder (or subfolder) to override the global ~/.copilot/mcp-config.json?

  5. felipeplets commented on Feb 5, 2026

    @felipeplets

    Currently I have 2 MCP files .mcp.json that works with Claude Code and .vscode/mcp.json that works with VS Code / GitHub Copilot Chat.

    Even though I got copilot --additional-mcp-config @.mcp.json to work, and have compatibility between claude code and Copilot CLI it would be great to use either of these files by default or at least to have way to use ~/.copilot/config to set the MCP project file by default.

    In a large team these small quirks prevent adoption.

  6. hstaudacher commented on Feb 16, 2026

    @hstaudacher
    Collaborator
  7. Anselmoo commented on Mar 4, 2026

    @Anselmoo

    @ellismg I have observed that copilot --additional-mcp-config @/path/to/config.json is unable to overwrite the same MCP if it has already been specified in the global settings.

    Because this creates a slight obstacle to having local development repos of MCPS for debugging, while the production MCPS can already operatetting files; that might be also the point of #1291

  8. amirasyraf commented on Mar 14, 2026

    @amirasyraf

    additional-mcp-config

    @ellismg Excuse my ignorance as I might be missing something but shouldn't have been easier just to add a mcp-config.json file in your repo my-cool-repo/.github/ folder (or subfolder) to override the global ~/.copilot/mcp-config.json?

    Excatly. All other AI agent harnesses out there use the sane default of local config overriding the global config. With OpenCode, Claude and pretty much most other tool out there follows this convention

  9. added
    area:configurationConfig files, instruction files, settings, and environment variables
    on Apr 6, 2026
  10. added
    area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registry
    on Apr 6, 2026
  11. examon commented on Apr 6, 2026

    @examon

    This was addressed in v0.0.343, which added the --additional-mcp-config flag for per-session MCP config overrides and explicitly marked this issue as fixed. Workspace-local config sources such as .mcp.json and .vscode/mcp.json are also now automatically loaded and merged with the global config. If you believe this isn't fully resolved, feel free to reopen.

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

    area:configurationConfig files, instruction files, settings, and environment variablesarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registry

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions