What are the prerequisites to run MongoDB MCP Server?
Node.js v22.13 or later is required. A MongoDB connection string or Atlas API service account credentials must be provided.
@mongodb-js
基本情報
A Model Context Protocol server to connect to MongoDB databases and MongoDB Atlas Clusters.
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server"
],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
}
}
}
}Run an aggregation against a MongoDB database
Run an aggregation against a MongoDB collection
Describe the indexes for a collection
Describe the schema for a collection
Gets the size of the collection
Connect to a MongoDB instance and get back a connectionId to pass to the other MongoDB tools. Each call establishes a new, independent connection — multiple connections can be active at the same time. A connection with the id "preconfigured" already exists for the connection string the server was configured with — there is no need to call this tool to use it.
Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter
Creates a new collection in a database. If the database doesn't exist, it will be created automatically.
Create an index for a collection
Returns statistics that reflect the use state of a single database
Removes all documents that match the filter from a MongoDB collection
Close a MongoDB connection and revoke its connectionId. Disconnecting the "preconfigured" connection only closes it — it reconnects automatically on next use because the server configuration still declares it.
Removes a collection or view from the database. The method also removes any indexes associated with the dropped collection.
Removes the specified database, deleting the associated data files
Drop an index for the provided database and collection.
Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method
Export a query or aggregation results in the specified EJSON format.
Run a find query against a MongoDB collection
Insert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.
List all collections for a given database
List the active MongoDB connections and their connectionIds. Use this to discover the "preconfigured" connection or to find a connectionId established earlier.
List all databases for a MongoDB connection
Returns the most recent logged mongod events
Renames a collection in a MongoDB database
Updates all documents that match the specified filter for a collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider updating them in batches.
List available data sources in the MongoDB Assistant knowledge base. Use this to explore available data sources or to find search filter parameters to use in search-knowledge.
Search for information in the MongoDB Assistant knowledge base. This includes official documentation, curated expert guidance, and other resources provided by MongoDB. Supports filtering by data source and version.
It is a Model Context Protocol server for interacting with MongoDB databases and MongoDB Atlas. It allows AI assistants to perform read‑only (or optionally write) database operations and manage Atlas resources using either a MongoDB connection string or Atlas API service account credentials.
Requires Node.js v22.13 or later. Configure it in your MCP client (e.g., VS Code, Cursor, Claude Desktop) by running npx -y mongodb-mcp-server@latest with the --readOnly flag by default. Pass credentials via environment variables (MDB_MCP_CONNECTION_STRING or MDB_MCP_API_CLIENT_ID/MDB_MCP_API_CLIENT_SECRET). Docker images are also available.
--readOnly to enable writes.Node.js v22.13 or later is required. A MongoDB connection string or Atlas API service account credentials must be provided.
Yes. All configuration examples include the `--readOnly` flag. Remove it if you need write operations.
Yes. A Docker image `mongodb/mongodb-mcp-server:latest` is available. Pass environment variables via `-e` flags or through an MCP configuration file.
The README strongly recommends using environment variables (`MDB_MCP_CONNECTION_STRING`, `MDB_MCP_API_CLIENT_ID`, `MDB_MCP_API_CLIENT_SECRET`) instead of command‑line arguments to avoid exposing secrets in process lists or logs.
Configuration examples are provided for Windsurf, VS Code, Claude Desktop, Cursor, Copilot CLI, and Opencode CLI.
Connect ClickHouse to your AI assistants.
The Xata MCP server lets AI assistants and agents interact with your Xata organizations, projects, and Postgres database branches.
MCP server for interacting with Neon Management API and databases

Local database MCP server: your agent sees a migration's impact before it runs, for PostgreSQL, MySQL, SQL Server and SQLite, with no database credentials.

Model Context Protocol Servers
コメント