MongoDB MCP Server
MongoDB databases, collections, and documents accessible directly via MCP protocols.
Data last scanned today · Reviewed today
Overview
This TypeScript-based MCP server facilitates interaction with MongoDB instances by providing tools for database listing, collection management, and schema analysis. Users can perform document lookups, run aggregations using native syntax, and retrieve performance statistics or logs directly through their AI interface. The server supports connection configuration via environment variables, allowing users to define default databases and IANA timezones. It also includes specific capabilities for streaming file exports of large datasets and provides tools for analyzing query execution plans to assist with database performance optimization.
Our verdict
The MongoDB MCP Server holds a security score of 35/100, resulting in a high-risk classification. This rating stems from the project being community-maintained rather than official, and the critical lack of an editorial review for its authentication methods and read-only mode implementation. Due to these unverified security boundaries, this tool is recommended only for local development environments where potential data exposure or unintended modifications pose minimal risk to production systems.
- Supports native MongoDB query and aggregation syntax.
- Includes dedicated tools for execution plan analysis.
- Features streaming file export for large datasets.
- Maintained with a small, focused dependency footprint.
- High security risk due to unverified authentication methods.
- Community-maintained project lacking official vendor support.
- Read-only mode implementation has not undergone editorial review.
Setup
{
"mcpServers": {
"mongodb-mcp": {
"args": [
"-y",
"@vitalyostanin/mongodb-mcp"
],
"command": "npx"
}
}
}Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), then restart Claude Desktop. Some servers require API keys or tokens as environment variables — check the project's README and add an "env" object if needed.
- No read-only mode — running this grants full read/write access.
- No built-in authentication — anyone with access to this config can invoke every tool it exposes.
Tools
| Tool | Description | Risk |
|---|---|---|
| service-info | Get MongoDB service information, environment configuration, version, and current timezone | low |
| connect | Establish connection to MongoDB using connection string | low |
| disconnect | Disconnect from MongoDB | low |
| list_databases | List all databases in the MongoDB instance | low |
| db_stats | Get statistics for a specific database | low |
| list_collections | List all collections for a given database | low |
| collection_schema | Analyze the schema for a collection | low |
| collection_indexes | Describe the indexes for a collection | low |
| collection_storage_size | Get the size of a collection | low |
| find | Run find queries against a MongoDB collection | low |
Compatibility
| Client | Local | Docker | Remote | Read-only |
|---|---|---|---|---|
| ChatGPT | ||||
| Claude Desktop | ||||
| Cursor | ||||
| VS Code | ||||
| Windsurf |
Frequently asked questions
›What are the system requirements for this server?
You must have Node.js version 22 or higher installed.
›How can I prevent accidental data modification during sessions?
The server includes a read-only mode, and it provides specific tools categorized into read-only and non-read-only modes to help manage operations safely.
›How is the timezone handled for date operations?
You can set the MONGODB_MCP_TIMEZONE environment variable to any valid IANA identifier, such as Europe/London or America/New_York. If not provided, the default is set to Europe/Moscow.
›Is it possible to analyze query performance?
Yes, you can use the explain tool to return statistics and execution plans chosen by the MongoDB query optimizer.
›Can I perform operations on large datasets?
The server supports streaming file export to save large datasets to files.
Alternatives
Changelog
- NewRelease v0.6.3
2026-07-18
- NewRelease v0.6.2
2026-07-03
- NewRelease v0.6.1
2026-05-07
- NewRelease v0.6.0
2026-05-06
- NewRelease v0.5.0
2026-05-06
- NewRelease v0.4.0
2026-04-04
- NewRelease v0.3.2
2026-03-24
- NewRelease v0.3.1
2025-11-18
- NewRelease v0.3.0
2025-11-14
- NewRelease v0.2.0
2025-11-14
Badge
Maintain this server? Add the live badge to your README.