Direct mail API for developers and growth teams. Read the docs →

VS Code MCP: add a remote server for GitHub Copilot, with a direct mail API as the example

VS Code MCP servers give GitHub Copilot’s agent tools beyond your code, such as a direct mail API that prices, proofs and sends postcards. The setup moved recently: Copilot agent sessions now read servers from ~/.copilot/mcp-config.json or a .mcp.json at the workspace root, under mcpServers, and the older .vscode/mcp.json format is on its way out. Below: the files, adding a server from the UI or a link, signing in, approvals, which plans allow it, and where it doesn’t work yet.

On this page
  1. Where VS Code keeps MCP servers now
  2. Add an MCP server from the VS Code UI
  3. A one-click VS Code MCP install link
  4. Sign in to a remote MCP server from VS Code
  5. Approvals in Copilot agent sessions
  6. Copilot plans and the MCP policy
  7. The Copilot cloud agent: use the direct mail API with a key instead
  8. Example: a direct mail API from Copilot in VS Code
  9. VS Code MCP questions

Where VS Code keeps MCP servers now

Old · .vscode/mcp.json{ "servers": { "mailr": { "type": "http", "url": "https://mailr.dev/mcp"} } }Now · ~/.copilot/mcp-config.json or .mcp.json{ "mcpServers": { "mailr": { "type": "http", "url": "https://mailr.dev/mcp", "tools": ["*"] } } }
The file moved. Since VS Code 1.143, Copilot agent sessions read 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.

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

Manual permissionsThe default. You approve tool calls: Allow Once, or save it for the session or always.Assisted permissionsA model decides which calls need your review.Allow allSkips ordinary tool confirmations. Admins can remove this option.
Keep sends on Manual. In Copilot sessions a tool’s read-only hint doesn’t skip approval; the permission level and the approvals you’ve saved decide. Chat: Manage Tool Approval shows what you’ve allowed, server by server and tool by tool.

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.

START SENDING

Put your first postcard in the mail

Create a key, send a test to yourself, and check the proof before anything prints.

Start sending
  • Postcards, flats and folded mailers
  • A proof before anything prints
  • Free test mode: nothing prints, nothing charges
  • A status for every piece

Free price sheet

Get the price sheet by email

Every postcard, letter, mailer and print product on every plan, with postage included.

We’ll email you the price sheet. By continuing you agree to the Terms and Privacy Policy.

Download the template kit?

mailr-kit.zip · about 310 KB · 59 text files

Only HTML, JSON and Markdown files. No programs, scripts or macros, nothing that installs or runs.