How to add an MCP server to VS Code (mcp.json, .mcp.json and fixes)
How to add an MCP server to VS Code Checked against the official docs: Oct 28, 2026 VS Code's agents can call tools from MCP (Model Context Protocol) servers, for example to drive a browser, read current library docs or query GitHub. The setup changed in 2026: VS Code now has two config formats in different files, and the one you pick decides which features you get. This guide shows the quickest…
Adding an MCP server to VS Code involves using the MCP: Add Server command in the Command Palette (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS). The setup process varies based on whether the server is an HTTP URL or a command like npx. You'll need to choose an ID, select where to save the server configuration, and potentially provide trust or sign-in information.
Once configured, the agent can use the server by calling tools from it, with the connection working upon successful execution of a tool. There are three main ways to add an MCP server: using the guided flow, the MCP server gallery, or manually writing the config file. The Portable format (.mcp.json) and VS Code format (.vscode/mcp.json) have different top-level keys and handle secrets differently.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.