MCP Codebase Index
Enables semantic search across your codebase using Google's Gemini embeddings and Qdrant Cloud vector storage. Supports 15+ programming languages with smart code chunking and real-time file change monitoring.
README
MCP Codebase Index Server
AI-powered semantic search for your codebase in Claude Desktop
A Model Context Protocol (MCP) server that enables Claude to search and understand your codebase using Google's Gemini embeddings and Qdrant Cloud vector storage.
✨ Features
- 🔍 Semantic Search: Find code by meaning, not just keywords
- 🎯 Smart Chunking: Automatically splits code into logical functions/classes
- 🔄 Real-time Watch: Monitors file changes and updates index automatically
- 🌐 Multi-language: Supports 15+ programming languages
- ☁️ Cloud Storage: Uses Qdrant Cloud for persistent vector storage
- 📦 Simple Setup: Just 4 environment variables to get started
🚀 Quick Start
Prerequisites
- Gemini API Key: Get free at Google AI Studio
- Qdrant Cloud Account: Sign up free at cloud.qdrant.io
Installation
Add to your claude_desktop_config.json:
{
"mcpServers": {
"codebase": {
"command": "npx",
"args": ["-y", "@ngotaico/mcp-codebase-index"],
"env": {
"REPO_PATH": "/absolute/path/to/your/project",
"GEMINI_API_KEY": "AIzaSyC...",
"QDRANT_URL": "https://your-cluster.gcp.cloud.qdrant.io:6333",
"QDRANT_API_KEY": "eyJhbGci..."
}
}
}
}
All 4 variables are required:
| Variable | Where to Get | Example |
|---|---|---|
REPO_PATH |
Absolute path to your project | /Users/you/Projects/myapp |
GEMINI_API_KEY |
Google AI Studio | AIzaSyC... |
QDRANT_URL |
Qdrant Cloud cluster URL | https://xxx.gcp.cloud.qdrant.io:6333 |
QDRANT_API_KEY |
Qdrant Cloud API key | eyJhbGci... |
Restart Claude Desktop
The server will automatically:
- Connect to your Qdrant Cloud cluster
- Create a collection (if needed)
- Index your entire codebase
- Watch for file changes
📖 Usage
Ask Claude to search your codebase:
"Find the authentication logic"
"Show me how database connections are handled"
"Where is error logging implemented?"
"Find all API endpoint definitions"
🎛️ Configuration
Required Variables
{
"env": {
"REPO_PATH": "/Users/you/Projects/myapp",
"GEMINI_API_KEY": "AIzaSyC...",
"QDRANT_URL": "https://xxx.gcp.cloud.qdrant.io:6333",
"QDRANT_API_KEY": "eyJhbGci..."
}
}
Optional Variables
{
"env": {
"QDRANT_COLLECTION": "my_project",
"WATCH_MODE": "true",
"BATCH_SIZE": "50"
}
}
| Variable | Default | Description |
|---|---|---|
QDRANT_COLLECTION |
codebase |
Collection name in Qdrant |
WATCH_MODE |
true |
Auto-update on file changes |
BATCH_SIZE |
50 |
Embedding batch size |
🔧 Setup Guides
- SETUP.md - Detailed setup walkthrough
- QDRANT_CLOUD_SETUP.md - Get Qdrant credentials
- QUICK_REF.md - Quick reference card
🌍 Supported Languages
Python • TypeScript • JavaScript • Dart • Go • Rust • Java • Kotlin • Swift • Ruby • PHP • C • C++ • C# • Shell • SQL • HTML • CSS
📝 How It Works
┌─────────────┐
│ Your Code │
└──────┬──────┘
│
▼
┌─────────────────┐
│ File Watcher │ Monitors changes
└──────┬──────────┘
│
▼
┌─────────────────┐
│ Code Parser │ Splits into chunks
└──────┬──────────┘
│
▼
┌─────────────────┐
│ Gemini API │ Creates embeddings
└──────┬──────────┘
│
▼
┌─────────────────┐
│ Qdrant Cloud │ Stores vectors
└──────┬──────────┘
│
▼
┌─────────────────┐
│ Claude Search │ Semantic queries
└─────────────────┘
🐛 Troubleshooting
Server not appearing in Claude?
Check Claude logs:
tail -f ~/Library/Logs/Claude/mcp*.log
Common issues:
- ❌
REPO_PATHmust be absolute path - ❌ All 4 env variables must be set
- ❌ Qdrant URL must include
:6333port - ❌ Gemini API key must be valid
Can't connect to Qdrant?
Test connection:
curl -H "api-key: YOUR_KEY" \
https://YOUR_CLUSTER.gcp.cloud.qdrant.io:6333/collections
Should return JSON with collections list.
Indexing too slow?
- Large repos (1000+ files) take 5-10 minutes initially
- Reduce
BATCH_SIZEif hitting rate limits - Check Gemini API quota: aistudio.google.com
📊 Performance
- Embedding speed: ~100 chunks/minute (Gemini API)
- Search latency: <100ms (Qdrant Cloud)
- Storage: ~1KB per code chunk
- Recommended: <10K chunks per collection
📄 License
MIT © NgoTaiCo
🤝 Contributing
Issues and PRs welcome at github.com/NgoTaiCo/mcp-codebase-index
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.