Skip to main content
VS Code reads MCP servers for GitHub Copilot’s agent mode. Its config shape differs from every other client on one point, and it is the mistake people make most often.

Set it up with your agent

One prompt, written for GitHub Copilot in VS Code to read rather than you. It installs the server, registers it, reloads, and proves the tool works with a real verification.
Prefer to do it yourself? The rest of this page is the same setup by hand.

The root key is servers, not mcpServers

Claude Desktop, Cursor, Windsurf, and Cline all use mcpServers. VS Code uses servers. A config copied from any of those clients loads nothing here, with no error: VS Code simply sees no servers.

Config location

Open the user file from the Command Palette with MCP: Open User Configuration. For the workspace file, create .vscode/mcp.json yourself.

Add it

To pin the version and skip the global install:
The -p flag is required. refactron-mcp is a second binary of the refactron package, not a package of its own.

Verify the connection

Run MCP: List Servers from the Command Palette. refactron appears with a Running status; select it for Show Output and the start command. In the Copilot Chat pane, switch the mode selector to Agent, then open the tools picker. verify_change is listed under refactron with a checkbox.

Troubleshooting

  • No servers listed: check the root key. It is servers. A copied mcpServers block is the usual cause.
  • The server sits at Stopped: open MCP: List Servers, select refactron, then Start Server, and read Show Output for the launch error.
  • spawn refactron-mcp ENOENT: the binary is not on the PATH VS Code inherited. Run which refactron-mcp in a terminal and use that absolute path as command, or use the npx form.
  • The tool never gets called: Copilot only calls tools in Agent mode. Ask and Edit modes do not.
  • GitHub Copilot CLI does not read this file: the CLI keeps its own MCP config and expects mcpServers. Configuring VS Code does not configure the CLI.
  • A verification takes minutes: verify_change runs your real test suite in a shadow copy.