Skip to main content

At a glance

Credentials

Set these per environment. See Connect an integration.
VariableRequiredDescription
MONGODB_ATLAS_CLIENT_IDYesAtlas service account client ID (e.g. mdb_sa_id_…) Docs.
MONGODB_ATLAS_CLIENT_SECRETYesAtlas service account client secret (e.g. mdb_sa_sk_…) Docs.

Setup

  1. Sign in to Atlas: Go to 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 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/

Tools

ToolAccessDescription
List ProjectsReadList Atlas projects (groups) the service account can access
List ClustersReadList clusters in an Atlas project
Get ClusterReadGet details of a cluster, including state and connection strings
List Database UsersReadList 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.