mongo
MCP server for mongoDB
claude mcp add --transport stdio matteturtle09-mongo-mcp-server npx -y mongo-mcp-server \ --env MONGO_URI="MongoDB connection string (e.g., mongodb://user:pass@host:port/db)"
How to use
This MCP server exposes MongoDB querying capabilities through MCP tools. The primary tool available is get-collection-documents, which retrieves documents from a specified collection within a database. To use it, provide the collection name and database name; the server will return a list of documents present in that collection. The tool is useful for quick data inspection, debugging queries, and integrating MongoDB data retrieval into larger MCP workflows.
How to install
Prerequisites:
- Node.js and npm installed on your machine
- Network access to the MongoDB instance you intend to query
Installation steps:
- Ensure npm is up to date:
npm install -g npm
- Install or run the MCP server via npx (no local install required):
npx -y mongo-mcp-server
- Alternatively, install the package locally or globally if you prefer:
npm install mongo-mcp-server
- Configure the MongoDB connection string via environment variables (see mcp_config for env vars).
- Start the server and begin issuing MCP tool calls (e.g., get-collection-documents).
Note: If your environment requires authentication or TLS, ensure MONGO_URI provides the appropriate connection string.
Additional notes
Environment variables:
- MONGO_URI: Required. The MongoDB connection string. Example: mongodb://user:password@host:27017/database Common issues:
- Unable to connect: verify network access to MongoDB, correct host/port, and authentication credentials in MONGO_URI.
- Missing collection or database: ensure the collection and database names are correct and exist.
- Timeouts: consider increasing server timeout settings if querying large collections. Configuration options may vary depending on the MCP server implementation; consult the project's docs for any additional flags or capabilities.
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