Crawls and indexes documentation from GitHub repositories, providing version-specific documentation and code examples for libraries hosted on GitHub.
Context7 MCP Clone - Up-to-Date Code Documentation for LLMs
A production-ready clone of Context7 MCP that provides up-to-date, version-specific documentation and code examples directly to LLMs and AI code editors.
π― Project Status
Phase 2 Complete: Core MCP Server and Backend API ready for development!
Completed Components
β pnpm monorepo with workspace configuration
β Docker Compose development and production environments
β PostgreSQL database schema with migrations
β NestJS backend API with authentication
β Library and documentation services
β MCP server with both tools (resolve-library-id, get-library-docs)
β Stdio and HTTP transports for MCP protocol
In Progress
π Rate limiting with Redis
π Crawler engine with GitHub API and web scraping
π Markdown and HTML parsing with code extraction
π Next.js web UI with Grafana theme
π¦ Project Structure
π Quick Start
Prerequisites
Node.js 20+
pnpm 8+
Docker & Docker Compose
PostgreSQL 16+ (or use docker-compose)
Development Setup
Clone and install dependencies
Set up environment
Start development environment with Docker
This starts:
PostgreSQL database on port 5432
Redis cache on port 6379
Backend API on port 5000
MCP Server on port 3000
Web UI on port 4000
Run migrations
π MCP Server
Tools Available
1. resolve-library-id
Converts a library name to Context7-compatible ID and returns ranked results.
Input:
Output:
2. get-library-docs
Retrieves version-specific documentation and code examples.
Input:
Output:
Running MCP Server
Stdio Mode (for Claude Desktop, Cursor, etc.)
HTTP Mode
π Backend API
Authentication
Register
Login
Libraries
Search Libraries
Get Library by ID
Get Available Ecosystems
Documentation
Get Documentation
Search Documentation
Swagger Documentation
Once the backend is running, visit:
π Database Schema
Core Tables
users - User accounts with tier system
api_keys - API key management with rate limits
libraries - Library metadata
library_versions - Version tracking
documentation_pages - Documentation content with full-text search
code_examples - Code snippets
crawl_jobs - Crawler job tracking
api_usage - Usage analytics
Features
Full-text search on documentation
Trigram similarity for fuzzy matching
JSONB metadata support
Automatic tsvector updates
Materialized views for popular libraries
π Deployment
Production Docker Compose
Environment Variables
See .env.example for all available options:
DATABASE_URL- PostgreSQL connection stringREDIS_URL- Redis connection stringJWT_SECRET- JWT signing keyNODE_ENV- production/developmentAPI_PREFIX- API base path (default: /api/v1)
Kubernetes Deployment
Deploy manifests are in the plan for Phase 8.
π Development Roadmap
Phase 3: Crawler Engine (Weeks 5-6)
BullMQ job queue setup
GitHub crawler with Octokit
Documentation site scraper
Markdown/HTML parsers
Code extraction engine
Phase 4: Web UI (Weeks 7-8)
Next.js 15 setup with App Router
Landing page with purple gradient theme
Documentation browser
Authentication pages
Phase 5: Dashboard & Admin (Weeks 9-10)
User dashboard
API key management
Admin panel
Analytics and charts
Phase 6-10: Completion & Launch
Data seeding
Testing & optimization
Production deployment
Beta & public launch
π§ͺ Testing
π Code Style
π Debugging
Backend API
MCP Server
Docker Logs
π Documentation
PLAN.md - Comprehensive implementation plan with architecture
TODO.md - Detailed task checklist for all phases
API Docs - Available at
http://localhost:5000/docs(Swagger)
π€ Contributing
This is a solo development project. Please follow:
TypeScript strict mode
ESLint configuration
Prettier formatting
80%+ test coverage
π License
MIT
π― Key Metrics (Target)
Performance: MCP response <200ms (p95)
Search: <100ms (p95)
Uptime: 99.9%
Coverage: 100+ libraries by month 6
Users: 1000+ registered by month 3
Next Steps
Run
docker-compose -f docker-compose.dev.yml upWait for migrations to complete
Visit http://localhost:5000/docs for API documentation
Start using the MCP server with Claude Desktop or Cursor
Reference PLAN.md for detailed architecture and TODO.md for task tracking