Context7Context7

VS Code ยท install guide

Install Context7 MCP in VS Code

In .vscode/mcp.json, add context7 under servers with type http and url https://mcp.context7.com/mcp, then reload the window. VS Code uses "servers" as the top-level key, not "mcpServers": a config copied from a Cursor guide will be ignored without any error.

The one thing to get right here is the top-level key. Cursor, Windsurf and Claude Desktop all use mcpServers; VS Code does not, and it fails silently rather than complaining.

{
  "servers": {
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}
Get API key

Add Context7 to VS Code

Put the JSON above in .vscode/mcp.json at the root of your workspace, creating the file if it is not there. Reload the window afterwards. You need a VS Code recent enough to support MCP, which in practice means agent mode with Copilot available.

Context7 is a remote HTTP server, so the entry is type, url and nothing else. There is no command, no args and no package to install.

  1. Create or open .vscode/mcp.json in your workspace root.
  2. Add context7 under servers with type http and url https://mcp.context7.com/mcp.
  3. Reload the window.
  4. In agent mode, add use context7 to a prompt that needs current library docs.

servers, not mcpServers

This is the difference that wastes an afternoon. Nearly every MCP config you will find online is written for Cursor or Claude Desktop, and those use a top-level "mcpServers" object. VS Code reads "servers".

Paste an mcpServers block into .vscode/mcp.json and VS Code does not warn you, does not log an error, and does not show a broken server. It simply finds no servers configured, which looks identical to never having edited the file. If Context7 is not appearing in VS Code and the JSON looks right, check the key name first.

The "type": "http" field is genuinely required here as well, and Cursor and Windsurf usually omit it. So a working Cursor config differs from a working VS Code config in two places, not one.

One workspace, or everywhere

.vscode/mcp.json belongs to a single workspace, which makes it the right place when you want the server committed alongside a project and shared with whoever clones it.

For a server you want in every project, put it in your user profile instead. The quickest way is the VS Code CLI, which writes the user-profile config for you rather than having you find the file:

code --add-mcp '{"name":"context7","type":"http","url":"https://mcp.context7.com/mcp"}'

The Command Palette also has a guided flow for adding an MCP server if you would rather not touch either file. One caveat for remote development: servers defined in your user profile run locally, so if you work in a remote or container environment, define it in the workspace so it runs where your code does.

Confirming it connected

Open the MCP server list from the Command Palette. context7 should be listed, and expanding it should show two tools, resolve-library-id and get-library-docs. Two tools means the handshake completed.

If the server is missing entirely rather than present-but-failed, that is the key-name problem above, not a connectivity problem. /troubleshooting covers the error strings for the case where it is listed and genuinely failing.

Optional API key

No key is needed to try it. For higher rate limits, VS Code supports headers on an HTTP server, and its own documentation advises against hardcoding a key in the file. Use an input variable so VS Code prompts you once and keeps the value out of source control, which matters here because .vscode/mcp.json is a file people commit.

VS Code also implements the MCP authorization spec, so it can run an OAuth flow in the browser instead of using a key at all. Context7 exposes an authenticated endpoint at https://mcp.context7.com/mcp/oauth, covered on /install.