# Ably — how to use (mcp.ai)

Connect your Ably account and use 25 tools for developer tools straight from your AI agent. Connect with your own API key. Ably is a real-time messaging platform helping developers build live features, including chat and data synchronization, with global scalability and robust reliability for modern applications.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_ably?ms=1787291460000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `ably_batch_presence`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/ably`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/ably/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/ably/batch/presence` — This tool enables querying the presence states of multiple channels in a single API request. The API retrieves the member presence details of the specified channels in parallel.
  - body: { channels: string, separator?: string }
- `POST https://api.mcp.ai/api/ably/batch/presence/history` — This tool enables querying presence history for multiple channels in a single API request. It uses the GET endpoint at https://rest.ably.io/presence to retrieve the member presence history details of 
  - body: { end?: integer, limit?: integer, start?: integer, channels: string[], direction?: string }
- `POST https://api.mcp.ai/api/ably/delete/channel/subscription` — This tool allows you to unsubscribe devices or clients from push notifications for specific channels. The operation is asynchronous, so immediate requests after deletion may briefly still return the s
  - body: { channel?: string, client_id?: string, device_id?: string }
- `POST https://api.mcp.ai/api/ably/get/channel/details` — This tool retrieves metadata and details for a specific channel in Ably. It returns a ChannelDetails object containing information about the channel's status, occupancy, and other metadata. The endpoi
  - body: { channel_id: string }
- `POST https://api.mcp.ai/api/ably/get/channel/history` — This tool retrieves the message history for a specified Ably channel. It uses the GET /channels/{channelId}/messages endpoint to return a paginated list of messages in chronological order, subject to 
  - body: { end?: integer, limit?: integer, start?: integer, direction?: string, channel_id: string }
- `POST https://api.mcp.ai/api/ably/get/channel/presence` — Tool to obtain the set of members currently present for a channel. Use when you need to check which clients are currently connected and active on a specific Ably channel.
  - body: { limit?: integer, format?: string, clientId?: string, channel_id: string, connectionId?: string }
- `POST https://api.mcp.ai/api/ably/get/message/versions` — Tool to retrieve all historical versions of a specific message from an Ably channel. Use when you need to track message history, including the original message and all subsequent updates or delete ope
  - body: { serial: string, channel_id: string }
- `POST https://api.mcp.ai/api/ably/get/presence/history` — This tool retrieves the history of presence messages for a specified channel in Ably. It allows you to query presence events on a channel within a given time period.
  - body: { end?: integer, limit?: integer, start?: integer, direction?: string, channel_id: string }
- `POST https://api.mcp.ai/api/ably/get/push/device` — Tool to get the full details of a device registration for push notifications. Use when you need to retrieve information about a specific device registered for push notifications, including its platfor
  - body: { format?: string, device_id: string, X_Ably_Version?: string }
- `POST https://api.mcp.ai/api/ably/get/service/time` — This tool retrieves the current server time from Ably's service in milliseconds since the epoch. It is particularly useful for time synchronization and generating valid TokenRequest timestamps to prev
- `POST https://api.mcp.ai/api/ably/get/stats` — This tool retrieves your application's usage statistics from Ably. The stats endpoint returns a paginated list of your application's usage statistics by minute, hour, day, or month. It supports option
  - body: { end?: integer, unit?: string, limit?: integer, start?: integer, direction?: string }
- `POST https://api.mcp.ai/api/ably/list/channels` — Tool to enumerate all active channels in the Ably application. Use when you need to discover available channels or monitor channel activity. Returns paginated results and is heavily rate-limited. Can 
  - body: { by?: string, limit?: integer, format?: string, prefix?: string }
- `POST https://api.mcp.ai/api/ably/list/push/channel/subscriptions` — This tool retrieves a list of all push notification channel subscriptions. It allows you to view all active push notification subscriptions for channels in your Ably application. Allows filtering by c
  - body: { limit?: integer, channel?: string, client_id?: string, device_id?: string, concat_filters?: boolean }
