Package Exports
- mongodocs-mcp
- mongodocs-mcp/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mongodocs-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mongodocs-mcp
MongoDB documentation MCP server for Claude/Cursor. Search MongoDB docs, tutorials, and AI examples directly in your AI editor.
What This Does
Provides MongoDB knowledge to Claude/Cursor through semantic search of:
- Official MongoDB documentation
- GenAI examples (RAG, Vector Search)
- Production code examples
- Interactive tutorials
Prerequisites
- MongoDB Atlas account (free tier works)
- Voyage AI API key for embeddings
- Node.js 18+
- Cursor or Claude Desktop
Installation
Step 1: Get Your Keys
MongoDB Atlas Connection String
- Go to MongoDB Atlas
- Create free cluster (M0)
- Click "Connect" → "Drivers"
- Copy connection string (starts with
mongodb+srv://)
Voyage AI API Key
- Go to Voyage AI
- Sign up and get API key
- Copy key (starts with
pa-)
Step 2: Install Package
npm install -g mongodocs-mcpStep 3: Index Documentation (One-Time Setup)
# Set your keys
export MONGODB_URI="mongodb+srv://YOUR_CONNECTION_STRING"
export VOYAGE_API_KEY="pa-YOUR_API_KEY"
# Index documentation (takes ~15 minutes)
mongodocs-indexThis downloads and indexes ~10,000 documents from:
- MongoDB official docs
- GenAI Showcase (3.9k stars)
- MongoDB Chatbot (RAG implementation)
- Vector Search tutorials
- Multimodal AI examples
Step 4: Configure Cursor
Add to .cursor/settings.json in your project:
{
"mcpServers": {
"mongodocs": {
"command": "npx",
"args": ["mongodocs-mcp"],
"env": {
"MONGODB_URI": "mongodb+srv://YOUR_CONNECTION_STRING",
"VOYAGE_API_KEY": "pa-YOUR_API_KEY"
}
}
}
}Restart Cursor after adding configuration.
Usage
In Cursor/Claude
Ask questions like:
- "How do I implement vector search in MongoDB?"
- "Show me RAG examples with MongoDB"
- "How to create a search index?"
The MCP provides three search methods:
- Semantic search - finds conceptually related docs
- Keyword search - exact term matching
- Hybrid search - combines both methods
Keep Documentation Updated
# Weekly update (only re-indexes changed files)
mongodocs-index updateCLI Commands
mongodocs-index # Full index (first time)
mongodocs-index update # Smart update (only changed files)
mongodocs-index clean # Clear database
mongodocs-index stats # Show statistics
mongodocs-index test # Test embeddingsTroubleshooting
"Database is empty"
Run mongodocs-index to populate database.
"Dimension mismatch error"
Clean and re-index:
mongodocs-index clean
mongodocs-index"Connection refused"
Check MongoDB URI and network access:
- Atlas → Network Access → Add your IP
- Verify connection string is correct
"Rate limit exceeded"
Voyage AI free tier limit hit. Wait or upgrade plan.
Architecture
- Embeddings: voyage-context-3 (1024 dimensions)
- Database: MongoDB Atlas
- Search: Vector search + text search with RRF
- Repositories: 5 curated MongoDB repos
- Updates: Git-based incremental indexing
Performance
- Initial index: ~15 minutes
- Smart update: ~2 minutes
- Search latency: <500ms
- Documents: ~10,000
- Storage: ~200MB in MongoDB
Development
# Clone repo
git clone https://github.com/romiluz/mongodocs-mcp.git
cd mongodocs-mcp
# Install dependencies
npm install
# Build
npm run build
# Run locally
npm startLicense
MIT
Support
- Issues: GitHub Issues
- Author: Rom Iluz