PlugWiki
GitHub Copilot CLI logo

How to add an MCP server to GitHub Copilot CLI

Add MCP servers to GitHub Copilot CLI with copilot mcp add, /mcp add or ~/.copilot/mcp-config.json, or share them with a repo in .github/mcp.json.

Local servers
Yes
runs stdio servers
Hosted servers
Yes
connects by URL
Config
JSON
how servers are added
Picks
7
ranked

Run copilot mcp add <name> -- <command> for a local server or copilot mcp add --transport http <name> <url> for a hosted one. Copilot CLI saves it to ~/.copilot/mcp-config.json, and a repository can carry its own servers in .github/mcp.json or .mcp.json. The GitHub MCP server is already built in. You need an active Copilot subscription, and an organization can limit which servers run.

Good for

  • Developers with a Copilot subscription who work in the terminal
  • Teams that commit shared servers to .github/mcp.json
  • Organizations that control servers with a registry and allowlist
  • People running copilot -p in scripts who need servers to load

Install GitHub Copilot CLI

Copilot CLI

  1. 1

    Copy this prompt.

    Add the GitHub Copilot CLI MCP server to Copilot CLI. Run this command:
    
    npm install -g @github/copilot
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Copilot CLI. It shows the change and asks before running it.

Requires Active Copilot subscription.

Run copilot and use /login to sign in with GitHub. The GitHub MCP server is already built in, so you only add other servers.

From the vendor's docs. Source.

At a glance

Add an MCP server to GitHub Copilot CLI

  1. 1

    Add a local server with copilot mcp add

    Put the launch command after --. Pass keys with --env.

    copilot mcp add context7 -- npx -y @upstash/context7-mcp
    copilot mcp add github --env GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server

    Uses Context7

  2. 2

    Or add a hosted server by URL

    copilot mcp add --transport http notion https://mcp.notion.com/mcp
    copilot mcp add --transport http --header "Authorization: Bearer YOUR-TOKEN" stripe https://mcp.stripe.com

    Use --transport sse for the older SSE type.

  3. 3

    Or use the form inside a session

    Start copilot, type /mcp add, fill in the name, server type and command or URL, then press Ctrl+S. The server is available at once, with no restart.

  4. 4

    Or edit mcp-config.json by hand

    Open ~/.copilot/mcp-config.json:

    {
      "mcpServers": {
        "playwright": { "type": "local", "command": "npx", "args": ["@playwright/mcp@latest"], "env": {}, "tools": ["*"] },
        "context7": { "type": "http", "url": "https://mcp.context7.com/mcp", "headers": { "CONTEXT7_API_KEY": "YOUR-API-KEY" }, "tools": ["*"] }
      }
    }
  5. 5

    Share servers with a repository

    Put the same JSON in .github/mcp.json (committed and shared) or .mcp.json (per checkout). Copilot CLI loads these only after you trust the folder. .vscode/mcp.json is not read.

  6. 6

    Check it loaded

    Run copilot mcp list in your shell, or /mcp inside a session. copilot mcp get <name> shows its status and tools.

  7. 7

    Sign in, disable or remove

    For a server that needs OAuth, run /mcp auth <name>. Run copilot mcp disable <name> to keep it configured but unused, and copilot mcp remove <name> to delete it.

Best MCP servers for GitHub Copilot CLI

MCP servers that work in GitHub Copilot CLI

40 · official first, then servers with a page, then by stars

Show all 40

