# How do you use MCP servers with Copilot agent mode in VS Code?

Source: https://codelifter.com/forum/posts/how-do-you-use-mcp-servers-with-copilot-agent-mode-in-vs-code/
Site: CodeLifter Forum, category MCP and tools
Published: 2026-12-04. Updated: 2026-12-04. Replies: 1.

## Question by CodeLifter editors (staff), 2026-12-04

To use an MCP server with Copilot in VS Code, select the Copilot harness in chat, run **Chat: Open Customizations**, open **MCP Servers** and choose **Add Server**. Give it a URL for a remote server or a launch command for a local one, save it globally or in a workspace `.mcp.json`, then ask for a task and check that a tool call ran.

Checked on 12 November 2026. VS Code's agent features change monthly, and this answer follows the docs as they read today.

## What changed from the old `.vscode/mcp.json` setup?

If you followed a tutorial from 2025, you probably wrote a `.vscode/mcp.json` file with a top-level `servers` object. VS Code's [MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration.md) now says that for new Copilot configurations you should use the native destinations, "not `.vscode/mcp.json` or profile `mcp.json`", because those files belong to the deprecated Local harness. The [add-a-server page](https://code.visualstudio.com/docs/agent-customization/mcp-servers) adds that the Local harness "will be removed in February 2027."

Old files still work for now: eligible definitions can be forwarded to Copilot sessions. But forwarding rejects any entry that uses `${input:...}` prompts, so servers that ask for an API key at start-up are the ones most likely to break.

| | New Copilot format | Old editor format |
| --- | --- | --- |
| Top-level key | `mcpServers` | `servers` |
| Personal file | `~/.copilot/mcp-config.json` | profile `mcp.json` |
| Shared file | `.mcp.json` at the workspace root | `.vscode/mcp.json` |
| Secrets | `${NAME}` environment references | `${input:...}` prompts, `envFile` |

## How do you add a server step by step?

From the [VS Code guide](https://code.visualstudio.com/docs/agent-customization/mcp-servers):

1. Open a local project folder and select **Copilot** in the **Session Target** dropdown.
2. Run **Chat: Open Customizations** from the Command Palette, select **MCP Servers**, then **Add Server** (**+**).
3. Choose **HTTP** for a remote server and paste the endpoint, or **Command (stdio)** for a local process and paste the launch command.
4. Give it a unique ID such as `playwright`. The reference recommends camelCase for multi-word names and no spaces.
5. Pick a destination: **Global** > **Copilot Global** for yourself, or the workspace `.mcp.json` to share it with the team.
6. Accept the trust prompt only after reading the command or URL.

![Six steps to add an MCP server for GitHub Copilot in VS Code, ending with the trust prompt](/forum/img/posts/add-an-mcp-server-to-copilot-in-vs-code-steps.webp "Adding an MCP server for Copilot in VS Code, in the six steps this article gives")

**MCP: Add Server** in the Command Palette starts the same flow.

## What does the config file look like?

You can skip the form and write the file yourself. This workspace `.mcp.json` adds one local and one remote server, following the reference's examples:

```json
{
  "mcpServers": {
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"],
      "tools": ["*"]
    },
    "docs": {
      "type": "http",
      "url": "https://learn.microsoft.com/api/mcp",
      "tools": ["*"]
    }
  }
}
```

`type` is `stdio` for a command, `http` for Streamable HTTP or `sse` for an older endpoint, and the reference says to "Prefer HTTP when the server supports it." `tools` lists which tools the agent may see: `["*"]` means all of them, and naming specific tools narrows the set. The docs stress that this "doesn't bypass tool approvals". For keys, use `${NAME}` references to environment variables, not literal values, because the file is shared and "A personal configuration file is not a secret store."

## How do you know Copilot is really using it?

Ask for a low-impact task that needs the server and say which server to use. The guide's own example asks the Microsoft Learn server for documentation and adds "Do not change files." Then expand the tool call in the conversation. The guide is blunt about this: "A plausible answer without a tool call doesn't verify the connection."

If nothing happens, the [manage and troubleshoot page](https://code.visualstudio.com/docs/agents/run/manage-mcp-servers.md) gives a symptom table. The common ones:

- **Server missing:** wrong harness, wrong file, or `servers` used where `mcpServers` is expected.
- **stdio server fails to start:** the command or runtime is not on the `PATH` where the harness runs, which matters in remote and container sessions.
- **Docker server exits:** remove `-d`; the client needs the stdio connection in the foreground.
- **Server runs but tools never get called:** check that it is enabled and that the tools are selected.

**Show Output** from the server's menu opens its log.

## What should you check before trusting a server?

The guide warns that "Local MCP servers can run code on your machine, and tools can access services using your permissions." Workspace `.mcp.json` files inherit Workspace Trust: in a trusted folder they start "without a separate MCP trust prompt, including after configuration changes", so read the file before trusting a cloned repository. The same page separates four controls that are easy to confuse: trust (can it start), authentication (can it reach the service), tool selection (what the agent sees) and approvals (each action). Our thread on [hosts, clients and servers](/forum/posts/what-are-the-parts-of-an-mcp-setup-host-client-and-server/) explains where each sits, and the [MCP server directory](https://codelifter.com/mcp/) lists what common servers can reach. If you also use Cursor, the [Cursor MCP thread](/forum/posts/how-do-you-add-an-mcp-server-in-cursor/) covers its `mcp.json`.

## Short version

- Add servers through **Chat: Open Customizations** > **MCP Servers** with the Copilot harness selected.
- New configs use `mcpServers` in `~/.copilot/mcp-config.json` or a workspace-root `.mcp.json`; `.vscode/mcp.json` is the deprecated format.
- Prefer HTTP where offered, keep secrets in `${NAME}` environment references, and narrow `tools` where you can.
- Verify by expanding a real tool call, not by reading a plausible answer.

## Reply 1 by CodeLifter editors (staff), 2026-12-04

**Can I share one MCP setup between VS Code and Copilot CLI?** Yes, if you use the native personal file. The [VS Code guide](https://code.visualstudio.com/docs/agent-customization/mcp-servers) says choosing **Global** > **Copilot Global** creates a personal configuration "shared across your workspaces and compatible Copilot experiences on the same host, including Copilot CLI." The [configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration.md) gives the path: `$COPILOT_HOME/mcp-config.json`, or `~/.copilot/mcp-config.json` when `COPILOT_HOME` is not set.

Two limits catch people. First, it is per machine: the guide says Copilot Global "doesn't synchronize configuration across machines or guarantee shared authentication credentials." Settings Sync only covers the old user-profile `mcp.json`, according to the [manage page](https://code.visualstudio.com/docs/agents/run/manage-mcp-servers.md). Second, in a remote or Dev Container session the user file that counts is the one on the host where the harness runs, not on your laptop.

For a team, the workspace `.mcp.json` committed to the repository is the portable option, with each person supplying their own credentials through environment variables. If you use other tools too, the reference lists discovery sources VS Code can read, including Claude Desktop and Cursor configs, though only Copilot CLI discovery is on by default.

---
Cite as: CodeLifter Forum, "How do you use MCP servers with Copilot agent mode in VS Code?", https://codelifter.com/forum/posts/how-do-you-use-mcp-servers-with-copilot-agent-mode-in-vs-code/, accessed 2026-12-05.
