Skip to main content
VS Code supports MCP servers through Copilot’s agent mode. Its config has one feature the others lack: inputs, which prompt for a secret at first use instead of storing it in the file.

Add the server

Create .vscode/mcp.json in your workspace:
.vscode/mcp.json
Because the key comes from inputs, this file is safe to commit. VS Code prompts each person for their own key the first time the server starts, and stores it in the OS keychain rather than in the repository.
Note the top-level key is servers, not mcpServers as in most other clients.

Verify

1

Start the server

Open .vscode/mcp.json. VS Code shows a Start action above the server entry - click it, and enter your API key when prompted.
2

Switch Copilot to Agent mode

Open Chat and select Agent from the mode dropdown. Tools only run in agent mode.
3

Ask something read-only

What is my 2extract balance?
Copilot asks for permission to run the tool, then reports the number.
You can see everything that is registered with MCP: List Servers from the Command Palette.

User-level instead of workspace

To make the server available in every workspace, run MCP: Open User Configuration from the Command Palette and put the same servers block there. The inputs mechanism works the same way.

Troubleshooting

The JSON is malformed, or the top-level key is wrong. VS Code expects servers, not mcpServers - that is the most common mistake when copying a config from another client.
The stored value was cleared. Run MCP: Reset Cached Tools or restart the server from .vscode/mcp.json and enter the key again.
Copilot must be in Agent mode. Ask and Edit modes do not call MCP tools.
The key entered at the prompt is wrong or expired. Reset the input and re-enter it - the value is not in the JSON, so editing the file will not help.

Next steps

Tools

Everything the agent can call.

Usage Examples

Sessions from request to connection string.