> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up Mongodb in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/mongodb
Last updated: 2026-11-24

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 will 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](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An account with Mongodb for each person who connects
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/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 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.

1. **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**.

2. **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.

3. **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

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **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.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from Mongodb.

4. **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:

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

## Employee: connect Mongodb

### In the portal

1. **Open Mongodb in the catalog**

   Sign in to your portal and open Mongodb. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. A Mongodb sign-in tab opens. Sign in and approve the permissions listed.

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
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.

```bash
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](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
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

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use Mongodb there
- [Create custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials): the Provider Auth screens in more detail
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Mongodb on metorial.com](https://metorial.com/integrations/mongodb): the integration overview