On this page
- Where VS Code keeps MCP servers now
- Add an MCP server from the VS Code UI
- A one-click VS Code MCP install link
- Sign in to a remote MCP server from VS Code
- Approvals in Copilot agent sessions
- Copilot plans and the MCP policy
- The Copilot cloud agent: use the direct mail API with a key instead
- Example: a direct mail API from Copilot in VS Code
- VS Code MCP questions
Where VS Code keeps MCP servers now
mcpServers from ~/.copilot/mcp-config.json or a .mcp.json at the workspace root. The older .vscode/mcp.json with servers belongs to the Local harness, deprecated in 1.146 and due to be removed in February 2027.Since VS Code 1.143, agent sessions run on what VS Code calls the Copilot harness, and it reads servers from two places: ~/.copilot/mcp-config.json for servers you want everywhere (the Copilot CLI reads the same file), and .mcp.json at the workspace root for one project. The older Local harness, with its .vscode/mcp.json and top-level servers key, was deprecated in 1.146 and is due to go in February 2027. Plenty of guides, including some of GitHub’s own pages, still show the old file.
{
"mcpServers": {
"mailr": {
"type": "http",
"url": "https://mailr.dev/mcp",
"tools": ["*"]
}
}
}A remote server needs a type of http (streamable HTTP; sse is the legacy option) and its url, plus headers if it takes a fixed key.
Add an MCP server from the VS Code UI
- From chat: run Chat: Open Customizations, open MCP Servers, choose Add Server, pick HTTP, paste the URL and give it an id, then choose where it’s saved.
- From the Command Palette: MCP: Add Server starts the same guided flow.
- Installed servers show up in the Extensions view under MCP Servers, Installed.
A one-click VS Code MCP install link
VS Code also installs servers from a link: the server’s entry, with its name, as JSON, stringified and URL-encoded. For Mailr:
vscode:mcp/install?%7B%22name%22%3A%22mailr%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmailr.dev%2Fmcp%22%7D
# It's this JSON, stringified and URL-encoded:
# {"name":"mailr","type":"http","url":"https://mailr.dev/mcp"}
# VS Code shows the server's details for review before it installs anything.Sign in to a remote MCP server from VS Code
When a server needs sign-in, Copilot asks for it through VS Code, which keeps the credentials; if it’s needed later, an Authenticate action appears in the server’s menu. For Mailr, that’s Sign in with Mailr: you pick the account and allow it, and the connection gets its own access, never your API keys. If you’re building a server, VS Code registers itself with Dynamic Client Registration, or takes a pre-registered client id, and signs in through http://127.0.0.1:33418 and https://vscode.dev/redirect; more in building a remote MCP server.
Approvals in Copilot agent sessions
Copilot sessions start on Manual permissions: you approve tool calls with Allow Once, or save an approval for the session or always. Chat: Manage Tool Approval lists what you’ve allowed for each server and tool. The global auto-approve setting turns off what VS Code calls critical security protections, so leave it off. For a server that can send mail or spend money, save approvals only for the tools that read, and let sending ask every time.
Copilot plans and the MCP policy
MCP is part of every Copilot plan, Free through Enterprise. On Business and Enterprise, the organization policy MCP servers in Copilot decides whether members can use servers at all; the policy is off by default, and since late October 2026 an unset policy takes the enterprise’s default for new features. Admins can also limit members to an approved list of servers. On Free, Pro, Pro+ and Max, nothing gates it.
The Copilot cloud agent: use the direct mail API with a key instead
The Copilot cloud agent on github.com can use remote MCP servers set up in a repository’s settings, but not ones that sign in with OAuth, and it calls tools without asking. Mailr’s server only accepts Sign in with Mailr, so it works in VS Code but not there. To have Copilot build mail into your app instead, so your own code calls the direct mail API on an event, give it the API reference and a key from your environment; the Claude Code, Codex and Cursor pages show that pattern.
Example: a direct mail API from Copilot in VS Code
- “What would 1,000 6x9 postcards cost?” Answered from your Mailr plan.
- “Prepare the thank-you card for the customers in this CSV.” A draft with the total and a proof link; nothing sent.
- “Send it as a test, then live.” Test mail is free and never prints. The live send asks, and Mailr sends only the exact draft and total you approved.
The same server works in Claude Code, Cursor, Codex, ChatGPT, Claude and Gemini.
VS Code MCP questions
Where is the MCP config file in VS Code?
For Copilot agent sessions, ~/.copilot/mcp-config.json for your own servers, or .mcp.json at the root of the workspace, both with a top-level mcpServers object. The older .vscode/mcp.json with servers belongs to the deprecated Local harness.
How do I add an MCP server to GitHub Copilot in VS Code?
Run Chat: Open Customizations, open MCP Servers, choose Add Server, pick HTTP, paste the URL and give it an id. Or run MCP: Add Server from the Command Palette, or open the server's install link.
Which Copilot plans include MCP?
All of them, from Free to Enterprise. On Business and Enterprise, an organization policy called MCP servers in Copilot decides whether members can use them.
Does Copilot ask before running an MCP tool?
With the default Manual permissions, you approve tool calls, and can save an approval for the session or always. A tool's read-only hint doesn't skip approval in Copilot sessions.
Can the Copilot cloud agent on github.com use Mailr's server?
No. The cloud agent can use remote MCP servers set up in repository settings, but not ones that sign in with OAuth, and Mailr's server only accepts OAuth sign-in. For mail from code in that repo, call the REST API with a key.