mongodocs-mcp
Version:
Lightning-fast semantic search for MongoDB documentation via Model Context Protocol. 10,000+ documents, <500ms search.
259 lines (212 loc) โข 5.52 kB
Markdown
# ๐ MongoDB Semantic MCP
[](https://www.npmjs.com/package/mongodocs-mcp)
[](LICENSE)
[](package.json)
[](https://github.com/romiluz13/MongoDocs-MCP)
Lightning-fast semantic search for MongoDB & Voyage AI documentation via Model Context Protocol (MCP).
## โจ Features
- **๐ Semantic Search**: Natural language queries across 10,000+ MongoDB documents
- **โก Lightning Fast**: <500ms search latency with vector embeddings
- **๐จ Beautiful CLI**: Professional interface with ASCII art and progress bars
- **๐ง Smart AI**: Uses voyage-code-3 for code, voyage-3 for text
- **๐ Comprehensive**: 52 documentation sources, 10,392 documents indexed
- **๐ Hybrid Search**: Combines vector + keyword search for best results
- **๐ฏ MCP Integration**: Seamlessly works with Cursor IDE and other MCP clients
## ๐ฆ Installation
### Via NPM (Recommended)
```bash
npm install -g mongodocs-mcp
```
### For Cursor IDE
Add to your MCP settings (`~/.cursor/mcp.json`):
```json
{
"mcpServers": {
"mongodocs": {
"command": "npx",
"args": ["mongodocs-mcp"],
"env": {
"MONGODB_URI": "your-mongodb-uri",
"VOYAGE_API_KEY": "your-voyage-key"
}
}
}
}
```
## ๐ Quick Start
### Prerequisites
- Node.js 18+
- MongoDB Atlas cluster (free tier works!)
- Voyage AI API key ([Get one here](https://voyage.ai))
### 1. Install
```bash
npm install -g mongodocs-mcp
```
### 2. Setup (Interactive Wizard)
```bash
mongodocs-setup
```
The beautiful setup wizard will guide you through:
- ๐ MongoDB Atlas connection
- ๐ Voyage AI API key
- ๐ Vector index creation
### 3. Index Documentation (One-time)
```bash
mongodocs-index
```
Indexes 10,000+ documents from:
- MongoDB Manual (v8.0)
- All major drivers (Node.js, Python, Go, etc.)
- Atlas documentation
- GenAI showcase examples
- Voyage AI documentation
### 4. Start MCP Server
```bash
mongodocs-mcp
```
### 5. Configure Cursor IDE
Add to `~/.cursor/mcp.json`:
```json
{
"mcpServers": {
"mongodocs": {
"command": "npx",
"args": ["mongodocs-mcp"],
"env": {
"MONGODB_URI": "your-mongodb-uri",
"VOYAGE_API_KEY": "your-voyage-key"
}
}
}
}
```
## ๐ ๏ธ MCP Tools
### `search_mongodb_docs`
Search MongoDB documentation using natural language.
```javascript
{
"query": "how to create compound index",
"limit": 5,
"products": ["manual", "nodejs"]
}
```
### `explain_mongodb_concept`
Get detailed explanations of MongoDB concepts.
```javascript
{
"concept": "aggregation pipeline",
"depth": "intermediate"
}
```
### `find_similar_docs`
Find documents similar to provided content.
```javascript
{
"content": "db.collection.createIndex({field1: 1, field2: -1})",
"limit": 5
}
```
### `get_search_status`
Get system status and statistics.
```javascript
// Returns document count, products indexed, health status
```
## ๐ Performance
- **Documents**: 10,392 indexed
- **Search Latency**: <500ms average
- **Relevance Scores**: 0.75-0.89 typical
- **Index Size**: ~140MB
- **Memory Usage**: <500MB
## ๐จ Beautiful CLI
The CLI features:
- ASCII art with gradient colors
- Real-time progress bars
- Animated spinners
- Styled tables
- Interactive prompts
```
__ __ ____ ____
| \/ | ___ _ __ __ _ ___| _ \| __ )
| |\/| |/ _ \| '_ \ / _` |/ _ \ | | | _ \
| | | | (_) | | | | (_| | (_) | |_| | |_) |
|_| |_|\___/|_| |_|\__, |\___/|____/|____/
|___/
๐ Semantic Search MCP Server
```
## ๐ง Configuration
### Environment Variables
```bash
# Required
MONGODB_URI=mongodb+srv://...
VOYAGE_API_KEY=pa-...
# Optional
MONGODB_DATABASE=mongodb_semantic_docs # Default
MONGODB_COLLECTION=documents # Default
```
### MongoDB Atlas Setup
1. Create Atlas cluster
2. Enable Vector Search
3. Create index named `vector_index`:
```json
{
"fields": [{
"type": "vector",
"path": "embedding",
"numDimensions": 1024,
"similarity": "cosine"
}]
}
```
## ๐ Documentation Sources
### Tier 1 - Core Documentation
- MongoDB Manual (v8.0)
- MongoDB Atlas Documentation
- MongoDB Shell Documentation
### Tier 2 - Language Drivers
- Node.js Driver
- Python (PyMongo & Motor)
- Go Driver
- Java Driver
- Rust Driver
### Tier 3 - Specialized
- GenAI Showcase (RAG patterns)
- Voyage AI SDKs
- LangChain MongoDB
- Vector Search Lab
[Full list of 52 sources โ](DOCUMENT_SOURCES.md)
## ๐งช Development
### Build from Source
```bash
git clone https://github.com/romiluz/mongodocs-mcp.git
cd mongodocs-mcp
npm install
npm run build
```
### Run Tests
```bash
npm test
```
### Local Development
```bash
npm run dev
```
## ๐ค Contributing
Contributions welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Add tests for new features
4. Submit a PR
## ๐ License
MIT ยฉ Rom Iluz
## ๐ Acknowledgments
- MongoDB for comprehensive documentation
- Voyage AI for powerful embeddings
- Anthropic for Model Context Protocol
- The MCP community
## ๐ Stats
- **Version**: 8.0.0
- **Downloads**: 
- **Size**: ~100KB packed
- **Dependencies**: 20
---
Built with โค๏ธ for the MongoDB community