Context7 pulls current documentation and code examples straight from the source into the model's context, to avoid outdated or hallucinated APIs. It works as CLI plus skills, or as an MCP server.
What it does
Where Context7 MCP runs and what it adds, from its documentation
Resolve a library name to a Context7 library ID (resolve-library-id)
Fetch docs for a library ID and question (query-docs)
Match a specific library version mentioned in the prompt
Accept direct library IDs like /vercel/next.js in prompts
Set up with one command: npx ctx7 setup
When to use it
Good fit
Coding against fast-changing libraries and frameworks
Avoiding hallucinated or outdated API usage
Not for
Questions that do not involve library documentation
Heavy use without an API key: README recommends one for higher rate limits
How to install Context7 MCP
You need: Node.js 18+ for the ctx7 CLI; Free API key recommended from context7.com/dashboard
Install Node.js 18 or newer
Run npx ctx7 setup (use --cursor, --claude or --opencode to target an agent)
Choose CLI + Skills or MCP mode
Or manually point your client at https://mcp.context7.com/mcp with an Authorization: Bearer API key header
Optionally add a rule telling the agent to use Context7