Context7 Cli

by upstashfeef1b2f6078No license62K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated today

Use the ctx7 CLI to fetch library documentation and configure Context7 MCP. Activate when the user mentions "ctx7" or "context7", needs current docs for any library, or needs to set up Context7 for their AI coding agent.

AI-generated overview

Fetches current library documentation via the ctx7 CLI and configures Context7 MCP for AI coding editors.

What it does
This skill explains how to use the ctx7 command-line tool to resolve a library ID and fetch up-to-date documentation for that library. It also covers Context7 MCP setup for editors such as Claude Code, Cursor and OpenCode, plus authentication commands for login, logout and status checks. It is an instructions-only skill with two reference documents, one on documentation lookup and one on setup.
When to use it
Use it when the user mentions ctx7 or Context7, needs current documentation for a library, or wants to configure Context7 MCP in their AI coding agent. It is also relevant when verifying API signatures or when training data may be outdated.
Requirements
Requires the ctx7 CLI, installed globally with npm or run through npx, so Node.js and npm plus network access are needed. An optional Context7 API key or OAuth login enables higher rate limits; the setup command requires login unless an API key or OAuth flag is passed. No scripts ship with the skill.

ctx7 CLI

The Context7 CLI does two things: fetches up-to-date library documentation and sets up Context7 MCP for your editor.

Make sure the CLI is up to date before running commands:

bash
npm install -g ctx7@latest

Or run directly without installing:

bash
npx ctx7@latest <command>

What this skill covers

  • Documentation [blocked] — Fetch current docs for any library. Use when writing code, verifying API signatures, or when training data may be outdated.
  • Setup [blocked] — Configure Context7 MCP for Claude Code / Cursor / OpenCode.

Quick Reference

bash
# Documentationctx7 library <name> <query>           # Step 1: resolve library IDctx7 docs <libraryId> <query>         # Step 2: fetch docs
# Setupctx7 setup                            # Configure Context7 MCP (interactive)ctx7 login                            # Log in for higher rate limitsctx7 whoami                           # Check current login status

Authentication

bash
ctx7 login               # Opens browser for OAuthctx7 login --no-browser  # Prints URL instead of opening browserctx7 logout              # Clear stored tokensctx7 whoami              # Show current login status (name + email)

Most commands work without login. Exception: ctx7 setup requires it unless --api-key or --oauth is passed. Login also unlocks higher rate limits on docs commands.

Set an API key via environment variable to skip interactive login entirely:

bash
export CONTEXT7_API_KEY=your_key

Common Mistakes

  • Library IDs require a / prefix — /facebook/react not facebook/react
  • Always run ctx7 library first — ctx7 docs react "hooks" will fail without a valid ID

Source and attribution

Source:upstash/context7inskills/context7-cliat commitfeef1b2

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal