context7-cli

context7-cli is a skill for Claude Code, Codex from upstash/context7. It costs 53 tokens per session (459 once invoked), scanned A, original, MIT.

A command-line tool for Context7, a service that provides current library documentation and code examples. It can also manage coding skills and configure Context7 for supported coding-agent editors.

In plain words
What is it for?
Finding library documentation, installing or managing coding skills, suggesting skills from project dependencies, and configuring Context7 for Claude Code, Cursor, or OpenCode.
Why use it?
It puts documentation lookup, skill management, and setup in one command-line workflow. Current documentation can reduce mistakes caused by outdated APIs or examples.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions OpenCode.

Good fit Finding library documentation, installing or managing coding skills, suggesting skills from project dependencies, and configuring Context7 for Claude Code, Cursor, or OpenCode.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/upstash/context7/context7-cli
About the project

Context7 is a documentation service that puts current, version-specific library documentation and code examples into prompts for large language models and AI coding editors. Developers use it to help coding agents produce answers based on the libraries they actually use; the catalogue entries provide ways for agents to access Context7 through its CLI or MCP server.

upstash/context7 · 63,103 stars · on GitHub · context7.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add upstash/context7 --skill context7-cli
Clone the repo
git clone --depth 1 https://github.com/upstash/context7

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context7-cli

README.md
[![agentmods](https://agentmods.dev/badge/skills/upstash/context7/context7-cli/github.svg)](https://agentmods.dev/skills/upstash/context7/context7-cli)
Your own site
<a href="https://agentmods.dev/skills/upstash/context7/context7-cli"><img src="https://agentmods.dev/badge/skills/upstash/context7/context7-cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context7-cli

Your own site · 80×15
<a href="https://agentmods.dev/skills/upstash/context7/context7-cli"><img src="https://agentmods.dev/badge/skills/upstash/context7/context7-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 459 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Fable 5.1 · 6 Sept 2026 📄 Read the review Third-party audits
  • Socket warn 8 Oct 2026
  • Snyk warn 8 Oct 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 19
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.00459
Opus 5.5 $0.00021 $0.00184
Sonnet 5.5 $0.00011 $0.00092
Haiku 4.5 $0.00005 $0.00046

Measured 7d ago against content hash 6b9e87f6e328, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

context7-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

skills/context7-cli/SKILL.md · 61 lines

What it actually says

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:

npm install -g ctx7@latest

Or run directly without installing:

npx ctx7@latest <command>

What this skill covers

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

Quick Reference

# Documentation
ctx7 library <name> <query>           # Step 1: resolve library ID
ctx7 docs <libraryId> <query>         # Step 2: fetch docs

# Setup
ctx7 setup                            # Configure Context7 MCP (interactive)
ctx7 login                            # Log in for higher rate limits
ctx7 whoami                           # Check current login status

Authentication

ctx7 login               # Opens browser for OAuth
ctx7 login --no-browser  # Prints URL instead of opening browser
ctx7 logout              # Clear stored tokens
ctx7 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:

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
Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed · -12 lines · -14 tokens per session 6b9e87f6e328
  2. 1mo ago First seen · 73 lines · 67 tokens per session scan A d7b70ba126d9

Subscribe to this mod's changes

context7-cli is a skill published in the GitHub repository upstash/context7 (63,103 stars, last pushed today), licensed MIT. It adds 53 tokens to every session and 459 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

gentech-blockrun

GenTech Labs' integration patterns for BlockRun MCP from Hermes Agent. Covers daily usage patterns, cost-optimized workflows, multi-tool pipelines, and reliable error handling for BlockRun's full toolset.

BlockRunAI/blockrun-mcp · 46 tokens

portainer-mcp-hygiene

How to drive the Portainer MCP server's tools correctly — both reading and mutating. Reading: project responses with select (JMESPath), where the heavy fields live (snapshots, status blocks, managed fields), how to handle non-JSON Docker/K8s proxy endpoints (container and pod logs, stats, exec), and how to interpret…

portainer/portainer-mcp · 315 tokens

mcptoon

Compress MCP tool discovery with the mcptoon CLI. Trigger when a session has a large MCP tool catalog (many servers/tools), when the user mentions token cost, tool discovery, mcptoon, or asks to list/call MCP tools efficiently. Also route here when the user says the MCP tool list is too large, the agent context window…

activeing123/mcptoon · 523 tokens

disease-analysis

Run a multi-scale disease pathophysiology analysis — molecular defects through to clinical symptoms — using TogoMCP (RDF Portal SPARQL), TogoID ID conversion, OLS4, and PubMed. Use whenever the user asks to "analyze a disease", build a disease mechanism model, find disease-associated proteins/pathways/drugs, map a…

dbcls/togomcp · 149 tokens

kicad-pcb

Workflow skill for KiCAD PCB layout and routing via MCP tools. Triggers on: "layout the board", "route traces", "PCB", "place footprints", "copper pour", "board outline", "differential pair", "board setup", "track width", "via", "zone", "design rules", "stackup", "silkscreen".

mixelpixx/Konnect · 81 tokens

audit-architecture

Audit module coupling, cohesion, hidden dependencies, and design smells. Use when conducting architecture reviews, evaluating design decisions, or identifying structural tech debt.

panbanda/omen · 33 tokens