mongo
A mongo db server for the model context protocol (MCP)
claude mcp add --transport stdio quantgeekdev-mongo-mcp npx mongo-mcp mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin
How to use
This MongoDB MCP Server allows a language model to interact directly with MongoDB databases through natural language prompts. It exposes tools to inspect collection schemas, query documents with filters, manage indexes, and perform basic document operations such as insert, update, and delete. You can ask the model to list collections, view a collection's schema, find documents with specific criteria, or create and drop indexes. It supports practical workflows like querying for users by location, filtering products by category and price, or updating order statuses, all while leveraging MongoDB semantics under the hood.
How to install
Prerequisites:
- Node.js 18+ (NPM comes with Node.js)
- npx (usually installed with Node.js)
- Optional: Docker and Docker Compose for local sandbox testing
Install via npm/npx (fastest method):
# Ensure you have Node.js 18+ installed
# Install and run the MCP server via npx using your MongoDB connection string
npx -y mongo-mcp mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin
Install via Smithery (automated deployment):
npx -y @smithery/cli install mongo-mcp --client claude
Configure Claude Desktop or your MCP client with the server details. Example local development configuration if running directly:
{
"mcpServers": {
"mongodb": {
"command": "node",
"args": [
"dist/index.js",
"mongodb://root:example@localhost:27017/test?authSource=admin"
]
}
}
}
Test sandbox setup (optional):
- Start a MongoDB sandbox with Docker Compose:
docker-compose up -d
- Seed the database with test data:
npm run seed
Additional notes
Tips:
- Replace the placeholder MongoDB connection string with your actual credentials and host. Ensure network access from your MCP client to the MongoDB instance.
- For local development, you can run the server in Node mode using dist/index.js as shown in the configuration example.
- If you use Smithery, you can install and manage the mongo-mcp package through the Smithery CLI for easier client integration (Claude, etc.).
- Common issues: ensure Node.js 18+ is installed, that MongoDB is reachable, and that authentication sources (authSource) match your MongoDB setup. If you encounter connection errors, verify your URI format and network access.
- This MCP server exposes: find, listCollections, insertOne, updateOne, deleteOne, createIndex, dropIndex, and indexes for managing MongoDB state via natural language prompts.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud