Lightweight MCP wrapper for Context7 API - consolidates 2 tools into 1
npm install context7-lite-mcpLightweight MCP wrapper for Context7 API - consolidates 2 tools into 1.
context7-lite-mcp provides up-to-date, version-specific documentation for libraries and frameworks through a single MCP tool. It reduces context usage by ~80% compared to the standard Context7 MCP implementation.
- Single Tool Interface: All Context7 operations through one context7 tool
- Action-Based Dispatch: Use action parameter to select operation
- Full Context7 Coverage: Support for both library resolution and documentation retrieval
- Optimized for Claude Code: Minimal token overhead
``bash`
npm install context7-lite-mcp
Add to your MCP settings configuration:
`json`
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "context7-lite-mcp"],
"env": {
"CONTEXT7_API_KEY": "your-api-key-here"
}
}
}
}
Note: The CONTEXT7_API_KEY is optional. Without it, you'll have lower rate limits. Get your API key at context7.com/dashboard.
#### 1. resolve_library_id
Search for libraries by name and get Context7-compatible library IDs.
Parameters:
- libraryName (required): Name of the library to search forquery
- (optional): User's question or task - used to rank results by relevance
Example:
`json`
{
"action": "resolve_library_id",
"payload": {
"libraryName": "next.js",
"query": "how to setup routing"
}
}
#### 2. get_library_docs
Fetch up-to-date documentation for a library.
Parameters:
- context7CompatibleLibraryID (required): Library ID from resolve_library_id (e.g., "/vercel/next.js")topic
- (optional): Focus docs on specific topic (e.g., "routing", "hooks")tokens
- (optional): Maximum tokens to return (default: 5000, min: 1000)
Example:
`json`
{
"action": "get_library_docs",
"payload": {
"context7CompatibleLibraryID": "/vercel/next.js",
"topic": "routing",
"tokens": 5000
}
}
1. First, use resolve_library_id to find the library and get its Context7-compatible IDget_library_docs
2. Then, use with that ID to fetch the documentation
- Standard Context7 MCP: ~2 tools × 500 tokens = 1,000 tokens
- context7-lite: 1 tool × 200 tokens = 200 tokens
- Savings: ~80% reduction in context usage
Follows the superpowers-chrome pattern:
- Single tool with action` enum parameter
- Switch/dispatch based on action
- Direct API calls to Context7
MIT
- Context7 Documentation
- Context7 API Guide
- MCP Lite Wrappers