> ## Documentation Index
> Fetch the complete documentation index at: https://explore.airia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MongoDB MCP

To use MongoDB, you will have to provide your MongoDB Cloud Connection String via your MongoDB platform, and authenticate with a specific user that has access.

## Retrieving your connection string

1. **Access MongoDB Connection Settings**
   These can be found on **MongoDB Atlas -> Databases -> Clusters**

2. **Connect**\
   Select **Connect -> Drivers** to find your connection string. This will start with `mongodb+srv:`.

3. **Update Password**\
   Update the default connection string password placeholder (`<dbpassword>`) with the correct password of the connecting user.

<img src="https://mintcdn.com/airia/HWnT1pkCKPHVGDR9/integrations/Images/mongodb-connection-setup.png?fit=max&auto=format&n=HWnT1pkCKPHVGDR9&q=85&s=e9eb57810a1b076f5cf99ef350c7317b" alt="MongoDB Atlas Connection String Setup" width="2298" height="1558" data-path="integrations/Images/mongodb-connection-setup.png" />

## Adding MongoDB MCP to Airia Platform

Once you have retrieved your connection string, navigate to the Airia Platform:

1. **Select MongoDB MCP**\
   Navigate to the Tools library and select **MongoDB MCP**.

2. **Provide Authentication**\
   Add the connection string with the password as your form of authentication.

3. **Tool Discovery**\
   The platform will automatically discover and configure the available MongoDB tools based on your token permissions.

4. **Create an Agent**
   Build an Agent with an AI Model and add the MongoDB MCP Server to the model.

<Note>
  MongoDB MCP servers don't connect automatically due to how the server handles connections. Connections must happen as a tool call at the start of an agent interaction. To make this easier, recommend adding a system prompt to the model such as: "Before using any MongoDB tool execute the 'connect' tool. The connection string is already defined in the tools definition."
</Note>

<img src="https://mintcdn.com/airia/HWnT1pkCKPHVGDR9/integrations/Images/mongodb-system-prompt.png?fit=max&auto=format&n=HWnT1pkCKPHVGDR9&q=85&s=f0a26b73b8d682516aafbb33ef00259d" alt="MongoDB MCP System Prompt Configuration" width="2130" height="1334" data-path="integrations/Images/mongodb-system-prompt.png" />

5. **Test your connection**
   Test your MongoDB MCP Server by asking questions against your Database, such as "Do you have access to my MongoDB Server?" or "List the available collections in my MongoDB Server?"
