Fetch real-time library documentation via the Context7 v2 REST API. A superlight agent skill for AI coding assistants — minimal tokens, maximum docs. Supports multiple API keys with round-robin rotation for higher rate limits.
- Real-time docs — Fetches current documentation from Context7's indexed library database
- Version-aware — Query specific versions or get latest API references
- Token-efficient — Minimal context overhead with progressive disclosure
- Agent-agnostic — Works with Claude Code, Cursor, and other skill-compatible agents
- No MCP required — Direct REST API integration via bash script
- Multi-key rotation — Distribute requests across multiple API keys with automatic 429 failover
| Aspect | MCP Server | This Skill |
|---|---|---|
| Context cost | ~1,700 tokens always¹ | ~63 tokens always + ~424 on-demand |
| Tool schemas | Always in context | None (progressive disclosure) |
| Setup | Requires MCP configuration | Drop-in skill directory |
| Dependencies | Node.js runtime | bash, curl, jq (Linux/macOS) |
¹ Measured Nov 2025 via /context command. Source
Best for: Users who need library docs on-demand without persistent context overhead.
Uses Claude's progressive disclosure architecture:
| Level | When Loaded | Content | Tokens |
|---|---|---|---|
| Metadata | Always (startup) | Skill description | ~63 |
| Instructions | When triggered | SKILL.md protocol | ~424 |
| Resources | As needed | troubleshooting.md | ~521 |
Token counts measured with claudetokenizer.com (Claude Sonnet 4.5)
npx skills add edxeth/superlight-context7-skillThe installer will prompt you to select which agents to install to (Claude Code, Cursor, OpenCode, Codex, Antigravity, etc.).
Clone directly to your agent's skills directory:
# Claude Code
git clone https://github.com/edxeth/superlight-context7-skill.git ~/.claude/skills/context7
# OpenCode
git clone https://github.com/edxeth/superlight-context7-skill.git ~/.opencode/skill/context7Directory structure:
context7/
├── SKILL.md
├── reference/
│ └── troubleshooting.md
└── scripts/
└── context7.sh
The skill triggers automatically when working with external packages:
"How do I use React Query's optimistic updates?"
"Debug this Next.js middleware error"
"What's the Prisma syntax for nested filters?"
"Check if this API is deprecated in v5"
# Search for a library
./scripts/context7.sh search "tanstack-query" "mutations"
# Fetch documentation
./scripts/context7.sh docs "/tanstack/query" "useMutation optimistic update"Uses Context7 v2 REST API:
| Endpoint | Purpose |
|---|---|
GET /api/v2/libs/search |
Find library IDs by name |
GET /api/v2/context |
Fetch documentation context |
An API key is optional but recommended for higher rate limits.
# Single API key
export CONTEXT7_API_KEY="ctx7sk_..."
# Multiple API keys for load distribution
export CONTEXT7_API_KEY="ctx7sk_key1,ctx7sk_key2,ctx7sk_key3"When multiple keys are provided (comma-separated), the script rotates through them in round-robin order, ensuring even distribution of requests. If a key hits rate limits (429), the script automatically fails over to the next key and retries, only failing after all keys are exhausted across multiple retry rounds.
Get an API key at context7.com/dashboard.
- Platforms: Linux, macOS
- Dependencies: bash, curl, jq
name: context7
description: Fetches up-to-date third-party library documentation via the Context7 v2 REST API. Use when working with external packages and needing current API references, code examples, migration guides, or resolving package errors (stack traces, version mismatches, deprecated methods).
allowed-tools: [bash]
user-invocable: trueMIT License — See LICENSE for details.
- Context7 API by Upstash
- Original skill by Netresearch GmbH & Co. KG