Common errors and fixes

  • Servers in .mcp.json or .github/mcp.json do not load

    Cause: Project-level servers are skipped silently in folders you have not trusted.

    Fix: Start copilot in the folder and confirm trust, or add the server with copilot mcp add.

    copilot-cli Source

  • Project servers missing in copilot -p runs

    Cause: Prompt mode cannot ask for trust, so it skips project servers in untrusted folders.

    Fix: Trust the folder first, pass --trust-folder, or set GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP=true.

    copilot-cli Source

  • Servers from .vscode/mcp.json are ignored

    Cause: Copilot CLI does not read that file; VS Code uses the key servers.

    Fix: Move the entries to .github/mcp.json under mcpServers.

    copilot-cli Source

  • Remote server shows needs-auth

    Cause: The OAuth token expired, or the server needs a different account.

    Fix: Run /mcp auth <server-name> and sign in again.

    copilot-cli Source

  • /mcp edit or /mcp delete refuses a server

    Cause: The server comes from a repository .mcp.json, not your user file.

    Fix: Edit the file named in the error message.

    copilot-cli Source

  • A server is blocked or missing

    Cause: Your organization set a registry URL and allowlist policy.

    Fix: Ask an administrator to allow the server, or use one on the allowlist.

    copilot-cli Source

  • Connector cannot be connected

    Cause: Copilot connectors are in public preview and your organization may not allow them.

    Fix: Ask an administrator to update the Copilot policy for connectors.

    copilot-cli Source

  • A slow server warns it is taking too long to connect

    Cause: The server takes more than 10 seconds to connect.

    Fix: Raise slowConnectionThresholdMs to quiet the warning; timeout sets the real limit.

    copilot-cli Source

Verdict

Copilot CLI gives you three ways to add a server (command, in-session form or JSON), shared repo configs, and the GitHub MCP server built in. The main limit is that it needs a Copilot subscription, and an organization allowlist can block servers you add.

Copilot CLI gives you three ways to add a server (command, in-session form or JSON), shared repo configs, and the GitHub MCP server built in. The main limit is that it needs a Copilot subscription, and an organization allowlist can block servers you add.

Best for

  • Developers who already pay for GitHub Copilot
  • Teams that share servers by committing .github/mcp.json

Skip it if

  • You want to reuse a VS Code mcp.json without changes
  • Your organization restricts MCP servers and you cannot change the policy

Questions

How do I add an MCP server to GitHub Copilot CLI?

Run copilot mcp add <name> -- <command> for a local server, or copilot mcp add --transport http <name> <url> for a hosted one. You can also type /mcp add inside a session.

Where is the Copilot CLI MCP config file?

~/.copilot/mcp-config.json, under the mcpServers key. Set COPILOT_HOME to move the folder. A repository can add .github/mcp.json or .mcp.json.

Does Copilot CLI support remote HTTP MCP servers?

Yes. Use type "http" (streamable HTTP) or "sse" with a url, or copilot mcp add --transport http <name> <url>.

Does Copilot CLI support OAuth for MCP servers?

Yes, for remote servers. Run /mcp auth <server-name> to sign in or switch accounts. For CI with no browser, set oauthGrantType to "client_credentials".

Is the GitHub MCP server already in Copilot CLI?

Yes. It is built in and works without setup. Pass --disable-builtin-mcps to turn it off.

Project or global MCP servers in Copilot CLI?

copilot mcp add writes to your user file, ~/.copilot/mcp-config.json. Project servers go in .github/mcp.json or .mcp.json, and they win over user servers with the same name.

How do I disable an MCP server in Copilot CLI?

Run copilot mcp disable <name> or /mcp disable <name>. It stays configured and the setting persists. Use --disable-mcp-server <name> to skip one for a single run.

Can I reuse my VS Code mcp.json in Copilot CLI?

Not as it is. Copilot CLI does not read .vscode/mcp.json, because VS Code uses the top-level key servers. Copy the entries under mcpServers in .github/mcp.json instead.

Is Copilot CLI free to use with MCP servers?

You need an active Copilot subscription. Each prompt also counts against your monthly premium requests.

Why are my project MCP servers not loading in Copilot CLI?

Project servers load only in trusted folders and are skipped silently otherwise. In copilot -p runs, set GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP=true or pass --trust-folder.

Information

updated Nov 2, 2026

Transports
stdio, SSE, Streamable HTTP
Config file (all)
~/.copilot/mcp-config.json
MCP docs
github.com

WebsiteDocs

Sources

Docs, issue trackers and discussions this page is built from.

Show all 3
  1. GitHub Copilot CLI README · github.com
  2. Adding MCP servers for GitHub Copilot CLI · docs.github.com
  3. GitHub Copilot CLI command reference · docs.github.com

Updated Nov 2, 2026.