context7

Fetches up-to-date library documentation and code examples via the Context7 REST API.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/sonth87/Redprint --skill context7-sonth87
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context7
Source: https://github.com/sonth87/Redprint/tree/main/.agents/skills/context7
Command: npx skills add https://github.com/sonth87/Redprint --skill context7-sonth87

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires curl, jq, and includes scripts (resource) components.

What problem does it solve? AI assistants often rely on outdated training data when answering questions about library APIs, leading to deprecated methods and incorrect code examples. This Skill retrieves current, version-specific documentation on demand so answers reflect the actual state of a library. ## Core Features & Use Cases - Library Search: Find the correct Context7 library ID (e.g., /facebook/react) for any package by name. - Documentation Fetching: Pull API references and code examples in code mode, or conceptual guides and tutorials in info mode, with optional topic filtering like hooks or routing. - Use Case: When a user asks "How do I use React Server Components in Next.js?", search for the Next.js library ID, fetch the routing topic docs, and answer with current official patterns instead of stale knowledge. ## Quick Start Ask the assistant to look up the current documentation for a library, for example: "Use Context7 to show me how React hooks work."

Frequently Asked Questions about context7

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 React or Next.js?▼

Run the search command with the library name to find its Context7 ID, then call the docs command with that ID and an optional topic. For example, search for react, then fetch docs for /facebook/react with the topic hooks.

What is the difference between code mode and info mode in Context7?▼

Code mode returns API references and code examples and is the default. Info mode returns conceptual guides, tutorials, and explanations, which suits questions about architecture or how a feature works conceptually.

Does Context7 require an API key to work?▼

No, the API key is optional. Requests work without authentication, but setting the CONTEXT7_API_KEY environment variable enables authenticated requests with higher rate limits.

Why does the Context7 docs command return an error for my library ID?▼

The library ID must use the exact /vendor/library format returned by the search command, such as /vercel/next.js. Also verify the mode argument is either code or info, since other values are rejected.

What tools are required to run the Context7 lookup script?▼

The script requires curl for HTTP requests and jq for URL encoding and formatting search results. Both must be installed and available on the system PATH.