MongoDocs MCP
Semantic search for MongoDB and Voyage AI documentation using Voyage Context-3 embeddings and MongoDB Atlas Vector Search.
🚀 Features
- Voyage Context-3 Embeddings: State-of-the-art contextualized embeddings that understand document structure
- MongoDB Atlas Vector Search: Native vector search with
$vectorSearch
aggregation
- MongoDB + Voyage AI Docs: Search both MongoDB and Voyage AI documentation (since MongoDB acquired Voyage)
- Smart Query Expansion: Automatically expands MongoDB and Voyage AI terms for better recall
- Incremental Updates: Keep documentation current with efficient refresh mechanism
- Simple Setup: Interactive wizard guides you through configuration
📦 Installation
npm install -g mongodocs-mcp
🔧 Setup
Prerequisites
- MongoDB Atlas Cluster (M10 or higher for vector search)
- Voyage AI API Key (get it at voyageai.com)
Quick Start
npx mongodocs-mcp setup
- Add to your MCP configuration (
.mcp.json
or Claude settings):
{
"mcpServers": {
"mongodocs": {
"command": "npx",
"args": ["mongodocs-mcp"]
}
}
}
🛠️ Available Tools
mongodb-semantic-search
Search MongoDB documentation using natural language:
Query: "how to create indexes"
Returns: Relevant documentation about indexing, performance optimization, index types
mongodb-find-similar
Find documentation similar to provided content:
Content: "db.collection.aggregate([...])"
Returns: Related aggregation documentation
mongodb-explain-concept
Get comprehensive explanations at different depth levels:
Concept: "sharding"
Depth: "intermediate"
Returns: Detailed explanation of MongoDB sharding
mongodb-refresh-docs
Update documentation database:
Mode: "incremental" | "full"
mongodb-status
Check system status and statistics.
🏗️ Architecture
MongoDB Docs (GitHub) + Voyage AI Docs (GitHub)
↓
Document Fetchers
↓
Smart Chunker (512 tokens, no overlap)
↓
Voyage Context-3 (contextualized embeddings)
↓
MongoDB Atlas Vector Search
↓
MCP Tools
🔑 Key Innovations
- Contextualized Embeddings: Each chunk understands its place in the full document
- Unified Search: Search across MongoDB and Voyage AI docs seamlessly (MongoDB acquired Voyage)
- Query Expansion: Search for "index" also searches "indexes", "indexing", "createIndex"
- Zero Overlap Chunking: More efficient than traditional overlapping chunks
- Cloud-Native: Everything runs in MongoDB Atlas, no local storage needed
📊 Performance
- Search Latency: 50-200ms
- Embedding Quality: 1024-dimensional vectors
- Storage: ~500MB for complete MongoDB documentation
- Free Tier: First 200M Voyage tokens free
🔄 Updating Documentation
To refresh documentation:
npx mongodocs-mcp refresh
npx mongodocs-mcp refresh --full
🧪 Testing
Test your installation:
npx mongodocs-mcp test
📝 Environment Variables
Create a .env
file with:
MONGODB_URI=mongodb+srv://...
VOYAGE_API_KEY=pa-...
MONGODB_DATABASE=mongodocs
INCLUDE_VOYAGE_DOCS=true # Include Voyage AI documentation
GITHUB_TOKEN=ghp_... # Optional: Avoid rate limits
🤝 Contributing
Contributions welcome! This project uses:
- TypeScript
- MongoDB Atlas Vector Search
- Voyage AI Context-3 embeddings
- Model Context Protocol (MCP)
📄 License
MIT
🙏 Acknowledgments
Built with:
Made with ❤️ for the MongoDB and AI community