Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dotneet avatar

Context7

  • 377 installs
  • 3 repo stars
  • Updated January 23, 2026
  • dotneet/claude-code-marketplace

context7 is a Claude Code skill that fetches up-to-date library and framework documentation through the Context7 API so developers coding against React, Next.js, Prisma, or other packages get current APIs instead of stal

About

context7 is a research plugin skill in dotneet/claude-code-marketplace that calls Context7 at https://context7.com/api/v2 with a CONTEXT7_API_KEY (ctx7sk- prefix). Its 3-step workflow resolves a library ID via GET /libs/search using libraryName and query, retrieves snippets via GET /context with libraryId and query, then answers with code examples and source URLs. Triggers include explicit "use context7" requests, library API questions, version-specific docs, and uncertain API details. The bundled references/api_reference.md documents authentication, trustScore selection, and 404/429 error handling. Use context7 whenever framework docs may have changed since model training—middleware setup, hook APIs, or package migrations.

  • Pulls version-aware docs for popular libraries
  • Cuts stale-training-data API mistakes in generated code
  • Works as a marketplace connector inside Claude Code
  • Speeds integration work with authoritative references
  • Improves accuracy for fast-moving JS and cloud SDKs

Context7 by the numbers

  • 377 all-time installs (skills.sh)
  • Ranked #2,046 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dotneet/claude-code-marketplace --skill context7

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs377
repo stars3
Last updatedJanuary 23, 2026
Repositorydotneet/claude-code-marketplace

How do you get up-to-date library docs in Claude Code?

Fetch up-to-date library and framework documentation via Context7 so Claude answers and code changes match current APIs.

Who is it for?

Developers implementing against fast-moving JavaScript, Python, or web frameworks who need version-accurate API docs during agent-assisted coding.

Skip if: Tasks with no external library dependency, offline-only environments without CONTEXT7_API_KEY, or questions answerable from the local codebase alone.

When should I use this skill?

The user asks how to use a library API, requests code examples, says "use context7", or needs version-specific framework documentation verification.

What you get

Resolved Context7 library IDs, retrieved documentation snippets with trustScore metadata, version-matched code examples, and cited documentation source URLs.

  • Version-matched code examples
  • API explanations with documentation URLs
  • Resolved Context7 library IDs

By the numbers

  • 3-step workflow across Context7 /libs/search and /context API v2 endpoints
  • Bundled references/api_reference.md documents Context7 authentication and error codes

Files

SKILL.mdMarkdownGitHub ↗

Context7

Overview

Context7 is a service that provides LLMs with the latest library documentation. It prevents hallucinations from outdated training data or non-existent APIs, enabling retrieval of version-specific accurate documentation and code examples.

When to Use

Use this skill in the following cases:

1. Explicit instruction: When the user instructs "use context7" or "check the latest documentation" 2. Library usage questions: When asked about how to use a specific library's API, hooks, or functions 3. Code example requests: When asked for code examples using a specific library 4. Version-specific information: When library information for a specific version is needed 5. Uncertain API information: When your knowledge might be outdated and latest information verification is needed

Workflow

Step 1: Resolve Library ID

First, obtain the Context7 ID for the target library.

API call:

curl "https://context7.com/api/v2/libs/search?libraryName=LIBRARY_NAME&query=CONTEXT_QUERY" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"

Example:

# Search for React library
curl "https://context7.com/api/v2/libs/search?libraryName=react&query=hooks" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"

Criteria for selecting from response:

  • trustScore: Trust score (higher is better)
  • totalSnippets: Number of available documents (more means richer information)
  • versions: Verify that the required version is included

Step 2: Retrieve Documentation

Use the resolved library ID to retrieve specific documentation.

API call:

curl "https://context7.com/api/v2/context?libraryId=LIBRARY_ID&query=SPECIFIC_QUERY" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"

Example:

# Retrieve information about React's useEffect
curl "https://context7.com/api/v2/context?libraryId=/facebook/react&query=useEffect cleanup function" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"

Query best practices:

  • Use specific queries ("useEffect cleanup function" rather than "hooks")
  • Be clear about the purpose ("authentication middleware", "form validation", etc.)

Step 3: Respond to User

Respond to the user's question based on the retrieved documentation.

Information to include in the response:

  • Retrieved code examples
  • API explanations
  • Documentation source URLs (for reference)

Examples

Example 1: React Hook Usage

User: "How do I write a cleanup function with React's useEffect?"

Execution steps: 1. Library search: libraryName=react, query=useEffect cleanup 2. Documentation retrieval: libraryId=/facebook/react, query=useEffect cleanup function 3. Respond with the latest code examples and best practices

Example 2: Next.js Routing

User: "Use context7 to show me how to implement authentication middleware with Next.js App Router"

Execution steps: 1. Library search: libraryName=next.js, query=middleware authentication 2. Documentation retrieval: libraryId=/vercel/next.js, query=middleware authentication route protection 3. Respond with the latest App Router compatible middleware implementation

Example 3: Multiple Libraries Combination

User: "How to create a button component using TailwindCSS and shadcn/ui"

Execution steps: 1. Resolve IDs for each library 2. Retrieve documentation for both 3. Respond with a combined implementation example

Error Handling

ErrorSolution
404 (Not Found)Search again with a different library name (e.g., "nextjs" → "next.js")
429 (Rate Limit)Wait a moment and retry
Empty responseRetry with a more general query

Resources

For detailed API specifications, see references/api_reference.md.

  • Endpoint details
  • Response field descriptions
  • Rate limit information
  • Error code list

Related skills

How it compares

Use context7 when you need live, version-specific framework docs during coding; use local codebase search when the answer is already in repository source files.

FAQ

What API key does the context7 skill require?

The context7 skill requires a CONTEXT7_API_KEY environment variable sent as a Bearer token to https://context7.com/api/v2. Context7 API keys use the ctx7sk- prefix according to the bundled API reference.

How does context7 select the right library match?

The context7 skill calls GET /libs/search with libraryName and query, then prefers higher trustScore, richer totalSnippets, and responses that include the requested version before calling GET /context.

When should context7 run during development?

The context7 skill should run when users ask library API questions, request examples, need version-specific docs, or explicitly say "use context7." It is meant to verify APIs that may have changed since model training.

AI & Agent Buildingllmresearchagents

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.