clientId:clientSecret
(mdb_sa_id_...:mdb_sa_sk_...) or as the JSON
{ "clientId": "mdb_sa_id_...", "clientSecret": "mdb_sa_sk_..." }. The plugin trades it at /api/oauth/token for a bearer
token (cached until a minute before it expires). A programmatic API key
works too, as publicKey:privateKey; Atlas wants those with HTTP Digest
authentication, which the plugin does. Add the IP addresses the calls come
from to the credential’s API access list if your organization requires
one, and give it the roles the calls need (Organization Owner or Project
Owner covers most).
- Ids. Atlas calls a project a group:
groupIdis the project id (projects.listGroups),orgIdthe organization’s (organizations.listOrgs). Clusters, users and indexes go by name. - Versions. Every Atlas route is versioned by media type; each
operation is pinned to the newest version the spec offers and sends it as
Accept: application/vnd.atlas.<date>+json. - Lists page with
pageNum(1-based) anditemsPerPage(the plugin sends 100 when it is left out) and return{ results, totalCount, links }. - Downloads (database logs, invoices as CSV) come back as files.
- Risk. Reads are
read. Deletes, anything that starts billed infrastructure (clusters, search nodes, stream workspaces and processors, data federation, private endpoints, peering, online archive, snapshots), restores, failover and outage tests, invitations, new keys and service accounts, and organization-level changes aredestructive; other writes arewrite. - Not wrapped: the 53 operations the spec marks deprecated (each has a newer replacement in the plugin).
- 489 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the MongoDB Atlas API key before the first call: More: API Key
pnpm corsair setup --plugin=mongodbatlas --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List the clusters in a projectWhat’s next
API reference
Every
mongodbatlas.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.