context7
2
总安装量
2
周安装量
#74856
全站排名
安装命令
npx skills add https://github.com/millionthodin16/clawd-explorations --skill context7
Agent 安装分布
codex
2
claude-code
2
antigravity
2
windsurf
1
opencode
1
Skill 文档
Context7 – Codebase Q&A
Codebase-specific context provider that indexes documentation and answers questions about your codebase.
Status
â INSTALLED via npm
npm install -g @upstash/context7-mcp
which context7-mcp # /home/opc/.nvm/versions/node/v22.20.0/bin/context7-mcp
Setup
Environment variables required:
export CONTEXT7_API_KEY="your-api-key"
export UPSTASH_REST_API_TOKEN="your-redis-token"
export UPSTASH_REST_API_URL="https://your-db.upstash.io"
Usage
CLI Commands
# Index a codebase
uv run {baseDir}/scripts/context7.py index /path/to/codebase
# Query the codebase
uv run {baseDir}/scripts/context7.py query "How does the memory system work?"
# List indexed codebases
uv run {baseDir}/scripts/context7.py list
# Clear index
uv run {baseDir}/scripts/context7.py clear
Unified Runner
# Using skill.py (preferred)
python scripts/skill.py context7 query "How does memory work?"
# Direct
uv run {baseDir}/scripts/context7.py query "How does memory work?"
Common Patterns
Pattern 1: Ask about a file
python scripts/skill.py context7 query "How does TOOLS.md work?"
Pattern 2: Understand a system
python scripts/skill.py context7 query "Explain the memory architecture"
Pattern 3: Find implementation
python scripts/skill.py context7 query "Where is the qmd search implemented?"
Pattern 4: Quick code lookup
python scripts/skill.py context7 query "What does the exec function do?"
Efficiency Tips
- Natural language works – Ask full questions, not keywords
- Be specific – “How does the memory consolidation work?” > “memory”
- Use context – Reference files you want to understand
- Chain queries – Ask follow-up questions for deeper understanding
When to Use
| Task | Use This | Alternative |
|---|---|---|
| Natural language Q&A | Context7 | qmd search |
| Complex codebase questions | Context7 | rg "pattern" |
| Quick keyword search | N/A | rg or qmd |
Why Context7?
| Feature | Context7 | Current (qmd/rg) |
|---|---|---|
| Natural language query | â Yes | â Keyword only |
| Codebase-specific | â Yes | â Yes |
| Persistent index | â Redis | â Re-index each time |
| AI-optimized | â Yes | â No |
| Context injection | â Auto | Manual |
Quick Reference
| Command | Description |
|---|---|
skill.py context7 query "..." |
Ask a question |
skill.py context7 index /path |
Index codebase |
skill.py context7 list |
List indexes |
Files
scripts/context7.py– CLI wrapper- MCP server:
context7-mcp
See Also
- memory-keeper skill – Persistent context across sessions
- Full research:
memory/MCP-SERVERS-RESEARCH.md - Context7 GitHub: https://github.com/upstash/context7