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

# MongoDB Atlas

> Inspect MongoDB Atlas projects, clusters, and database users via the Atlas Administration API

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: OAuth 2.0 (client credentials).
* **Connection**: Veryfront mints machine-to-machine tokens from the client ID and secret in the project's environment variables.
* **Docs**: [https://www.mongodb.com/docs/atlas/api/service-accounts-overview/](https://www.mongodb.com/docs/atlas/api/service-accounts-overview/)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable                      | Required | Description                                                                                                                            |
| ----------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `MONGODB_ATLAS_CLIENT_ID`     | Yes      | Atlas service account client ID (e.g. mdb\_sa\_id\_...) [Docs](https://www.mongodb.com/docs/atlas/api/service-accounts-overview/).     |
| `MONGODB_ATLAS_CLIENT_SECRET` | Yes      | Atlas service account client secret (e.g. mdb\_sa\_sk\_...) [Docs](https://www.mongodb.com/docs/atlas/api/service-accounts-overview/). |

## Setup

1. **Sign in to Atlas**: Go to [https://cloud.mongodb.com](https://cloud.mongodb.com) and sign in (a free M0 cluster is enough for testing).
2. **Create a service account**: In Organization Access Manager > Applications > Service Accounts, create a service account with at least Organization Read Only (or Project Read Only on specific projects). Copy the client ID and client secret - the secret is shown only once.
3. **Add your IP to the API access list**: Service account access tokens can only be USED from IPs on the service account's API access list. Add your machine's IP (or 0.0.0.0/0 for testing only).
4. **Set environment variables**: Add MONGODB\_ATLAS\_CLIENT\_ID and MONGODB\_ATLAS\_CLIENT\_SECRET to your .env. Tokens are minted automatically from [https://cloud.mongodb.com/api/oauth/token](https://cloud.mongodb.com/api/oauth/token) via the OAuth2 client\_credentials grant (credentials sent via HTTP Basic).
5. **Verify access**: Run List Projects, then List Clusters with a project's ID.

* Legacy Atlas programmatic API keys use HTTP Digest auth, which this connector does NOT support - use a service account (OAuth2 client\_credentials) instead; MongoDB recommends service accounts over API keys
* Every request must send a versioned Accept header; tools default to application/vnd.atlas.2025-03-12+json (the latest stable resource version). Atlas returns 406 if the header is missing or names a nonexistent version
* Access tokens expire after 1 hour and are refreshed by re-running the client\_credentials grant

Provider API reference: [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/)

## Tools

| Tool                | Access | Description                                                      |
| ------------------- | ------ | ---------------------------------------------------------------- |
| List Projects       | Read   | List Atlas projects (groups) the service account can access      |
| List Clusters       | Read   | List clusters in an Atlas project                                |
| Get Cluster         | Read   | Get details of a cluster, including state and connection strings |
| List Database Users | Read   | List database users configured in an Atlas project               |

## Example prompts

* List my MongoDB Atlas projects and the clusters in each, with their state and MongoDB version.
* Check my MongoDB Atlas clusters and tell me which ones are paused or not in the IDLE state.
