# MongoDB

**Type:** Community

**Source Type:** Repository

**Source:** [GitHub](https://github.com/mongodb-js/mongodb-mcp-server)

**Description:** Provides Claude with direct access to MongoDB databases for querying, analyzing, and managing document-based data. Enables natural language database operations including collection queries, document aggregation, schema analysis, index management, and database statistics retrieval through MongoDB's native Node.js driver.

**Configuration Parameters:**

* **MongoDB Connection String** \* - MongoDB connection URI (e.g., mongodb://localhost:27017 or mongodb+srv://cluster.mongodb.net)
* **Database Name** - Default database to connect to (optional)
* **MongoDB Options** - Additional connection options in JSON format (optional)

**Setup Steps:**

1. Ensure you have a MongoDB instance running (local, Atlas, or hosted)
2. For MongoDB Atlas:
   * Log in to <https://cloud.mongodb.com>
   * Navigate to your cluster and click "Connect"
   * Choose "Connect your application"
   * Copy the connection string
   * Replace `<password>` with your database user password
3. For local MongoDB:
   * Use connection string: `mongodb://localhost:27017`
4. Create a database user with appropriate permissions if needed
5. Whitelist IP addresses in MongoDB Atlas if using cloud deployment
6. Provide the connection string to Natoma


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.natoma.ai/apps/mongodb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
