For the complete documentation index, see llms.txt. This page is also available as Markdown.

5. MongoDB MCP Server

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

Configuration parameters

Parameter
Required
Description

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.

Custom parameters

  • 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)

How to get the parameters

  1. After registering, create a cluster (choose the M0 Free plan)

  2. Click "Connect" on your cluster

  3. Choose "Connect your application"

  4. Select Driver: Node.js or Python

  5. Copy the Connection String:

  6. Replace <password> with your database user's password

  7. Database Name: choose one (e.g., test_db, aisuru)

Last updated