New: watch your coding agents work, step by step, on a live board. Try the demo, no account

Add a remote MCP server to VS Code

VS Code reads MCP servers for Copilot from mcp.json, under a top-level servers object (not mcpServers). A remote server takes type "http", a url and optional headers.

By Jake Marsh. Checked against VS Code's own docs on 2026-10-31; each section links its source.

The VS Code config

For a server named my-server at https://example.com/mcp that takes an Authorization header. Where it goes: .vscode/mcp.json in the workspace, or your user mcp.json (MCP: Open User Configuration).

{
  "servers": {
    "my-server": {
      "type": "http",
      "url": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Swap in your own server below and the VS Code version updates first, with every other client after it.

Where VS Code reads it

  • .vscode/mcp.json in the workspaceworkspace: that folder, and anyone who opens it
  • mcp.json in your user profile (run MCP: Open User Configuration)user: every workspace
  • .mcp.json at the workspace root, or $COPILOT_HOME/mcp-config.jsonportable format with an mcpServers object, read by VS Code too

Keys, headers and sign-in

Rather than writing a key into the file, declare an input and reference it: an inputs entry of type promptString with password: true, and ${input:<id>} in the header. VS Code asks for the value the first time the server starts and stores it securely.

With an oauth object (a clientId), VS Code runs the OAuth flow itself and opens a browser window on the first connection. A client secret isn't stored in mcp.json; use the Set Client Secret CodeLens.

{
  "inputs": [
    { "type": "promptString", "id": "my-server-key", "description": "my-server API key", "password": true }
  ],
  "servers": {
    "my-server": {
      "type": "http",
      "url": "https://example.com/mcp",
      "headers": { "Authorization": "Bearer ${input:my-server-key}" }
    }
  }
}
.vscode/mcp.json that asks for the key once instead of storing it in the file.

Source: code.visualstudio.com/docs/agents/reference/mcp-configuration

Check that it connected

Run MCP: List Servers from the Command Palette, or open MCP Servers in the Agent Customizations editor. Each server's menu has Start Server, Stop Server, Restart Server and Show Output; Show Output opens that server's output channel.

Source: code.visualstudio.com/docs/agents/run/manage-mcp-servers

VS Code gotchas

Still not connecting? VS Code Copilot MCP tools not showing walks through the fixes in order.

Generate the config for your server

Runs in your browser. Nothing you type is sent anywhere. Still, don't paste real keys on shared screens.

The header value is never put in the link.

VS Code (Copilot agent mode)

.vscode/mcp.json in the workspace, or your user mcp.json (MCP: Open User Configuration)

{
  "servers": {
    "my-server": {
      "type": "http",
      "url": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Source: code.visualstudio.com/docs/agents/reference/mcp-configuration

Claude Code

Run in a terminal (--scope user makes it available in every project)

claude mcp add --transport http --scope user my-server "https://example.com/mcp" --header "Authorization: Bearer YOUR_KEY"

Source: code.claude.com/docs/en/mcp

Cursor

~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project)

{
  "mcpServers": {
    "my-server": {
      "url": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Source: cursor.com/docs/context/mcp

Codex CLI

~/.codex/config.toml

[mcp_servers.my_server]
url = "https://example.com/mcp"
http_headers = { "Authorization" = "Bearer YOUR_KEY" }

Source: developers.openai.com/codex/mcp

Windsurf / Devin Desktop

~/.config/devin/mcp_config.json (older Windsurf: ~/.codeium/windsurf/mcp_config.json)

{
  "mcpServers": {
    "my-server": {
      "serverUrl": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Source: docs.devin.ai/windsurf/plugins/cascade/mcp

Devin CLI / Devin Local

Run in a terminal (-s user saves it to ~/.config/devin/mcp_config.json for every project)

devin mcp add -s user -H "Authorization: Bearer YOUR_KEY" my-server "https://example.com/mcp"

Source: docs.devin.ai/cli/extensibility/mcp/configuration

Gemini CLI

~/.gemini/settings.json (or .gemini/settings.json in the project)

{
  "mcpServers": {
    "my-server": {
      "httpUrl": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Source: geminicli.com/docs/tools/mcp-server/

Antigravity CLI (agy)

~/.gemini/config/mcp_config.json (or .agents/mcp_config.json in the workspace)

{
  "mcpServers": {
    "my-server": {
      "serverUrl": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Source: antigravity.google/docs/mcp

Cline

cline_mcp_settings.json (in the Cline panel, MCP Servers > Configure > Configure MCP Servers; Cline CLI: ~/.cline/data/settings/cline_mcp_settings.json)

{
  "mcpServers": {
    "my-server": {
      "type": "streamableHttp",
      "url": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Source: docs.cline.bot/mcp/mcp-overview

OpenCode

opencode.json in the project root, or ~/.config/opencode/opencode.json for every project

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "my-server": {
      "type": "remote",
      "url": "https://example.com/mcp",
      "oauth": false,
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Source: opencode.ai/docs/mcp-servers/

Need a task list for those agents?

Taskhold is a remote MCP server that gives VS Code and your other agents a task list you share, with their progress on a live board. Its setup link writes this config for the agent, so you don't have to. $12 a month or $120 a year, 7-day trial.

Add Taskhold to VS Code in one click

Opens VS Code or VS Code Insiders on this computer, then asks you to sign in to Taskhold. No key to copy. Needs a Taskhold subscription or trial.

Other clients