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

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

Share Segment with your team in Claude, ChatGPT and Cursor through Metorial: write key only or public API token sign-in, 25 tools (8 read-only).

---

To give your team Segment in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Segment integration in a Metorial portal, and each person connects with a write key only. Agents can collect, unify, and route customer event data across tools and platforms. The integration has 25 tools, 8 read-only, 10 write and 7 destructive, plus 2 triggers.

**What you will learn**

- How an admin shares Segment in a portal and how each person connects
- What Segment asks for when you connect, and where to find it
- How to keep the 8 read-only tools and reject the other 17

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- A write key only from Segment for each person, or one for a shared connection
- 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 |
| --- | --- | --- |
| **Write Key Only** (default) | API token | `writeKey` |
| **Public API Token** | API token | `token` and `writeKey` |

The portal and `metorial setup` use **Write Key Only** unless someone picks another method.

### Write Key Only

To connect, a person enters:

- `writeKey`: Segment source write key for the Tracking API

### Public API Token

To connect, a person enters these values:

- `token`: Segment Public API token (created in Settings > Access Management > Tokens)
- `writeKey` (optional): Segment source write key for sending tracking data (optional, only needed for Tracking API calls)

### Setup settings

Whichever method you pick, setup also asks for:

- `region` (optional): Segment data region. Determines API base URLs for both Public and Tracking APIs. One of "us", "eu".

## Admin: share Segment 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 Segment. Under **Auth Method**, keep **Write Key Only** or pick another. For how members connect, choose **Each person connects** so everyone enters their own write key only, or **Shared connection** to enter one write key only for everyone.

3. **Limit the tools**

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

4. **Choose who gets it**

   Add the access groups that should see Segment. 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 Segment integration. Once it exists, check which groups have it:

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

## Employee: connect Segment

### In the portal

1. **Open Segment in the catalog**

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

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your write key only (writeKey).

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 segment
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **Write Key Only**. To connect with **Public API Token** 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 Segment 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 segment
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 8 read-only tools, such as `get_usage` and `get_source`, and lose the 10 write tools, such as `alias_user` or `group_user`, and the 7 destructive tools, such as `manage_source` or `manage_warehouse`.

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 segment
metorial tools <integration-id>
metorial call <integration-id> get_usage -d '{"metricType":"api_calls"}'
```

`metorial tools` lists the 25 tools, minus any you rejected. `get_usage` needs `metricType`, so replace the placeholders. It queries current Segment monitoring data: daily API call usage, daily monthly tracked users (MTU), destination delivery metrics, and workspace event volume.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (8)

- `list_destinations`: List all configured destinations in the Segment workspace.
- `get_usage`: Query current Segment monitoring data: daily API call usage, daily monthly tracked users (MTU), destination delivery metrics, and workspace event volume. Needs `metricType`.
- `list_tracking_plans`: List all tracking plans in the workspace.
- `list_warehouses`: List all data warehouses in the workspace, optionally with connected sources and connection state for a specific warehouse.
- `browse_catalog`: Browse the Segment integration catalog to discover available source, destination, and warehouse types. Needs `catalogType`.
- `list_sources`: List all data sources in the Segment workspace.
- `get_source`: Retrieve detailed information about a specific source, including its connected destinations and warehouses. Needs `sourceId`.
- `list_audit_events`: List audit trail events for the workspace.

### Write tools (10)

- `track_event`: Send a Track event to Segment's Tracking API. Needs `event`.
- `alias_user`: Send an Alias call to Segment's Tracking API. Needs `previousId` and `userId`.
- `batch_events`: Send a batch of Identify, Track, Page, Screen, Group, or Alias calls in a single request to Segment's Tracking API. Needs `batch`.
- `manage_reverse_etl`: Create, update, list, or delete reverse ETL models. Needs `action`.
- `manage_function`: Create, update, list, or delete custom JavaScript functions. Needs `action`.
- `manage_transformation`: Create, update, list, or delete event transformations. Needs `action`.
- `page_screen`: Send a Page or Screen call to Segment's Tracking API. Needs `type`.
- `group_user`: Send a Group call to Segment's Tracking API. Needs `groupId`.
- `identify_user`: Send an Identify call to Segment's Tracking API.
- `manage_destination_filter`: Create, update, or remove filters on a destination. Needs `action` and `destinationId`.

### Destructive tools (7)

- `create_regulation`: Create a GDPR deletion or suppression request. Needs `action`.
- `manage_destination`: Create, update, or delete a destination in your Segment workspace. Needs `action`.
- `manage_tracking_plan`: Create, update, delete, or connect tracking plans. Needs `action`.
- `manage_source`: Create, update, or delete a data source in your Segment workspace. Needs `action`.
- `manage_warehouse`: Create, update, delete, or manage source connections for data warehouses. Needs `action`.
- `manage_destination_subscription`: Create, retrieve, update, list, or remove Segment destination subscriptions. Needs `action` and `destinationId`.
- `manage_source_write_key`: Create or remove Segment source write keys. Needs `action` and `sourceId`.

## Triggers

Segment has 2 triggers, which fire on events in Segment:

- `workspace_activity`: [Polling fallback] Polls for audit trail events in the Segment workspace.
- `incoming_events`: Receives Segment tracking events (identify, track, page, screen, group, alias) via webhook.

## 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 Segment there
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Segment on metorial.com](https://metorial.com/integrations/segment): the integration overview