How do you use MCP servers with Copilot agent mode in VS Code?
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.
Cite
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.- CodeLifter editorsStaffStaff, CodeLifter ·
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.jsonsetup?If you followed a tutorial from 2025, you probably wrote a
.vscode/mcp.jsonfile with a top-levelserversobject. VS Code's MCP configuration reference now says that for new Copilot configurations you should use the native destinations, "not.vscode/mcp.jsonor profilemcp.json", because those files belong to the deprecated Local harness. The add-a-server page 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 mcpServersserversPersonal file ~/.copilot/mcp-config.jsonprofile mcp.jsonShared file .mcp.jsonat the workspace root.vscode/mcp.jsonSecrets ${NAME}environment references${input:...}prompts,envFileHow do you add a server step by step?
From the VS Code guide:
- Open a local project folder and select Copilot in the Session Target dropdown.
- Run Chat: Open Customizations from the Command Palette, select MCP Servers, then Add Server (+).
- Choose HTTP for a remote server and paste the endpoint, or Command (stdio) for a local process and paste the launch command.
- Give it a unique ID such as
playwright. The reference recommends camelCase for multi-word names and no spaces. - Pick a destination: Global > Copilot Global for yourself, or the workspace
.mcp.jsonto share it with the team. - Accept the trust prompt only after reading the command or URL.

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.jsonadds one local and one remote server, following the reference's examples:{ "mcpServers": { "playwright": { "type": "stdio", "command": "npx", "args": ["-y", "@playwright/mcp@latest"], "tools": ["*"] }, "docs": { "type": "http", "url": "https://learn.microsoft.com/api/mcp", "tools": ["*"] } } }typeisstdiofor a command,httpfor Streamable HTTP orssefor an older endpoint, and the reference says to "Prefer HTTP when the server supports it."toolslists 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 gives a symptom table. The common ones:
- Server missing: wrong harness, wrong file, or
serversused wheremcpServersis expected. - stdio server fails to start: the command or runtime is not on the
PATHwhere 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.jsonfiles 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 explains where each sits, and the MCP server directory lists what common servers can reach. If you also use Cursor, the Cursor MCP thread covers itsmcp.json.Short version
- Add servers through Chat: Open Customizations > MCP Servers with the Copilot harness selected.
- New configs use
mcpServersin~/.copilot/mcp-config.jsonor a workspace-root.mcp.json;.vscode/mcp.jsonis the deprecated format. - Prefer HTTP where offered, keep secrets in
${NAME}environment references, and narrowtoolswhere you can. - Verify by expanding a real tool call, not by reading a plausible answer.
Write something first.
Give people something to work with: at least 30 words on what happened and what you tried.
That is too long. Keep it under 6,000 characters.
Write the question as the title, 15 to 140 characters, no links.
Pick a category.
Add a name (2 to 40 characters, no links).
That email address does not look right.
That was quick. Read the thread, then try again.
The form expired. Reload the page and post again.
Something went wrong with the form. Reload and try again.
Please complete the check and post again.
Limit reached for now. Try again later.
This thread is closed to new replies.
This thread no longer accepts replies.
Something went wrong with the form. Reload and try again.
Post a reply or question first (name and email), then this browser can vote, edit and accept answers.
You cannot vote on your own post.
Only the author (within 30 days) or the forum team can do that.
That email already has an account. Use your sign-in link instead.
New accounts are paused for the moment. Try again later.
That was already posted.
1 answer
- CodeLifter editorsStaffStaff, CodeLifter ·
Can I share one MCP setup between VS Code and Copilot CLI? Yes, if you use the native personal file. The VS Code guide 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 gives the path:
$COPILOT_HOME/mcp-config.json, or~/.copilot/mcp-config.jsonwhenCOPILOT_HOMEis 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. 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.jsoncommitted 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.