# How to add MCP servers to GitHub Copilot in VS Code

> How to add MCP servers to GitHub Copilot in VS Code: workspace and user mcp.json, HTTP and stdio servers, MCP: Add Server and confirming tool calls.

Part 5 of [Using coding agents: Claude Code, Cursor, Codex and more](https://polylane.com/series/using-coding-agents/)
By Boris Tane, Founder of Polylane · Published October 17, 2026 · 3 min read
Canonical: https://polylane.com/learn/coding-agents/how-to-add-mcp-servers-to-github-copilot/

To add an MCP server to GitHub Copilot, run MCP: Add Server in VS Code from the Command Palette, or edit .vscode/mcp.json in your workspace and add an entry under servers. An HTTP server needs a type and url; a stdio server needs a command and args. Use Configure Tools in the Copilot chat input to turn its tools on or off.

To add an MCP server to GitHub Copilot, **run MCP: Add Server from VS Code's Command Palette, or add the server under `servers` in `.vscode/mcp.json`.** An HTTP server needs a `type` and a `url`; a local server needs the `command` that starts it. Then use **Configure Tools** in the Copilot chat input to choose which of its tools Copilot can use.

MCP, the Model Context Protocol, is how GitHub Copilot's chat and agent mode in VS Code call tools outside your editor. Copilot reads its servers from VS Code's MCP config. The steps below follow [VS Code's MCP documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers).

## 1. Pick workspace or user config

| File | Use it for |
| --- | --- |
| `.vscode/mcp.json` in the workspace | Servers for this project. Commit it so the team gets the same tools. |
| `mcp.json` in your user profile | Servers you want in every workspace. Open it with **MCP: Open User Configuration**. |

VS Code also reads a portable `.mcp.json` at the workspace root, which uses `mcpServers` in place of `servers`.

## 2. Add a server with the guided flow

Open the Command Palette and run **MCP: Add Server**. Choose **Command (stdio)** for a program VS Code starts on your machine, or **HTTP** for a remote server, then give it an ID and choose where to save it. The flow writes the same JSON you would write by hand.

## 3. Or write the JSON yourself

A remote server needs `type` and `url`; a local one needs `type`, `command` and `args`:

```json
{
  "servers": {
    "polylane": {
      "type": "http",
      "url": "https://mcp.polylane.com/mcp"
    },
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@playwright/mcp"]
    }
  }
}
```

Avoid hardcoding API keys in the file. VS Code supports input variables and environment files for secrets, so the version you commit holds a reference and the value stays on your machine.

## 4. Trust and confirmation

Workspace servers inherit Workspace Trust, so in a trusted workspace they start without a separate prompt. For servers that don't come from your trusted workspace, VS Code asks when a server first starts or its configuration changes. Decline and the server doesn't start; Copilot carries on without its tools.

You might be asked to confirm each tool invocation. Read the first few: it is the quickest way to learn what a server actually does.

## 5. Choose which tools Copilot can use

Select **Configure Tools** in the Copilot chat input to see every server's tools and turn them on or off. Fewer tools means less for the model to choose between, so turn off the ones a project doesn't need.

The first server in the example is Polylane's. [It lets GitHub Copilot debug production](/for/copilot/): logs, traces and deploys from every provider you connect, through one HTTP server.

Using GitHub Copilot? See [how to give GitHub Copilot production context with Polylane](https://polylane.com/for/copilot/).

## Common questions

**Where does GitHub Copilot read MCP servers from?**

From VS Code's MCP config: .vscode/mcp.json for the workspace, under a top-level servers object, and in the mcp.json of your user profile, which MCP: Open User Configuration opens.

**How do I add an MCP server without editing JSON?**

Run MCP: Add Server from the Command Palette. It walks you through choosing Command (stdio) or HTTP, a server ID and where to save it.

**How do I keep API keys out of mcp.json?**

Don't hardcode them. VS Code's docs recommend input variables or environment files, so the file you commit holds a reference and the secret stays on your machine.

**Will Copilot run MCP tools without asking?**

You might be asked to confirm each tool invocation. Configure Tools in the chat input shows each server's tools and lets you turn them on or off.

**Why didn't my MCP server start?**

For a server that doesn't come from your trusted workspace, VS Code asks the first time it starts or when its config changes. If you decline, it doesn't start and chat continues without its tools.

## Sources

- [Add and manage MCP servers in VS Code (VS Code docs)](https://code.visualstudio.com/docs/copilot/customization/mcp-servers)

## About the author

Boris Tane is the founder of Polylane. He previously founded Baselime, observability for the future of the cloud, which Cloudflare acquired. At Cloudflare he built and led the Workers observability team.

## More in this series

[Using coding agents: Claude Code, Cursor, Codex and more](https://polylane.com/series/using-coding-agents/)

1. [How to use Claude Code: a practical guide](https://polylane.com/learn/coding-agents/how-to-use-claude-code/)
2. [How to add MCP servers to Cursor](https://polylane.com/learn/coding-agents/how-to-add-mcp-servers-to-cursor/)
3. [How to use Codex CLI: install, AGENTS.md, MCP and exec](https://polylane.com/learn/coding-agents/how-to-use-codex-cli/)
4. [How to use OpenCode: install, plan and build, MCP](https://polylane.com/learn/coding-agents/how-to-use-opencode/)
5. [How to add MCP servers to GitHub Copilot in VS Code](https://polylane.com/learn/coding-agents/how-to-add-mcp-servers-to-github-copilot/)
6. [How to use the Pi coding agent](https://polylane.com/learn/coding-agents/how-to-use-the-pi-coding-agent/)

Previous: [How to use OpenCode: install, plan and build, MCP](https://polylane.com/learn/coding-agents/how-to-use-opencode/)
Next: [How to use the Pi coding agent](https://polylane.com/learn/coding-agents/how-to-use-the-pi-coding-agent/)

Get started with one command: `curl -fsSL https://polylane.com/setup | bash` installs the CLI, connects your coding agents, and creates the account.
