GitHub Copilot MCP Integration¶
Connect Copilot to external tools and data sources via the Model Context Protocol.
Where Copilot supports MCP servers¶
GitHub Copilot supports MCP servers across agent mode, the coding agent, and the CLI. MCP is a standard way to connect agents to external tools, databases, APIs, and services.
GitHub MCP server¶
GitHub maintains an official MCP server that gives Copilot Chat direct access to GitHub's APIs. In VS Code, you reach it remotely, with no local setup. You can enable or disable specific toolsets to control which GitHub API capabilities the agent sees.
Custom MCP servers¶
Add custom MCP servers for any external tool or service. Configure them in VS Code settings or in the CLI configuration. The MCP Registry lists the servers available.
Coding agent and MCP¶
The coding agent can use MCP tools from local and remote servers. It supports tools only, not resources or prompts.
VS Code MCP bridging (v1.113+)¶
VS Code 1.113 automatically bridges MCP servers registered in VS Code to Copilot CLI and Claude agent sessions running in the editor. Tools you configure in settings.json are then available to CLI and Claude agents, with no separate configuration.
MCP server autostart¶
Turning autostart off is not proven to be a containment control until you test each agent type. A local MCP server is code that runs on the developer's machine, so the questions are when it starts and which agents the toggle reaches.
JetBrains plugin 1.19.0 adds an MCP setting that disables automatic server startup. The changelog says it applies "for Copilot and Claude, giving you more control over when configured tools become active" (GitHub Changelog 2026-10-10). The plugin notes add that manual Start and Restart stay available (JetBrains Marketplace: GitHub Copilot versions). Neither source names the setting key or its Settings path, lists its values, or says whether it covers the Copilot CLI agent.
VS Code uses chat.mcp.autostart, which is experimental and takes three values: never, onlyNew, and newAndOutdated (the default). It does not cover Agent Host sessions: "setting chat.mcp.autostart to never doesn't prevent an Agent Host session from starting its configured MCP servers" (VS Code: Add and manage MCP servers).
| Surface | Control | Covers | Known gap |
|---|---|---|---|
| JetBrains | MCP setting, key unpublished | Copilot and Claude agents | CLI agent not mentioned in the sources |
| VS Code | chat.mcp.autostart |
The VS Code autostart pass | Agent Host sessions manage their own servers |
After you change the setting, start a session with each agent type you use and check whether the servers still launch.
CLI and MCP¶
Copilot CLI ships with the GitHub MCP server built in. You can add custom MCP servers through the interactive /mcp add command or the ~/.copilot/mcp-config.json file.
Example¶
The following VS Code settings.json snippet configures two MCP servers for Copilot agent mode: the built-in GitHub MCP server with a restricted toolset, and a custom Postgres server for direct database queries.
{
"github.copilot.chat.mcp.servers": [
{
"name": "github",
"type": "remote",
"url": "https://api.githubcopilot.com/mcp/",
"enabledToolsets": ["issues", "pull_requests", "code_search"]
},
{
"name": "postgres",
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "${env:DATABASE_URL}"
}
}
]
}
enabledToolsets on the GitHub server restricts which GitHub API capabilities the agent sees. Omitting the admin and repos toolsets limits the damage if the agent acts on an ambiguous instruction. The Postgres server runs as a local stdio process, so it exposes no network port, and it reads the connection string from the environment rather than hardcoding it.
Key Takeaways¶
- MCP is the standard protocol connecting Copilot to external tools across all surfaces
- GitHub's official MCP server provides GitHub API access out of the box
- Custom MCP servers extend Copilot to any external service
- The coding agent supports MCP tools (not resources or prompts)
- VS Code 1.113+ bridges registered MCP servers to CLI and Claude agent sessions automatically
- Disabling MCP autostart in JetBrains or VS Code does not prove that no server starts; test each agent type
When this backfires¶
- Tool sprawl inflates context and cost. Every registered MCP server exposes tool schemas into the agent's context window. Ten servers can add thousands of tokens per turn before the agent does anything useful, pushing common workflows toward larger models or context truncation.
- Each custom server is a new supply-chain surface. MCP servers launched with
npxor maintained by the community run with the agent's permissions and see whatever prompts you route through them. A compromised server package can exfiltrate secrets from environment variables (like thePOSTGRES_CONNECTION_STRINGabove) or inject instructions into tool output. - Remote MCP endpoints become availability dependencies. Agent sessions that rely on a remote MCP server inherit its uptime, rate limits, and auth expiry. An expired token or flaky provider surfaces as opaque agent failures rather than clear infrastructure errors.
- Built-in capabilities often suffice. For tasks covered by Copilot's native file, terminal, and GitHub tools, adding an MCP server duplicates capability without adding value. Use MCP when the data or action genuinely lives outside the agent's default surface.