MCP Mongo Server
MCP server by kiliczsh Verified · npm:mcp-mongo-server
Lets AI assistants work with MongoDB databases through the Model Context Protocol. It exposes collections, infers their schemas, and runs queries, aggregations, and writes. Useful for developers who want assistants to read and reason about their data.
Install MCP Mongo Server
Built from the published package, never by AI.
claude mcp add mcp-mongo-server -- npx -y mcp-mongo-serverRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"mcp-mongo-server": {
"args": [
"-y",
"mcp-mongo-server"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"mcp-mongo-server": {
"args": [
"-y",
"mcp-mongo-server"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"mcp-mongo-server": {
"args": [
"-y",
"mcp-mongo-server"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add mcp-mongo-server -- npx -y mcp-mongo-server{
"mcpServers": {
"mcp-mongo-server": {
"args": [
"-y",
"mcp-mongo-server"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add mcp-mongo-server npx -y mcp-mongo-serverGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the mcp-mongo-server block.
About
MCP Mongo Server is a Model Context Protocol server that lets AI assistants work with MongoDB databases. It exposes collections, infers their schemas, and runs queries, aggregations, and writes through a standard interface. Clients such as Claude Desktop and Cursor can then read and reason about the data.
It runs locally over stdio by default, or as an HTTP endpoint at /mcp for remote access. Read-only mode blocks all write paths, and cross-database and server-side JavaScript operators stay off unless enabled. It is aimed at developers who want assistants to explore MongoDB data, including standalone, replica set, sharded, and Atlas deployments.
Written from the project's README and checked against it.
Tools it gives your assistant
Read-Only ModeBlocks every write path, including insert, update, index creation, and $out or $merge stages.Smart ObjectId HandlingConfigurable auto, none, or force conversion of 24-character hex strings to ObjectIds.Schema InferenceDetects collection schemas automatically from document samples.Query & AggregationSupports query and aggregation pipelines, with optional explain plans.Write OperationsInsert, update, and index creation, when read-only mode is off.convertTimeTurns Unix timestamps and date strings into UTC, GMT, or ISO formats.Progress & CancellationLong operations report progress and can be cancelled mid-flight.Two TransportsRuns locally over stdio, or exposes an HTTP endpoint for remote access.
What you need
- Node.js 20 or newer
- A MongoDB database and connection URI
Try asking
- Show me the schema of each collection in my MongoDB database.
- Run an aggregation that counts orders per customer this month.
- Explore my database in read-only mode and summarize the main collections.
Good to know
- Read-only mode blocks all write operations when enabled.
- Cross-database aggregation stages are rejected unless --allow-cross-db is set.
- Server-side JavaScript operators are rejected unless --allow-server-js is set.
- HTTP mode accepts only requests from localhost or allowed browser origins by default.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to MCP Mongo Server
All alternatives →Connects Supabase projects to AI assistants such as Cursor, Claude and Windsurf over the Model Context Protocol. It lets assistants manage tables, fetch config and query data in a Supabase project.
ArcadeDB MCP Server is the built-in Model Context Protocol server of the ArcadeDB multi-model database. It lets AI assistants and LLMs work with ArcadeDB's graph, document, time-series, vector and other data models. It suits people who already run ArcadeDB and want assistant access to it.
Connects MCP clients such as Claude Desktop, Cursor and VS Code to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It exposes two tools by default, with read-only mode and query timeouts available as guardrails.
MCP Toolbox for Databases is an open source MCP server that connects AI agents, IDEs and applications to enterprise databases. It provides prebuilt tools for exploring schemas and running queries, plus a framework for custom tools. It is aimed at developers building agents that need database access.
Connects AI agents, IDEs and applications to enterprise databases through the Model Context Protocol. Offers prebuilt database tools for MCP clients and a framework for building custom tools for production agents.
MongoDB MCP Server lets AI assistants interact with MongoDB databases and MongoDB Atlas. It is an official server from mongodb-js, run locally with npx or Docker. It works with self-managed deployments and Atlas clusters.
Compare with Supabase, ArcadeDB MCP Server or DBHub
MCP Mongo Server: common questions
Is it safe to let an AI assistant use my MongoDB database?
The source says read-only mode blocks every write path, and cross-database and server-side JavaScript stages are off by default. It also recommends connecting with a MongoDB user that has only the permissions needed.
Which MongoDB deployments does it support?
The source says it connects to standalone, replica set, sharded, and Atlas deployments, over plain or TLS connections.
Can it run remotely instead of on my computer?
Yes. The source describes an HTTP transport that exposes an endpoint at /mcp, with an optional bearer token via --auth-token.
How do I install MCP Mongo Server?
In Claude Code run claude mcp add mcp-mongo-server -- npx -y mcp-mongo-server. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is MCP Mongo Server the official server?
MCP Mongo Server is published by npm:mcp-mongo-server from its verified domain in the official MCP Registry.
Is MCP Mongo Server free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is MCP Mongo Server safe to use?
It scores 79 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to MCP Mongo Server?
Similar MCP servers: Supabase, ArcadeDB MCP Server, DBHub, MCP Toolbox for Databases.
Does MCP Mongo Server work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
