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

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

Share Ably with your team in Claude, ChatGPT and Cursor through Metorial: API key or control API token sign-in, 16 tools (8 read-only).

---

To give your team Ably in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Ably integration in a Metorial portal, and each person connects with an API key. Agents can publish realtime channel messages, inspect current presence and message or presence history, enumerate active channels, and retrieve usage statistics. The integration has 16 tools, 8 read-only, 7 write and 1 destructive, plus 1 trigger.

**What you will learn**

- How an admin shares Ably in a portal and how each person connects
- What Ably asks for when you connect, and where to find it
- How to keep the 8 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 API key from Ably 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 |
| --- | --- | --- |
| **API Key** (default) | API token | `apiKey` |
| **Control API Token** | API token | `controlToken` |

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

### API Key

To connect, a person enters:

- `apiKey`: Ably API key in the format "appId.keyId:keyValue" (e.g. "I2E_JQ.OqUdfg:EVKVTCBlzLBP..."). Used for Pub/Sub REST API operations like publishing messages, retrieving history, and managing presence.

### Control API Token

To connect, a person enters:

- `controlToken`: Ably Control API access token. Created in the Ably dashboard under "My Access Tokens". Used for managing apps, keys, rules, queues, and namespaces.

### Setup settings

Whichever method you pick, setup also asks for:

- `appId` (optional): Ably App ID. Required for Control API operations. Found in the Ably dashboard under Application Settings, or as the first part of your API key (e.g. "28AB6c" from key "28AB6c.DEFi0Q:...")
- `accountId` (optional): Ably Account ID. Required for account-level Control API operations like listing apps. Found in the Ably dashboard under Account Settings.

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

3. **Limit the tools**

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

4. **Choose who gets it**

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

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

## Employee: connect Ably

### In the portal

1. **Open Ably in the catalog**

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

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your API key (apiKey).

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

`catalog search` prints the catalog item ID. `metorial setup` uses **API Key**. To connect with **Control 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 Ably 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 ably
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 `who_am_i` and `get_presence`, and lose the 7 write tools, such as `manage_apps` or `manage_keys`, and the destructive tool `revoke_tokens`.

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 ably
metorial tools <integration-id>
metorial call <integration-id> get_statistics -d '{}'
```

`metorial tools` lists the 16 tools, minus any you rejected. `get_statistics` takes no input. It retrieves application-level usage statistics from Ably, including message counts, connections, API requests, and more.

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

## Tools

### Read-only tools (8)

- `get_channel_status`: Get the status and occupancy details of a specific Ably channel, or list all active channels.
- `get_presence`: Retrieve the current set of members present on an Ably channel. Needs `channelId`.
- `get_presence_history`: Retrieve historical presence events from an Ably channel. Needs `channelId`.
- `get_statistics`: Retrieve application-level usage statistics from Ably, including message counts, connections, API requests, and more.
- `get_message_history`: Retrieve historical messages from an Ably channel. Needs `channelId`.
- `get_service_time`: Retrieve Ably service time in milliseconds since the Unix epoch for clock synchronization and token request diagnostics.
- `get_control_statistics`: Retrieve usage statistics for an account or app with a Control API token, including the full provider statistics entries.
- `who_am_i`: Retrieve the Control API token metadata, its user, and its account.

### Write tools (7)

- `publish_message`: Publish one or more messages to an Ably channel.
- `manage_rules`: List, create, update, or delete Ably integration rules using the Control API. Needs `action`.
- `manage_queues`: List, create, or delete Ably message queues using the Control API. Needs `action`.
- `manage_keys`: List, create, update, or revoke Ably API keys using the Control API. Needs `action`.
- `request_token`: Issue a short-lived Ably token with fine-grained capabilities for client authentication. Needs `keyName`.
- `manage_apps`: List, create, update, or delete Ably applications using the Control API. Needs `action`.
- `manage_namespaces`: List, create, update, or delete Ably channel namespaces using the Control API. Needs `action`.

### Destructive tools (1)

- `revoke_tokens`: Revoke previously issued Ably tokens matching specified targets. Needs `keyName` and `targets`.

## Triggers

Ably has 1 trigger, which fire on events in Ably:

- `channel_events`: Receive webhook notifications for Ably channel events including messages, presence changes, lifecycle events, and occupancy changes.

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