# VS Code MCP: add a remote MCP server for GitHub Copilot

> Add a remote MCP server to VS Code for Copilot agent mode: MCP: Add Server, the two config formats, sign-in, Configure Tools and fixes.

Source: https://datatomcp.com/guides/vscode-mcp · By Killian · Updated 2026-10-27

To add a remote MCP server to VS Code for GitHub Copilot, open the Command Palette, run **MCP: Add Server**, choose **HTTP**, paste the server URL and give it an ID. Then choose where to save it (**Global → Copilot Global** for yourself, or the workspace for your team) and complete the sign-in prompt when the server starts. Copilot's agent can then call the server's tools. This guide covers both config formats, sign-in, how to check the tools loaded, and the errors you'll see most.

The example server is datatomcp, which lets Copilot query your CSVs and Google Sheets.

## 1. Add the server

1. Open the Command Palette (**Ctrl+Shift+P**, or **Cmd+Shift+P** on macOS) and run **MCP: Add Server**. The same flow opens from **Chat: Open Customizations → MCP Servers → Add Server**.
2. Choose **HTTP (HTTP or Server-Sent Events)**.
3. Paste the URL: `https://app.datatomcp.com/mcp`.
4. Enter an ID, for example `datatomcp`.
5. Choose the destination. For a personal server pick **Global**, then **Copilot Global**.

VS Code tries Streamable HTTP first and falls back to SSE, so you don't need to know which one the server uses.

## Where the config lives

VS Code reads two formats. They look alike but use different top-level keys, so don't copy between them without changing it.

**Portable format** (`mcpServers`), used by Copilot Global at `~/.copilot/mcp-config.json` (or `$COPILOT_HOME/mcp-config.json`), and by a workspace-root `.mcp.json` when the experimental `chat.mcp.workspaceRootConfig.enabled` setting is on:

```json
{
  "mcpServers": {
    "datatomcp": { "type": "http", "url": "https://app.datatomcp.com/mcp" }
  }
}
```

**VS Code format** (`servers`), in `.vscode/mcp.json` or your user profile's `mcp.json`. The guided flow labels these older locations deprecated, but they still work for local agent sessions and they support input variables for secrets:

```json
{
  "servers": {
    "datatomcp": { "type": "http", "url": "https://app.datatomcp.com/mcp" }
  }
}
```

## 2. Sign in

The first time the server starts, VS Code shows a trust prompt, then the server's sign-in if it uses OAuth. For datatomcp a browser window opens; sign in with your datatomcp account and approve read access to your datasets. Trust, sign-in and approving individual tool calls are three separate steps in VS Code, so expect more than one prompt the first time.

### Servers that use an API key

In the VS Code format, prompt for the key once with an input variable and VS Code stores it securely:

```json
{
  "inputs": [
    { "type": "promptString", "id": "api-token", "description": "API token", "password": true }
  ],
  "servers": {
    "my-api": {
      "type": "http",
      "url": "https://api.example.com/mcp",
      "headers": { "Authorization": "Bearer ${input:api-token}" }
    }
  }
}
```

Portable files don't support input variables; reference an environment variable such as `${API_TOKEN}` instead. Never paste a literal token into a file you commit.

If a server requires a pre-registered OAuth app, the VS Code format accepts an `oauth` object with a `clientId`.

## 3. Check the tools loaded

- Open Copilot Chat in agent mode and click **Configure Tools** in the chat input. The server should appear with its tools ticked. In a Copilot session the list is under **Chat: Open Customizations → Tools**.
- Ask: "Use datatomcp to list my datasets." A working server shows a tool call, returns output without a connection error, and the answer reflects that output.
- To see what the server said, run **MCP: List Servers**, select it and choose **Show Output**.

## Troubleshooting

- **Server missing after you added it.** Check which destination you saved to and that it matches the session type and workspace you are in. Servers that need input variables are not passed to Copilot harness sessions.
- **Server won't start in a cloned repo.** Workspace servers follow Workspace Trust. Restricted mode blocks them until you trust the folder. **MCP: Reset Trust** clears earlier MCP trust decisions.
- **HTTP server won't connect or authenticate.** Check the URL and your network, then run **Restart Server** from **MCP: List Servers**.
- **Blocked by policy.** Organizations can restrict MCP servers with an enterprise allowlist, and local settings can't override it. Ask your admin.
- **Tool available but never called.** Name the server in the prompt and check it's ticked in **Configure Tools**. VS Code's chat debug view shows why a tool wasn't invoked.

## A data server for Copilot

Copilot works on the code in front of it. Data that lives in a spreadsheet (a pricing table, a feature flag list kept by product, a CSV export to test against) is easier to query than to paste. With datatomcp, Copilot gets five read-only tools: `list_datasets`, `describe_dataset`, `query_rows`, `aggregate` and `distinct_values`. It can ask "how many customers are on each plan" and get the counts from a database instead of reading thousands of rows.

[Create a free account](https://app.datatomcp.com/login), add a CSV or Google Sheet under **Add data**, and run **MCP: Add Server** with the URL above. For CSV specifics see the [CSV MCP server guide](/guides/csv-mcp-server).

## FAQ

**Where is the VS Code MCP config file?** `~/.copilot/mcp-config.json` for Copilot Global, `.mcp.json` at the workspace root (experimental setting), or the older `.vscode/mcp.json` and user-profile `mcp.json`.

**What's the difference between `servers` and `mcpServers`?** `servers` is the VS Code format; `mcpServers` is the portable format shared with other Copilot tools.

**Does VS Code support remote MCP servers?** Yes, over Streamable HTTP with SSE fallback.

More clients: [Add a remote MCP server to any AI client](/guides/add-remote-mcp-server) · [Cursor](/guides/cursor-mcp) · [Claude Code](/guides/claude-code-mcp)
