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

# MongoDB Atlas Integration: Database Administration for Agents

> Agents can manage clusters, users, and projects via the Atlas Administration API. Client credentials are injected automatically.

## Overview

OneCLI connects AI agents to MongoDB Atlas through the Atlas Administration API. Agents can manage clusters, database users, projects, and organizations. The gateway injects credentials into requests to `cloud.mongodb.com` automatically.

Unlike most integrations, MongoDB Atlas uses service account client credentials (OAuth2 client credentials grant) rather than a browser-based OAuth flow.

## Setup

<Steps>
  <Step title="Create a service account in Atlas">
    Go to the [MongoDB Atlas dashboard](https://cloud.mongodb.com), navigate to **Access Manager** > **API Keys** or **Service Accounts**, and create a new service account with the permissions your agents need.

    Note the **Client ID** and **Client Secret**.
  </Step>

  <Step title="Connect in OneCLI">
    Open the OneCLI dashboard, go to **Connections** > **MongoDB Atlas**, and enter your Client ID and Client Secret.

    OneCLI exchanges these for an OAuth2 access token automatically and refreshes it as needed.
  </Step>
</Steps>

## What agents can do

| Area               | Examples                                  |
| ------------------ | ----------------------------------------- |
| **Clusters**       | List, create, modify, and delete clusters |
| **Database Users** | Manage database users and roles           |
| **Projects**       | View and manage Atlas projects            |
| **Organizations**  | Read organization metadata                |
| **Network Access** | Manage IP access lists                    |
| **Backups**        | View and manage backup snapshots          |

## Use cases

* Infrastructure agents that provision and scale MongoDB clusters
* Database management agents that create users and configure access
* Monitoring agents that check cluster health and metrics
* Migration agents that manage backup and restore operations

## Controlling access with rules

Use OneCLI's [rules engine](/guides/rules) to restrict what agents can do. For example, block cluster deletion or rate-limit API calls. Rules are evaluated before credential injection, so a blocked request never reaches the Atlas API.
