MetorialDocs

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

Sign-in methods

MethodTypeWhat a person provides
OAuth 2.0 Service Account (default)OAuthSigns in to Mongodb
API Key (Digest Auth)Custom credentialspublicKey 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:

ScopeNameWhat it allows
org:ownerOrganization OwnerFull access to manage the organization and all its projects
org:memberOrganization MemberRead access to organization resources
org:readOrganization Read OnlyRead-only access to organization settings and projects
project:ownerProject OwnerFull access to manage a project and its resources
project:readProject Read OnlyRead-only access to project resources
project:cluster_managerProject Cluster ManagerCreate, edit, and delete clusters within a project
project:data_access_adminProject Data Access AdminManage database users and access within a project

API Key (Digest Auth)

To connect, a person enters these values:

  • publicKey: MongoDB Atlas API Public Key
  • privateKey: 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:

metorial-admin portals access list <portal-id> --type provider_template --search mongodb

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

metorial catalog search mongodb
metorial setup <catalog-item-id>

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.

metorial list mongodb
metorial client list
metorial install <client-identifier> <integration-id>

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 list mongodb
metorial tools <integration-id>
metorial call <integration-id> list_events -d '{"scope":"project"}'

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. Needs action.
  • get_metrics: Retrieve host process metrics, disk measurements, or list available processes for a MongoDB Atlas project. Needs action.
  • list_events: List activity feed events for a MongoDB Atlas project or organization. Needs scope.
  • get_billing: Retrieve invoices and pending charges for a MongoDB Atlas organization. Needs action.

Write tools (2)

  • manage_alerts: List, get, or acknowledge alerts for a MongoDB Atlas project. Needs action.
  • manage_backups: List backup snapshots, take on-demand snapshots, list restore jobs, or create restore jobs for a MongoDB Atlas cluster. Needs action and clusterName.

Destructive tools (6)

  • manage_alert_configurations: List, create, update, or delete alert configurations for a MongoDB Atlas project. Needs action.
  • manage_project: Get details about a specific project, create a new project, or delete an existing project. Needs action.
  • manage_ip_access_list: List, add, or remove IP addresses and CIDR blocks from a project's IP access list. Needs action.
  • manage_search_indexes: List, create, update, or delete Atlas Search indexes on MongoDB Atlas collections. Needs action and clusterName.
  • manage_cluster: Create, update, delete, pause, or resume a MongoDB Atlas cluster. Needs action and clusterName.
  • manage_database_user: Create, update, list, or delete database users in a MongoDB Atlas project. Needs action.

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