Snippets is an intelligent code repository system that automatically extracts, processes, and indexes code snippets from GitHub repositories into a searchable vector database. It combines AI-powered code analysis with semantic search capabilities to help developers quickly find relevant code examples and patterns.
- 🚀 Use Your Claude Subscription: Access this tool with your Claude subscription plan. no extra cost!
- 🤖 Automated Repository Processing: Extract meaningful code snippets from any GitHub repository
- 🔍 Semantic Search: Find code by meaning, not just keywords, using vector embeddings
- 🔧 MCP Integration: Seamless integration with Claude Code through Model Context Protocol
- ⚡ Background Processing: Efficient queue-based processing for large repositories
- 🐳 Docker Ready: Complete containerized setup for easy deployment
- Repository Ingestion: Add GitHub repositories through the web interface
- AI Processing: Claude Code agents analyze and extract meaningful code snippets
- Vector Embedding: Code snippets are converted to semantic vectors using state-of-the-art models
- Smart Storage: Snippets are indexed in Qdrant vector database for fast similarity search
- Easy Discovery: Search and explore code through the web UI or integrate with Claude Code via MCP
- Docker & Docker Compose: For containerized deployment
- API Keys:
- Claude Code OAuth Token (from you subscription, claude setup-token)
- Google Gemini API key (for embeddings, you can claim Free API Key)
Create your environment file:
Edit docker/.env with your API keys:
This starts all services:
- Frontend: http://localhost:3000
- API with MCP server: http://localhost:8000 (api), http://localhost:8080/mcp (mcp)
- Worker: controlled by RQ
- Qdrant: http://localhost:6333
- Redis: localhost:6379
- Open http://localhost:3000 in your browser
- Enter a GitHub repository URL (e.g., https://github.com/user/repo)
- Click 'Embed'
- Monitor progress in the dashboard
- Search your snippets in 'Query' tab once processing completes!
This enables Claude Code to search your processed snippets directly during development.
The system requires minimal configuration for most use cases:
- Claude API Token: type claude setup-token in your terminal
- Gemini API Key: Get one from Google AI Studio
The web interface at http://localhost:3000 provides a complete repository management experience:
-
Add Repository:
- Go to 'Embed' Tab
- Enter GitHub URL (private repositories supported with your PAT token)
- Optional: Configure processing options (file filters, size limits)
- Start processing
-
Monitor Progress:
- Real-time processing status
- Progress indicators for extraction phases
- Error reporting for failed repositories
-
Repository Settings:
- Edit processing configuration
- Re-process with different settings
- Remove repositories and their snippets
-
Semantic Search:
- Go to 'Query' Tab
- Enter natural language queries ("authentication middleware", "error handling")
- Use technical terms ("async function", "React hooks")
- Search by programming concepts
- Optional: Configure search options (repository name, language)
-
Explore Snippets:
- View code with syntax highlighting
- See file context and repository source
- Copy snippets for use in your projects
The Snippets MCP server enables seamless integration with Claude Code for enhanced development workflows.
Once connected, Claude Code gains access to the search tool:
Search Parameters (will be configured automatically by claude code):
- query: Natural language description of what you're looking for
- limit: Number of results (default: 10, max: 50)
- repo_name: Filter to specific repository
- language: Filter by programming language
Use the MCP integration for:
- Code Discovery: Find examples before implementing new features
- Pattern Research: Explore different approaches to common problems
- Learning: Understand how concepts are implemented across repositories
- Code Review: Find similar implementations for comparison
Snippets is built as a microservices architecture with clear separation of concerns:
- Location: front/
- Purpose: Web interface for repository management and snippet search
- Technology: Next.js 14, React, TypeScript, Tailwind CSS
- Features:
- Repository CRUD operations
- Real-time processing status
- Semantic search interface
- Responsive design with dark/light themes
- Location: src/api/
- Purpose: REST API for all backend operations
- Technology: FastAPI, Python 3.12, Pydantic
- Endpoints:
- Repository management (/repo)
- Snippet search (/snippets)
- Location: src/worker/
- Purpose: Background processing of repositories
- Technology: RQ (Redis Queue), Redis
- Responsibilities:
- Repository cloning and analysis
- Code snippet extraction using AI agents
- Vector embedding generation
- Database storage operations
- Purpose: Store and search code snippet embeddings
- Technology: Qdrant vector database
- Features:
- High-performance similarity search
- Metadata filtering (language, repository)
- Scalable vector storage
- Built-in clustering and indexing
- Location: src/mcpserver/
- Purpose: Model Context Protocol integration
- Technology: FastMCP, mounted on main API
- Tools Provided:
- search: Semantic snippet search for Claude Code
- User Input: Repository URL submitted via web interface
- API Validation: URL validation and repository metadata extraction
- Queue Job: Processing job added to Redis queue
- Worker Processing:
- Clone repository to temporary storage
- Filter files by type and size
- Extract meaningful code snippets using Claude Code Agents
- Generate vector embeddings for each snippet
- Store in Qdrant with metadata
- Status Updates: Real-time status updates via polling
- Completion: Repository marked as processed, snippets available for search
- Query Input: User enters search query (Web UI or MCP)
- Query Embedding: Convert query to vector using same embedding model
- Vector Search: Qdrant performs similarity search with filters
- Result Ranking: Results reranked by cohere rerank API
- Response: Formatted results returned with snippet metadata
- FastAPI: Web framework and API server
- RQ + Redis: Task queue and caching
- Qdrant: Vector database
- Claude Agent Toolkit: Claude Code powered analysis
- Google Gemini: Text embedding generation
- Next.js: Frontend
- Docker Compose: Deployment
.png)


