aiskillstore/marketplace / skills/92bilal26/context7-efficient
context7-efficient
VerifiedToken-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.8 KB |
| references/context7-tools.md | markdown | 7.9 KB |
| scripts/extract-code-blocks.sh | script | 1000 B |
| scripts/extract-notes.sh | script | 381 B |
| scripts/extract-signatures.sh | script | 809 B |
| scripts/fetch-docs.sh | script | 5.7 KB |
| scripts/fetch-raw.sh | script | 760 B |
| scripts/mcp-client.py | script | 16.4 KB |
| scripts/start-server.sh | script | 644 B |
| scripts/stop-server.sh | script | 704 B |
| skill-report.json | config | 138.4 KB |
references/context7-tools.md
View on GitHub# Context7 MCP Tools
*2 tools available*
## `resolve-library-id`
Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.
You MUST call this function before 'get-library-docs' to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.
### Selection Process
1. Analyze the query to understand what library/package the user is looking for
2. Return the most relevant match based on:
- Name similarity to the query (exact matches prioritized)
- Description relevance to the query's intent
- Documentation coverage (prioritize libraries with higher Code Snippet counts)
- Source reputation (consider libraries with High or Medium reputation more authoritative)
- Benchmark Score: Quality indicator (100 is the highest score)
### Parameters
- **`libraryName`** (`string`) *(required)*: Library name to search for and retrieve a Context7-compatible library ID
### Response Format
Returns a list of matching libraries with:
- Title
- Context7-compatible library ID (e.g., `/reactjs/react.dev`)
- Code Snippets count
- Source Reputation (High/Medium/Low)
- Benchmark Score
- Description
### Examples
```bash
# Find React library
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t resolve-library-id \
-p '{"libraryName": "react"}'
# Find Next.js library
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t resolve-library-id \
-p '{"libraryName": "next.js"}'
# Find MongoDB library
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t resolve-library-id \
-p '{"libraryName": "mongodb"}'
```
<details>
<summary>Full Schema</summary>
```json
{
"type": "object",
"properties": {
"libraryName": {
"type": "string",
"description": "Library name to search for and retrieve a Context7-compatible library ID."
}
},
"required": ["libraryName"]
}
```
</details>
## `get-library-docs`
Fetches up-to-date documentation for a library. You must call 'resolve-library-id' first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.
Use mode='code' (default) for API references and code examples, or mode='info' for conceptual guides, narrative information, and architectural questions.
### Parameters
- **`context7CompatibleLibraryID`** (`string`) *(required)*: Exact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format '/org/project' or '/org/project/version'
- **`topic`** (`string`) *(optional)*: Topic to focus documentation on (e.g., 'hooks', 'routing')
- **`mode`** (`string`) *(optional, default: "code")*: Documentation mode
- `code`: API references and code examples (default)
- `info`: Conceptual guides, narrative information, and architectural questions
- **`page`** (`integer`) *(optional, default: 1)*: Page number for pagination (start: 1, default: 1). If the context is not sufficient, try page=2, page=3, page=4, etc. with the same topic. Range: 1-10
### Examples
```bash
# Get React hooks documentation (code mode)
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/reactjs/react.dev", "topic": "hooks", "mode": "code", "page": 1}'
# Get conceptual information about Next.js routing
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/vercel/nextjs.org", "topic": "routing", "mode": "info"}'
# Get MongoDB aggregation examples
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/mongodb/docs", "topic": "aggregation", "mode": "code"}'
# Get additional pages for more details
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/reactjs/react.dev", "topic": "hooks", "mode": "code", "page": 2}'
```
<details>
<summary>Full Schema</summary>
```json
{
"type": "object",
"properties": {
"context7CompatibleLibraryID": {
"type": "string",
"description": "Exact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format '/org/project' or '/org/project/version'."
},
"topic": {
"type": "string",
"description": "Topic to focus documentation on (e.g., 'hooks', 'routing')."
},
"mode": {
"type": "string",
"enum": ["code", "info"],
"default": "code",
"description": "Documentation mode: 'code' for API references and code examples (default), 'info' for conceptual guides, narrative information, and architectural questions."
},
"page": {
"type": "integer",
"minimum": 1,
"maximum": 10,
"default": 1,
"description": "Page number for pagination (start: 1, default: 1). If the context is not sufficient, try page=2, page=3, page=4, etc. with the same topic."
}
},
"required": ["context7CompatibleLibraryID"]
}
```
</details>
## Usage Patterns
### Pattern 1: Unknown Library
When you don't know the exact library ID:
```bash
# Step 1: Resolve library name
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t resolve-library-id -p '{"libraryName": "express"}'
# Step 2: Use returned ID to fetch docs
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/expressjs/expressjs.com", "topic": "middleware"}'
```
### Pattern 2: Known Library ID
When you know the library ID:
```bash
# Direct fetch (skip resolve step)
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/reactjs/react.dev", "topic": "useState"}'
```
### Pattern 3: Exploring Multiple Topics
```bash
# Get overview first
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/prisma/docs", "topic": "getting started", "mode": "info"}'
# Then drill into specifics
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/prisma/docs", "topic": "queries", "mode": "code"}'
```
### Pattern 4: Pagination for Deep Research
```bash
# Get first page
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/reactjs/react.dev", "topic": "hooks", "page": 1}'
# Get additional pages as needed
python3 scripts/mcp-client.py call -s "npx -y @upstash/context7-mcp" \
-t get-library-docs \
-p '{"context7CompatibleLibraryID": "/reactjs/react.dev", "topic": "hooks", "page": 2}'
```
## Common Library IDs
Quick reference for popular libraries:
| Library | Context7 ID |
|---------|-------------|
| React | `/reactjs/react.dev` |
| Next.js | `/vercel/nextjs.org` |
| Express | `/expressjs/expressjs.com` |
| MongoDB | `/mongodb/docs` |
| Prisma | `/prisma/docs` |
| Vue | `/vuejs/docs` |
| Svelte | `/sveltejs/svelte.dev` |
| FastAPI | `/tiangolo/fastapi` |
| Django | `/django/docs` |
## Tips
1. **Library Resolution**: Always use `resolve-library-id` first unless you have the exact ID
2. **Mode Selection**: Use `code` mode for examples, `info` mode for concepts
3. **Topic Specificity**: More specific topics yield better results
4. **Pagination**: If results are insufficient, try `page: 2` or refine the topic
5. **Fallback**: If no results, try broader topics or switch modes
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |