This VS Code extension registers the Context7 MCP (Model Context Protocol) server with VS Code's built-in MCP support, giving AI assistants real-time access to up-to-date documentation for thousands of libraries and frameworks.
The extension connects to the hosted Context7 server at https://mcp.context7.com/mcp, so it is always running the latest version — no local server process, no manual updates.
- Up-to-date Documentation: Pulls version-specific documentation and code examples straight from the source into your AI assistant's context
- Automatic Library Resolution: Finds the right library documentation based on your query
- Zero Configuration: The server is registered automatically when the extension activates
- Optional API Key: Add a Context7 API key for higher rate limits and access to private repositories
Install Context7 MCP Server from the Visual Studio Marketplace, or from the Extensions view in VS Code (Upstash.context7-mcp).
Requires VS Code 1.101 or later.
Once installed, the Context7 MCP server is available to VS Code's AI features (e.g. Copilot Chat in agent mode). Ask questions like:
- "Show me how to use React hooks. use context7"
- "What are the best practices for Next.js routing? use context7"
- "How do I implement authentication with Supabase? use context7"
You can also reference a library directly by its Context7 ID:
Implement basic authentication with Supabase. Use the API and documentation from the /supabase/supabase library.
Tip: Add a rule to your AI assistant's instructions (e.g.
.github/copilot-instructions.md) telling it to use Context7 for code generation and library questions, so you don't have to typeuse context7every time.
resolve-library-id— Resolves a package/product name to a Context7-compatible library IDget-library-docs— Fetches up-to-date documentation for a library
| Setting | Description |
|---|---|
context7.apiKey |
Optional Context7 API key for higher rate limits and private repositories. Get one at context7.com/dashboard. |
Changing the API key stops the running server so the new key can be picked up. Restart it via MCP: List Servers → Context7 → Start Server (or just send a new chat request, which prompts to start it) — no window reload required.
├── src/
│ └── extension.ts # Main extension code
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
├── CHANGELOG.md # Release notes
├── DEPLOYMENT.md # Publishing guide
└── README.md # This file
npm install # Install dependencies
npm run compile # Build the extension- Open this repository in VS Code
- Press F5 to launch the extension in a new Extension Development Host window
- Run the MCP: List Servers command and confirm "Context7" is listed
- Open Copilot Chat in agent mode and ask a library question with "use context7"
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details.
- Context7 for providing the MCP server for real-time documentation access