> For the complete documentation index, see [llms.txt](https://docs.pagerly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagerly.io/sre-ai-agent/data-sources/mongodb.md).

# MongoDB Atlas

## What the Agent Can Do

* List all clusters in a project — state, tier, version, provider
* Get detailed cluster status — connection strings, disk size, backup config
* List MongoDB processes (mongod/mongos) running in the project
* Get open alerts — replication lag, disk space, CPU, connection issues

## Setup Instructions

1. Log into **MongoDB Atlas** at <https://cloud.mongodb.com>
2. Click **Access Manager** (top nav) > **API Keys**
3. Click **Create API Key**
4. Give it a name (e.g., `Pagerly`), set role to **Organization Read Only**
5. Copy the **Public Key** and **Private Key**
6. Find your **Project ID** in the URL: `cloud.mongodb.com/v2/{projectId}`
7. Paste all three below

## Required Credentials

| Field               | Description                             | Example                    |
| ------------------- | --------------------------------------- | -------------------------- |
| **Public API Key**  | Atlas Public API key                    | `abcdefgh`                 |
| **Private API Key** | Atlas Private API key (shown only once) | `12345678-abcd-...`        |
| **Project ID**      | Atlas Project/Group ID (from URL)       | `60c1a2b3c4d5e6f7a8b9c0d1` |

{% hint style="warning" %}
**The Private API Key is only shown once** when you create it. Copy it immediately and store it securely.
{% endhint %}

## Context Prompt Tips

> *"Our production cluster is prod-cluster-0. We use M30 tier. Replica set is in us-east-1."*

## Docs

* [MongoDB Atlas API](https://www.mongodb.com/docs/atlas/api/)
