MCP Servers: Connect Your Tools to Copilot
- Explain what MCP servers add to Copilot Agent mode and where MCP tools can be used
- Configure a workspace-level MCP server in .vscode/mcp.json and a project-level server in .github/mcp.json
- Identify use cases where MCP integration meaningfully improves agent mode accuracy
What MCP Gives Agent Mode
Model Context Protocol (MCP) is an open standard for connecting AI models to external tools. When you configure an MCP server for Copilot, you are giving the agent the ability to call functions beyond editing files and running terminal commands — it can query your database, call your internal APIs, search your documentation, or interact with any service that has an MCP server.
Agent mode is the Chat mode that uses MCP tools. Ask mode and Edit mode do not invoke MCP tools. When an MCP server is configured and you are in Agent mode, the agent automatically discovers the tools that server exposes and can choose to call them as part of completing your task.
The Built-In GitHub MCP Server
GitHub provides an official MCP server that gives Copilot access to GitHub.com operations: reading issues and PRs, searching code, creating issues, fetching file contents from repos, and more. This is the most widely used MCP server with Copilot, and as of July 2026 it is enabled by default for code review.
In VS Code, the GitHub MCP server can be enabled from Settings → GitHub Copilot → MCP. Once enabled, Agent mode can answer questions like "What are the open issues labelled bug in this repo?" by actually querying GitHub — not by guessing from the chat context.
Configuring MCP Servers in VS Code
Per-workspace configuration — Create a .vscode/mcp.json file at the repository root. This configuration is shared with everyone who opens the project in VS Code:
{
"servers": {
"my-database": {
"command": "node",
"args": ["./tools/db-mcp-server.js"],
"env": {
"DB_URL": "${env:DATABASE_URL}"
}
}
}
}
Per-user configuration — Open VS Code Settings and add MCP server entries under github.copilot.chat.mcp.servers. User-level servers are available across all your projects.
Configuring MCP Servers for Copilot CLI
The Copilot CLI uses a different config location. User-level servers go in ~/.copilot/mcp-config.json. Project-level servers can go in .mcp.json at the repo root, or in .github/mcp.json (the latter is safe to commit). The .github/mcp.json location is recommended for project servers you want to share with the team.
What Makes a Good MCP Server Use Case
Security Considerations
MCP tools run with whatever permissions the server process has. For code review, Copilot restricts all MCP tool calls to read-only operations. For agent mode in your IDE, you have full control over what the server exposes. Follow the principle of least privilege: only expose the operations the agent actually needs. Use environment variables for credentials — never hardcode tokens in the MCP config files you commit to your repo.
Try This
Enable the built-in GitHub MCP server in your VS Code Copilot settings. Then open Agent mode and ask: "What are the open issues in this repository that mention performance?" Watch the agent query GitHub directly through the MCP tool rather than relying on whatever context happened to be in its window. This is the simplest hands-on demonstration of what MCP adds to agent mode.
- MCP tools are only available in Agent mode — Ask and Edit mode do not invoke MCP server tools
- Per-workspace VS Code MCP config goes in .vscode/mcp.json; Copilot CLI project config goes in .github/mcp.json (safe to commit)
- Copilot code review restricts all MCP tool calls to read-only operations; agent mode has no such restriction by default