context7-mcp

Fetches current library documentation and code examples via Context7 MCP tools.

2|Updated Mar 7, 2025
One-click install
npx skills add https://github.com/AbdelrhmanUZaki/KnowledgeNuggets --skill context7-mcp-abdelrhmanuzaki
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context7-mcp
Source: https://github.com/AbdelrhmanUZaki/KnowledgeNuggets/tree/main/2-setup/shared/gemini/config/skills/context7-mcp
Command: npx skills add https://github.com/AbdelrhmanUZaki/KnowledgeNuggets --skill context7-mcp-abdelrhmanuzaki

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI assistants often answer library and framework questions using outdated training data, producing deprecated APIs or incorrect code examples. This Skill retrieves up-to-date documentation from Context7 so answers reflect the current state of libraries like React, Next.js, Prisma, and Supabase. ## Core Features & Use Cases - Library Resolution: Maps a user's question to the correct Context7 library ID using the resolve-library-id tool, with version-aware selection. - Documentation Queries: Fetches targeted documentation and code examples via the query-docs tool using the user's full question for relevance. - Research Mode Retry: Falls back to researchMode, which pulls actual source repositories and live web results, when the default answer is insufficient. - Use Case: A developer asks "How do I configure Next.js 15 middleware?" The Skill resolves the Next.js library ID, fetches current middleware docs, and returns an accurate, version-specific code example. ## Quick Start Ask how to configure a specific feature in a named library or framework, such as requesting the current Supabase authentication methods with code examples.

Frequently Asked Questions about context7-mcp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get up-to-date documentation for a library like Next.js?▼

Ask your question naming the library, and the Skill calls resolve-library-id to find the matching Context7 ID, then query-docs with your full question. The response includes current documentation and relevant code examples.

How does Context7 library resolution work?▼

The resolve-library-id tool takes the library name plus the user's full query and returns ranked matches. Selection favors exact name matches, higher benchmark scores, and version-specific IDs when the user mentions a version like React 19.

Does Context7 support specific framework versions like Next.js 15?▼

Yes. When a user mentions a version, the resolution step prefers version-specific library IDs if available. The fetched documentation can then be cited with the relevant library version.

What should I do when the Context7 documentation answer is incomplete?▼

Retry query-docs for the same library with researchMode set to true. This uses sandboxed agents that pull the actual source repositories plus a live web search to synthesize a fresh answer, at higher cost than the default query.

When should I not rely on Context7 documentation fetching?▼

Avoid it for questions unrelated to libraries or frameworks, since resolution may return irrelevant matches. Also prefer official sources over community forks when multiple matches exist for the same library name.