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.
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.
npx skills add upstash/context7 --skill context7-cligit clone --depth 1 https://github.com/upstash/context7Wrote 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.
[](https://agentmods.dev/skills/upstash/context7/context7-cli)<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.
<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>- Socket warn
- Snyk warn
- NVIDIA SkillSpector warn
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]
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.
| Model | Per session | Once 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 |
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.
Copies of this mod
2 near-identical copies found in the catalogue:
- context7-cli — 100% identical, 20 lines differ
- context7-cli — 100% identical, 20 lines differ
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/reactnotfacebook/react - Always run
ctx7 libraryfirst —ctx7 docs react "hooks"will fail without a valid ID
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.
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.
- 7d ago Changed · -12 lines · -14 tokens per session 6b9e87f6e328
- 1mo ago First seen · 73 lines · 67 tokens per session scan A d7b70ba126d9
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.
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.
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…
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…
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…
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".
audit-architecture
Audit module coupling, cohesion, hidden dependencies, and design smells. Use when conducting architecture reviews, evaluating design decisions, or identifying structural tech debt.