5. MongoDB MCP Server
Last updated
The MongoDB MCP Server lets your Agent connect to a MongoDB database and perform read and write operations.
This MCP is useful for:
Querying MongoDB databases
Storing and retrieving data during conversations
Managing structured data in document format
connection_string
Yes
MongoDB connection URI. Format: mongodb://user:password@host:port/database or mongodb+srv://....
database_name
No
Name of the database to use. If not set, use the one included in the connection string.
timeout: maximum time to complete an operation (ms)
maxPoolSize: maximum number of simultaneous connections in the pool
minPoolSize: minimum number of always-active connections
retryWrites: automatically retry failed writes
readPreference: which node to read data from (primary/secondary/nearest)
maxIdleTimeMS: maximum idle time before closing a connection (ms)
serverSelectionTimeoutMS: maximum time to find an available server (ms)
After registering, create a cluster (choose the M0 Free plan)
Click "Connect" on your cluster
Choose "Connect your application"
Select Driver: Node.js or Python
Copy the Connection String:
Replace <password> with your database user's password
Database Name: choose one (e.g., test_db, aisuru)
Last updated
{
"timeout": 30000,
"maxPoolSize": 10,
"minPoolSize": 2,
"retryWrites": true,
"readPreference": "primary",
"maxIdleTimeMS": 60000,
"serverSelectionTimeoutMS": 30000
}mongodb+srv://<username>:<password>@cluster0.xxxxx.mongodb.net/