Context7 Documentation Lookup Skill
Fetch up-to-date library documentation via Context7 REST API. Lightweight alternative to Context7 MCP with no persistent context overhead.
Features
- No MCP Overhead - Uses REST API directly, no tool schemas consuming context
- Current Documentation - Fetches live docs from Context7's curated database
- Topic Filtering - Focus on specific areas (hooks, routing, middleware, etc.)
- 50+ Libraries - React, Next.js, Vue, Express, Prisma, and more
Installation
Marketplace (Recommended)
Add the Netresearch marketplace once, then browse and install skills:
# Claude Code
/plugin marketplace add netresearch/claude-code-marketplace
/plugin install context7@netresearch-claude-code-marketplace
Without a marketplace
Since Claude Code 2.1.157 a plugin directory under your personal skills directory loads on its own:
mkdir -p ~/.claude/skills
git clone https://github.com/netresearch/context7-skill.git \
~/.claude/skills/context7
It loads as context7@skills-dir on the next session. Update with git -C ~/.claude/skills/context7 pull and start a new session; remove it by deleting the directory. This route has no claude plugin update.
npx (skills.sh)
Install with any Agent Skills-compatible agent:
npx skills add https://github.com/netresearch/context7-skill --skill context7
Download Release
Download the latest release and extract to your agent's skills directory.
Git Clone
git clone https://github.com/netresearch/context7-skill.git
Composer (PHP Projects)
composer require netresearch/context7-skill
Requires netresearch/composer-agent-skill-plugin.
npm (Node Projects)
npm install --save-dev \
@netresearch/agent-skill-coordinator \
github:netresearch/context7-skill
Requires @netresearch/agent-skill-coordinator, which discovers the skill in node_modules and registers it in AGENTS.md via a postinstall hook. For pnpm, also allowlist the coordinator's postinstall:
{
"pnpm": {
"onlyBuiltDependencies": ["@netresearch/agent-skill-coordinator"]
}
}
Usage
The skill triggers on keywords like:
- "how do I use [library]"
- "what's the API for [library]"
- "[library] documentation"
- "show me [library] patterns"
Example Prompts
"How do I use React hooks?"
"What's the Next.js App Router API?"
"Show me Prisma query patterns"
"Express middleware documentation"
Manual Script Usage
# Search for a library ID
scripts/context7.sh search "prisma"
# Fetch documentation with topic
scripts/context7.sh docs "/prisma/prisma" "queries"
Structure
context7/
├── SKILL.md # AI instructions
├── README.md # This file
├── LICENSE-MIT # Code license (MIT)
├── LICENSE-CC-BY-SA-4.0 # Content license (CC-BY-SA-4.0)
├── scripts/ # Automation scripts
│ └── context7.sh # REST API wrapper
└── .github/
└── workflows/
└── release.yml # Release packaging
Why Use This Over Context7 MCP?
| Aspect | MCP Server | This Skill |
|---|---|---|
| Context cost | ~500-2000 tokens always | ~100 tokens on-demand |
| Tool schemas | Always in context | None |
| Invocation | Model decides | Model decides |
| API access | Via MCP protocol | Direct REST API |
Best for: Users who occasionally need library docs but don't want persistent context overhead.
Environment Variables
| Variable | Required | Description |
|---|---|---|
CONTEXT7_API_KEY | No | API key for higher rate limits |
Contributing
Contributions welcome! Please submit PRs for:
- Adding common library IDs
- Improving script error handling
- Documentation updates
Tests
The behavioural tests live in tests/ and need only bash, jq, git and python3 (check-plugin-version.sh reads plugin.json with it):
bash tests/context7.sh # skills/context7/scripts/context7.sh
bash tests/check-plugin-version.sh # Build/Scripts/check-plugin-version.sh
tests/context7.shputs a fakecurlfirst onPATH, so no request reaches the Context7 API. It checks the usage and argument errors, the request URL each command builds (leading slash stripped, mode in the path, query and topic percent-encoded), that theAuthorizationheader is sent only whenCONTEXT7_API_KEYis set and reachescurlon standard input rather than as an argument, and how search results and API errors are printed.tests/check-plugin-version.shbuilds throwaway git repositories and checks that a semver tag atHEADmust match the version in.claude-plugin/plugin.json.
Each check prints ok or FAIL; a FAIL line is followed by the exit code, the output and, for context7.sh, the arguments the fake curl received. A script exits 1 when any check failed. In CI, the Skill Tests workflow (.github/workflows/tests.yml) runs every tests/**/*.sh on each pull request and on pushes to main.
A pull request that adds or changes behaviour in a shipped script adds or updates a check in tests/ that fails without the change.
Governance and policies
This repository follows the Netresearch organisation policies:
- Governance: ownership, roles, how decisions are made and disputes resolved, and continuity.
- Roadmap: planned and explicitly excluded work for the coming year.
- Handling of dependency and code analysis findings: thresholds, deadlines and the exception process for dependency (SCA) and static analysis (SAST) findings.
- Secret management: how CI and release credentials are stored, accessed and rotated.
- Access roster: who holds administrative access to this repository and the organisation.
The security assurance case for this skill (threat model, trust boundaries, countermeasures and limits) is in docs/SECURITY-ASSURANCE.md.
Checks that run on pull requests in this repository:
- Every pull request: Skill Validation (
lint.yml: skill structure, markdownlint, yamllint, actionlint, JSON syntax, ShellCheck, ruff), Eval Validation (eval-validate.yml) and Skill Tests (tests.yml). - Pull requests to
main:security.ymlwith Betterleaks (secret scanning), zizmor (workflow static analysis), dependency review (fails on vulnerabilities of severity high or above), Composer Audit and Opengrep SAST (failure threshold: organisation SAST rule); Harness Verification (harness-verify.yml) and Template Drift (check-template-drift.yml).
License
This project uses split licensing:
- Code (scripts, workflows, configs): MIT
- Content (skill definitions, documentation, references): CC-BY-SA-4.0
See the individual license files for full terms.
Credits
- Context7 API by Upstash
- Skill developed by Netresearch DTT GmbH
Made with love for Open Source by Netresearch