- `POST https://api.mcp.ai/api/ably/list/push/channels` — Tool to list all channels with at least one subscribed device. Use when you need to discover which channels have active push notification subscriptions in your Ably application.
  - body: { format?: string, x_ably_version?: string }
- `POST https://api.mcp.ai/api/ably/list/registered/push/devices` — Tool to list all devices registered for receiving push notifications in your Ably application. Use when you need to view, filter, or audit push notification device registrations. Supports filtering by
  - body: { limit?: integer, format?: string, clientId?: string, deviceId?: string }
- `POST https://api.mcp.ai/api/ably/patch/push/device/registration` — Tool to partially update specific attributes of an existing device registration in Ably's push notification system. Use when you need to modify device properties like formFactor, clientId, platform, o
  - body: { id?: string, format?: string, clientId?: string, deviceId: string, metadata?: object, platform?: string, pushState?: string, formFactor?: string, deviceSecret?: string, xAblyVersion?: string, pushRecipient?: object }
- `POST https://api.mcp.ai/api/ably/publish/batch/messages` — Tool to batch publish messages to multiple channels in parallel. Use when you need to send the same set of messages to multiple channels simultaneously for efficient broadcasting.
  - body: { channels: string[], messages: object[] }
- `POST https://api.mcp.ai/api/ably/publish/message/to/channel` — This tool will allow users to publish a message to a specified Ably channel using a POST request. It covers the essentials like channel name, message data, optional event name/type, and additional met
  - body: { client_id?: string, channel_id: string, event_name?: string, message_id?: string, message_data: string|object, push_notification?: object }
- `POST https://api.mcp.ai/api/ably/publish/push/notification` — Tool to publish a push notification directly to device(s) via Ably's Push Notifications API. Use when you need to send push notifications to specific devices identified by device ID, client ID, or pla
  - body: { push?: object, recipient: object }
- `POST https://api.mcp.ai/api/ably/publish/push/notifications/batch` — Tool to batch publish push notifications directly to specific recipients. Use when you need to send multiple push notifications efficiently in a single request. Supports up to 10,000 notifications per
  - body: { items: object[] }
- `POST https://api.mcp.ai/api/ably/register/push/device` — Tool to register a device for receiving push notifications in Ably. Use when you need to enable push notifications for a specific device across various platforms including iOS (APNs), Android (FCM/GCM
  - body: { id: string, metadata?: object, platform: string, client_id?: string, push_state?: string, form_factor: string, device_secret?: string, push_recipient: object }
- `POST https://api.mcp.ai/api/ably/request/access/token` — Request an access token for Ably authentication. Use this when you need to generate a token with specific capabilities and client identifiers for secure authentication. The token can be used to authen
  - body: { ttl?: integer, nonce?: string, key_name: string, client_id?: string, timestamp?: integer, capability?: string }
- `POST https://api.mcp.ai/api/ably/unregister/all/push/devices` — Tool to unregister matching devices for push notifications. Use when you need to remove device registrations from Ably's push notification system. You can filter by deviceId or clientId, but not both 
  - body: { client_id?: string, device_id?: string }
- `POST https://api.mcp.ai/api/ably/unregister/push/device` — Tool to unregister a single device from push notifications in Ably. Use when you need to remove a device's push notification registration. This permanently removes the device from receiving push notif
  - body: { format?: string, device_id: string, X-Ably-Version?: string }
- `POST https://api.mcp.ai/api/ably/update/push/device` — Tool to update (upsert) a device registration for push notifications in Ably. Use when registering a new device or updating an existing device's push notification configuration. This is an upsert oper
  - body: { id: string, metadata?: object, platform: string, client_id?: string, device_id: string, push_state?: string, form_factor: string, device_secret?: string, push_recipient: object }

## Example prompts
- "What can I do in Ably?"
- "Show me a summary of my Ably account"

## More
- Page: https://mcp.ai/ably
- Agent spec (llms.txt): https://mcp.ai/ably/llms.txt
- Postman collection: https://mcp.ai/ably/postman.json
