Data as of
MongoDB MCP Server for Cursor: Setup & Config
Cursor: MongoDB MCP Server connects AI clients to MongoDB databases and Atlas.
What you can do with MongoDB in Cursor
A broad MongoDB toolset with read-only onboarding and integrated MongoDB knowledge search.
- Review query plans, database statistics, and recent MongoDB logs.
- Search MongoDB documentation and curated knowledge sources.
Before you start: MongoDB in Cursor
- Node.js 22.13.0 or later
- A MongoDB connection string or Atlas service-account credentials
- An MCP-compatible client
This is the README's read-only connection-string setup. Atlas operations instead need MDB_MCP_API_CLIENT_ID and MDB_MCP_API_CLIENT_SECRET. Docker and HTTP alternatives are documented; HTTP needs deployment-level authentication and protection.
MongoDB Cursor configuration
Choose Cursor configuration scope
For MongoDB MCP Server, open Project: .cursor/mcp.json User: ~/.cursor/mcp.json. Merge into mcpServers at project or user scope.
Add MongoDB MCP Server to Cursor
Use the mongodb-mcp-server entry below in mcpServers. Keep MongoDB MCP Server's documented stdio connection fields and your other Cursor entries.
Check MongoDB MCP Server in Cursor
MongoDB MCP Server: Enable in Cursor’s MCP settings; inspect tools.
Config file · Project: .cursor/mcp.json
User: ~/.cursor/mcp.json
{
"mcpServers": {
"mongodb-mcp-server": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
],
"env": {
"MDB_MCP_CONNECTION_STRING": "<MongoDB connection string with appropriate credentials>"
}
}
}
}MongoDB tools available to Cursor
MongoDB's stored tool list documents 27 tools; compare it with Cursor's connected tool list, because the stored list is not a live check.
- aggregate-db
Find aggregate-db under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Execute a database-level aggregation pipeline.
- aggregate
Find aggregate under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- collection-indexes
Find collection-indexes under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- collection-schema
Find collection-schema under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- collection-storage-size
Find collection-storage-size under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- connect
Find connect under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- count
Find count under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- create-collection
Find create-collection under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- create-index
Find create-index under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- db-stats
Find db-stats under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- delete-many
Find delete-many under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- disconnect
Find disconnect under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- drop-collection
Find drop-collection under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- drop-database
Find drop-database under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- drop-index
Find drop-index under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Remove a specified collection index.
- explain
Find explain under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Inspect execution statistics for the optimizer's selected query plan.
- export
Find export under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Save query or aggregation output in the requested EJSON format.
- find
Find find under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Search documents within a collection.
- insert-many
Find insert-many under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Insert a document array, splitting large payloads into batches when needed.
- list-collections
Find list-collections under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Enumerate collections belonging to a database.
- list-connections
Find list-connections under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Show active connection identifiers, including any preconfigured connection.
- list-databases
Find list-databases under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Enumerate databases reachable through a connection.
- mongodb-logs
Find mongodb-logs under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Read recent events logged by mongod.
- rename-collection
Find rename-collection under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Change a collection's name.
- update-many
Find update-many under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Modify collection documents that satisfy a filter.
- list-knowledge-sources
Find list-knowledge-sources under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Discover sources and filtering options in the MongoDB Assistant knowledge base.
- search-knowledge
Find search-knowledge under MongoDB in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Search MongoDB documentation and expert resources with source and version filters.
Troubleshooting MongoDB in Cursor
- Cursor must find npx mongodb-mcp-server@latest (Node.js/npm) for MongoDB MCP Server. Enable the project/user entry in MCP settings and inspect its tools.
- Review MDB_MCP_CONNECTION_STRING for MongoDB MCP Server before sharing project .cursor/mcp.json; project scope travels with the repository.
- MongoDB MCP Server uses stdio here: Cursor must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: Atlas tools require separate service-account credentials.
- Known limitation: HTTP deployments need additional security controls.
- Known limitation: Write-enabled tools can delete data and database objects.
- General Cursor troubleshooting lives in the /clients/cursor guide.
MongoDB MCP Server — details. Cursor guide