Set up Mongodb in Metorial for Claude, ChatGPT and Cursor
Share Mongodb with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or API key sign-in, 15 tools (7 read-only).
To give your team Mongodb in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Mongodb integration in a Metorial portal, and each person signs in to Mongodb with their own account. Agents can manage MongoDB Atlas cloud database infrastructure programmatically. The integration has 15 tools, 7 read-only, 2 write and 6 destructive, plus 2 triggers.
What you'll learn
- How an admin shares Mongodb in a portal and how each person connects
- The 7 OAuth scopes Mongodb can request, and what each one allows
- How to keep the 7 read-only tools and reject the other 8
Before you start
- A portal with at least one access group
- An account with Mongodb for each person who connects
- For the CLI steps: the Metorial CLI, signed in to your portal
Sign-in methods
| Method | Type | What a person provides |
|---|---|---|
| OAuth 2.0 Service Account (default) | OAuth | Signs in to Mongodb |
| API Key (Digest Auth) | Custom credentials | publicKey and privateKey |
The portal and metorial setup use OAuth 2.0 Service Account unless someone picks another method.
OAuth 2.0 Service Account
People sign in to Mongodb and approve the scopes you allow. The integration can request:
| Scope | Name | What it allows |
|---|---|---|
org:owner | Organization Owner | Full access to manage the organization and all its projects |
org:member | Organization Member | Read access to organization resources |
org:read | Organization Read Only | Read-only access to organization settings and projects |
project:owner | Project Owner | Full access to manage a project and its resources |
project:read | Project Read Only | Read-only access to project resources |
project:cluster_manager | Project Cluster Manager | Create, edit, and delete clusters within a project |
project:data_access_admin | Project Data Access Admin | Manage database users and access within a project |
API Key (Digest Auth)
To connect, a person enters these values:
publicKey: MongoDB Atlas API Public KeyprivateKey: MongoDB Atlas API Private Key
Setup settings
Whichever method you pick, setup also asks for:
projectId(optional): MongoDB Atlas Project (Group) ID. Required for most project-scoped operations.organizationId(optional): MongoDB Atlas Organization ID. Required for organization-scoped operations.
Use your own Mongodb OAuth app
With your own OAuth app, people see your company's name on the Mongodb consent screen, and the client ID and secret belong to you.
Start the credentials in Metorial
In the dashboard, select Settings, then Organization Settings. Under Integrations and MCP, select Provider Auth, then Create Auth Credentials. Choose Mongodb and copy the Redirect URI.
Register the app with Mongodb
Create an OAuth app or client in Mongodb and add the redirect URI from Metorial as its redirect or callback URL.
Finish in Metorial
Copy the app's client ID and client secret. Back in Metorial, enter a Name, the Client ID and the Client Secret, review Scopes, and select Create. Then pick these credentials for the Mongodb integration.
Admin: share Mongodb in a portal
In the dashboard
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
Share a new integration
Select Share a Resource, then New Integration, and choose Mongodb. Under Auth Method, keep OAuth 2.0 Service Account or pick another. For how members connect, choose Each person connects, so everyone signs in to Mongodb as themselves.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Mongodb.
Choose who gets it
Add the access groups that should see Mongodb. When a person asks for access from the portal, the request appears under Access Requests.
With the CLI
The CLI cannot create the per-user Mongodb integration. Once it exists, check which groups have it:
Employee: connect Mongodb
In the portal
Open Mongodb in the catalog
Sign in to your portal and open Mongodb. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. A Mongodb sign-in tab opens. Sign in and approve the permissions listed.
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
catalog search prints the catalog item ID. metorial setup uses OAuth 2.0 Service Account. To connect with API Key (Digest Auth) instead, find its ID with metorial catalog get <catalog-item-id> and add --auth-method <auth-method-id>.
Add it to your AI client
metorial install adds your Mongodb connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.
For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.
Make it read-only
Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the 7 read-only tools, such as get_billing and get_metrics, and lose the 2 write tools, such as manage_alerts or manage_backups, and the 6 destructive tools, such as manage_cluster or manage_project.
Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.
Check it worked
metorial tools lists the 15 tools, minus any you rejected. list_events needs scope, so replace the placeholders. It lists activity feed events for a MongoDB Atlas project or organization.
To see every input a tool takes, run metorial schema <integration-id> <tool-key>.
Tools
Read-only tools (7)
list_organizations: List all MongoDB Atlas organizations accessible with the current credentials.list_clusters: List all database clusters in a MongoDB Atlas project.list_projects: List all MongoDB Atlas projects accessible with the current credentials.get_network_info: List network peering connections and private endpoint services for a MongoDB Atlas project. Needsaction.get_metrics: Retrieve host process metrics, disk measurements, or list available processes for a MongoDB Atlas project. Needsaction.list_events: List activity feed events for a MongoDB Atlas project or organization. Needsscope.get_billing: Retrieve invoices and pending charges for a MongoDB Atlas organization. Needsaction.
Write tools (2)
manage_alerts: List, get, or acknowledge alerts for a MongoDB Atlas project. Needsaction.manage_backups: List backup snapshots, take on-demand snapshots, list restore jobs, or create restore jobs for a MongoDB Atlas cluster. NeedsactionandclusterName.
Destructive tools (6)
manage_alert_configurations: List, create, update, or delete alert configurations for a MongoDB Atlas project. Needsaction.manage_project: Get details about a specific project, create a new project, or delete an existing project. Needsaction.manage_ip_access_list: List, add, or remove IP addresses and CIDR blocks from a project's IP access list. Needsaction.manage_search_indexes: List, create, update, or delete Atlas Search indexes on MongoDB Atlas collections. NeedsactionandclusterName.manage_cluster: Create, update, delete, pause, or resume a MongoDB Atlas cluster. NeedsactionandclusterName.manage_database_user: Create, update, list, or delete database users in a MongoDB Atlas project. Needsaction.
Triggers
Mongodb has 2 triggers, which fire on events in Mongodb:
alert_webhook: Receives alert notifications from MongoDB Atlas via webhook.project_events: [Polling fallback] Polls for new activity feed events in a MongoDB Atlas project.
Next steps
- Claude Code, Cursor, Codex and ChatGPT: connect each client to your portal and use Mongodb there
- Create custom OAuth credentials: the Provider Auth screens in more detail
- Tool permissions: tool filters and what employees see
- Mongodb on metorial.com: the integration overview