Use Context7 MCP tools to fetch up-to-date library and framework documentation. Load whenever writing, planning, or reviewing code that involves any external library, framework, or API.
Use Context7 before writing or planning any code that involves an external library or framework. Do not rely on training data for API signatures, method names, or framework patterns — these go stale. Fetch docs first, then code.
Especially valuable for fast-moving libraries: Next.js, React, Vue, Astro, Tailwind, any SDK or API client, anything where version matters.
Two tools, always used in sequence:
resolve-library-id — converts a library name to a Context7-compatible ID.
"next.js", "supabase", "zod"/vercel/next.jsget-library-docs — fetches documentation for a resolved library ID.
/vercel/next.js, optional , optional topicpagetopic: narrow the query — be specific. Good: "jwt middleware", "useEffect cleanup". Bad: "auth", "hooks"page: defaults to 1. Paginate (up to 10) if the first result lacks sufficient detail.resolve-library-id("next.js") → /vercel/next.js get-library-docs("/vercel/next.js", topic="middleware jwt") → current docs injected into context → now write the code
If the user provides a library ID directly in /org/project or
/org/project/version format, skip resolve-library-id and call
get-library-docs immediately.
For a specific version: /vercel/next.js/v15.0.0
resolve-library-id if the user already gave you a /org/project ID