context7-mcp

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

A guide for using Context7 to retrieve current documentation and code examples for libraries, frameworks, APIs, and cloud services.

In plain words
What is it for?
It helps answer setup questions and write code involving tools such as React, Next.js, Prisma, Supabase, Vue, and Express.
Why use it?
It reduces the risk of relying on outdated syntax or examples when software changes over time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps answer setup questions and write code involving tools such as React, Next.js, Prisma, Supabase, Vue, and Express.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/upstash/context7/context7-mcp
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 · 65,890 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-mcp
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-mcp

README.md
[![agentmods](https://agentmods.dev/badge/skills/upstash/context7/context7-mcp/github.svg)](https://agentmods.dev/skills/upstash/context7/context7-mcp)
Your own site
<a href="https://agentmods.dev/skills/upstash/context7/context7-mcp"><img src="https://agentmods.dev/badge/skills/upstash/context7/context7-mcp/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-mcp

Your own site · 80×15
<a href="https://agentmods.dev/skills/upstash/context7/context7-mcp"><img src="https://agentmods.dev/badge/skills/upstash/context7/context7-mcp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 576 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 pass 13 Nov 2026
  • Snyk warn 12 Nov 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
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.00058 $0.00576
Opus 5.5 $0.00023 $0.00230
Sonnet 5.5 $0.00012 $0.00115
Haiku 4.5 $0.00006 $0.00058

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

Security

Grade A, and why

context7-mcp 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 17d 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

3 near-identical copies found in the catalogue:

packages/opencode/skills/context7-mcp/SKILL.md · 57 lines

How it starts

The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.

When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data.

When to Use This Skill

Activate this skill when the user:

  • Asks setup or configuration questions ("How do I configure a Next.js proxy?")
  • Requests code involving libraries ("Write a Prisma query for...")
  • Needs API references ("What are the Supabase auth methods?")
  • Mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)

How to Fetch Documentation

Step 1: Resolve the Library ID

Call resolve-library-id with:

  • libraryName: The library name extracted from the user's question
  • query: What to look up in the library's documentation (improves relevance ranking)

Step 2: Select the Best Match

From the resolution results, choose based on:

  • Exact or closest name match to what the user asked for
  • Higher benchmark scores indicate better documentation quality
  • If the user mentioned a version (e.g., "React 19"), prefer version-specific IDs

Step 3: Fetch the Documentation

Call query-docs with:

  • libraryId: The selected Context7 library ID (e.g., /vercel/next.js)
  • query: What to look up in the library's documentation, scoped to a single concept

If the user's question spans multiple distinct concepts (e.g. routing and auth and caching), make a separate query-docs call per concept with the same library ID, unless the question is about how the concepts interact — combined queries dilute ranking and return shallow results for each topic.

Step 4: Use the Documentation

Incorporate the fetched documentation into your response:

  • Answer the user's question using current, accurate information
  • Include relevant code examples from the docs
  • Cite the library version when relevant

Guidelines

  • Be specific: Describe what to look up in the library's documentation, but keep each query to a single concept
  • One topic per query: Split multi-topic questions into separate query-docs calls — resolve the library ID once, then query per concept, unless the question is about how the concepts interact
  • Version awareness: When users mention versions ("Next.js 16", "React 19"), use version-specific library IDs if available from the resolution step
  • Prefer official sources: When multiple matches exist, prefer official/primary packages over community forks

Read the full file on GitHub · 57 lines

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. 22d ago Changed 112e7c0e1484
  2. 25d ago Changed · +12 lines 1d42d8962589
  3. 1mo ago Changed d1ea3447e915
  4. 3mo ago First seen · 57 lines · 58 tokens per session scan A 29ef59d34287

Subscribe to this mod's changes

context7-mcp is a skill published in the GitHub repository upstash/context7 (65,890 stars, last pushed today), licensed MIT. It adds 58 tokens to every session and 576 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

context7-mcp compared with skills from other repositories

context7-mcp next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context7-mcpupstash/context7Skill66ktodayMITA58Claude Code, Codex
background-watch-hookavibe-bot/avibeSkill659todayMITA32Claude Code, Codex
gentech-blockrunBlockRunAI/blockrun-mcpSkill393todayMITA46Claude Code, Codex
portainer-mcp-hygieneportainer/portainer-mcpSkill2421mo agoMITA315Claude Code, Codex
setupqdrant/mcp-server-qdrantSkill1.6kyesterdayApache-2.0C45Claude Code, Codex
disease-analysisdbcls/togomcpSkill232d agoMITA149Claude Code, Codex
audit-architecturepanbanda/omenSkill252d agoApache-2.0A33Claude Code