Context7 MCP server in VS Code (GitHub Copilot) ground Copilot in real docs.
Give Copilot's agent mode access to version-specific library documentation with a .vscode/mcp.json entry — note the key is "servers", not "mcpServers".
Copilot's agent mode in VS Code can call MCP tools, and documentation lookup is one of the highest-value tools to give it. Context7 — Upstash's open-source server, 57.1k GitHub stars — resolves whatever library your prompt mentions and returns docs for the version you actually depend on, so generated code targets real APIs.
VS Code has its own MCP config format that trips people up if they copy examples written for other clients. This page uses the correct one.
What changes in agent mode
With Context7 registered, Copilot Chat in agent mode gains documentation tools it can invoke before writing code. Ask it to scaffold against a fast-moving framework and it can fetch the current API surface instead of reconstructing it from training data. As of mid-2026 the server's tools cover resolving a library ID and pulling its docs; the GitHub repo has the authoritative list.
The server runs locally over stdio via npm — free, open source, no account needed.
Two ways in: Command Palette or mcp.json
The quick path is the Command Palette: run "MCP: Add Server", choose the npm/stdio option, and enter the package. For anything you want committed to a repo, write .vscode/mcp.json directly so teammates inherit the server. VS Code's schema wraps entries in a "servers" object — copying an "mcpServers" block from a Cursor or Claude Desktop tutorial will be silently ignored.
{
"servers": {
"context7": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}Start the server and verify
VS Code shows a Start affordance above each entry in mcp.json (and an MCP view listing all servers). Click Start, then open Copilot Chat in agent mode and check the tools picker — Context7's tools should be listed and selectable. The expected tool list is also visible on Context7's live Loomal marketplace listing: https://loomal.ai/marketplace/context7.
Troubleshooting in VS Code
Nothing listed at all? Check the key name first — "servers", not "mcpServers" — and confirm your VS Code build is recent enough to include MCP support in agent mode. Run "MCP: List Servers" from the Command Palette to see what VS Code actually parsed.
If the server is listed but errors on start, open its output channel (the MCP view links to per-server logs) for the real stderr; a missing Node installation or an npx prompt waiting for input are the usual culprits — the -y flag in args prevents the latter. After editing mcp.json, VS Code picks up changes on save, but a stuck server sometimes needs a stop/start cycle or a window reload.
FAQ
How do I install Context7 for GitHub Copilot in VS Code?
Either run "MCP: Add Server" from the Command Palette, or add a context7 entry under "servers" in .vscode/mcp.json with command npx and args ["-y", "@upstash/context7-mcp"]. Click Start in the MCP view, then use it from Copilot Chat's agent mode.
Why doesn't my config from a Cursor tutorial work?
VS Code's mcp.json uses a "servers" top-level key and a "type" field per server; Cursor uses "mcpServers". The entries look similar enough that the mistake is easy to make and fails without an error message.
Where do I see errors when Context7 won't start?
Run "MCP: List Servers", select the server, and open its output log. That stream shows the underlying process's stderr — typically a PATH problem where VS Code can't find npx even though your terminal can.
Is Context7 free to use this way?
Yes — the server software is open source and runs locally without an account. An optional Context7 API key exists for higher rate limits if you hit them; their docs have current details.
More MCP servers for VS Code.
Every listing shows a live, probed tool list before you install.