Verified

MongoDB MCP Server

MongoDB databases, collections, and documents accessible directly via MCP protocols.

Data last scanned today · Reviewed today

453 dangerous tools21 tools0TypeScriptMIT

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

Claude Desktop
{
  "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

ToolDescriptionRisk
service-infoGet MongoDB service information, environment configuration, version, and current timezonelow
connectEstablish connection to MongoDB using connection stringlow
disconnectDisconnect from MongoDBlow
list_databasesList all databases in the MongoDB instancelow
db_statsGet statistics for a specific databaselow
list_collectionsList all collections for a given databaselow
collection_schemaAnalyze the schema for a collectionlow
collection_indexesDescribe the indexes for a collectionlow
collection_storage_sizeGet the size of a collectionlow
findRun find queries against a MongoDB collectionlow

Compatibility

ClientLocalDockerRemoteRead-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

Badge

MongoDB MCP Server security score, rated on RepoAI

Maintain this server? Add the live badge to your README.