🗄️ MongoDB MCP Server for LLMS
A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.
Potencialize seu agente
Instalação do publicador. Não é um endpoint do PlugMCP.
Host a copy with our keys and logs.
Ainda não há uma versão empacotada no registro. Siga o README do repositório.
URL remota ou um comando na sua máquina? Como as duas instalações diferem
Rodar no PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirDo publicador
A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.
MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB
The Model Context Protocol (MCP) is an open standard developed by Anthropic that creates a universal way for AI systems to connect with external data sources and tools. MCP establishes a standardized communication channel between:
Key benefits of MCP:
Before you begin, ensure you have:
You can verify your Node.js installation by running:
node --version # Should show v18.0.0 or higher
To get started, find your MongoDB connection URL and add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"mongo-mcp",
"mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin"
]
}
}
}
Smithery.ai is a registry platform for MCP servers that simplifies discovery and installation. To install MongoDB MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mongo-mcp --client claude
To use MongoDB MCP with Cursor.ai:
mongodbnpxmongo-mcp mongodb://<username>:<password>@<host>:<port>/<database>?authSource=adminNote: Cursor currently supports MCP tools only in the Agent in Composer feature.
If you don't have a MongoDB server to connect to and want to create a sample sandbox, follow these steps:
docker-compose up -d
npm run seed
Add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mongodb": {
"command": "node",
"args": [
"dist/index.js",
"mongodb://root:example@localhost:27017/test?authSource=admin"
]
}
}
}
The seed script creates three collections with sample data:
Try these prompts with Claude to explore the functionality:
"What collections are available in the database?"
"Show me the schema for the users collection"
"Find all users in San Francisco"
"Find all electronics products that are in stock and cost less than $1000"
"Show me all orders from the user [email protected]"
"List the products with ratings above 4.5"
"What indexes exist on the users collection?"
"Create an index on the products collection for the 'category' field"
"List all indexes across all collections"
"Insert a new product with name 'Gaming Laptop' in the products collection"
"Update the status of order with ID X to 'shipped'"
"Find and delete all products that are out of stock"
The server provides these tools for database interaction:
listCollections: Lists available collections in the databasefind: Queries documents with filtering and projectioninsertOne: Inserts a single document into a collectionupdateOne: Updates a single document in a collectiondeleteOne: Deletes a single document from a collectioncreateIndex: Creates a new index on a collectiondropIndex: Removes an index from a collectionindexes: Lists indexes for a collectionThis project is built with:
To set up the development environment:
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev
# Run tests
npm test
When using this MCP server with your MongoDB database:
readPreference=secondary)⚠️ IMPORTANT: Always follow the principle of least privilege when configuring database access.
The MongoDB MCP server:
All operations are executed with proper validation to prevent security issues such as injection attacks.
You can deploy this MCP server in several ways:
npm install -g @coderay/mongo-mcp-serverConnection Errors
Authentication Issues
authSource=admin)Tool Execution Problems
# macOS
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
Performance Issues
If you encounter issues:
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB
Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Este registro não lista nenhuma variável de ambiente obrigatória.
Mongo roda localmente via stdio.
Última verificação: 2026-10-26. MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB