PubNub MCP Server
v2.3.2PubNub Model Context Protocol MCP Server for Cursor and Claude
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_sdk_documentation Get PubNub Core SDK Documentation
Retrieve Core SDK documentation for low-level real-time features. **When to use:** - Building NON-CHAT real-time apps (IoT, gaming state sync, live analytics, notifications) - Need fine-grained control over pub/sub, presence, storage, or access management - Implementing custom real-time patterns - Need API reference for specific SDK methods (publish, subscribe, history, etc.) **Do NOT use for:** - Chat/messaging apps → use "get_chat_sdk_documentation" instead - Conceptual guides → use "how_to" Returns code examples, API references, a…
| Parameter | Type | Description |
|---|---|---|
feature * | string | |
language * | string |
get_chat_sdk_documentation Get PubNub Chat SDK Documentation
Retrieve Chat SDK documentation for building chat/messaging applications. **When to use:** - Building ANY chat or messaging application (1:1, group, channels) - Need typing indicators, read receipts, @mentions, unread counts - Want message threads, reactions, pinned messages, moderation - Need user/channel management with chat-specific features - Prefer rapid development with intuitive methods like sendText(), startTyping(), join() **Do NOT use for:** - Non-chat real-time apps (IoT, gaming state, analytics) → use "get_sdk_documentation"…
| Parameter | Type | Description |
|---|---|---|
feature * | string | |
language * | string |
how_to Get PubNub How-To Guide
Retrieve conceptual guides for specific PubNub use cases and integrations. **When to use:** - Learning how to implement a specific use case (gaming, healthcare, IoT) - Need step-by-step integration guide for a platform (Unity, Unreal etc) - Understanding PubNub features in context (presence, push notifications, functions) **Do NOT use for:** - API reference or code samples of a specific PubNub features → use `get_sdk_documentation` or `get_chat_sdk_documentation` - General best practices → use `write_pubnub_app`
| Parameter | Type | Description |
|---|---|---|
slug * | string |
write_pubnub_app Get PubNub Best Practices
Retrieve PubNub best practices guide covering: 1) Architecture & project setup (environments, payload sizes), 2) Security (Access Manager tokens, least privilege, PII hygiene), 3) Channel & data modeling (naming conventions, message schemas), 4) Publish/Subscribe patterns, 5) History usage, 6) Client reliability (reconnect, idempotency, ordering), 7) Functions/edge logic, 8) Presence & state, 9) App Context, 10) Mobile specifics (push notifications, caching), 11) Web specifics (tab lifecycle, Service Workers), 12) Observability & ops, 13) Performance & cost optimi…
manage_apps Manage PubNub App
Manages PubNub apps with operations: list, create, update. - 'list': List all apps on your account. - 'create': Create a new app. User must provide data.name. - 'update': Update an existing app name. User must provide data.id and data.name.
| Parameter | Type | Description |
|---|---|---|
operation * | string | Operation to perform: 'list' to list all apps, 'create' to create a new app, 'update' to update an existing app. |
data | Operation-specific data. For 'list': not required. For 'create': {name}. For 'update': {id, name}. |
manage_keysets Manage PubNub Keyset
Manages PubNub keysets with operations: get, list, create, update. - 'get': Get a specific keyset information. User needs to provide the keyset id. - 'list': List all keysets for your account or a specific app. - 'create': Create a new keyset. New keyset is created with Message Persistence, App Context, Files, and Presence enabled by default; the user must provide name, production, and config with nested objects (messagePersistence, appContext, files, presence), and if any required parameter is missing, you must ask the user to provide it. - 'update': Up…
get_usage_metrics Get PubNub Usage Metrics
Fetches usage metrics from the PubNub Provisioning API. **Parameters:** - scope: 'app' or 'keyset' (determines which ID to use) - appId: Required when scope='app' - keysetId: Required when scope='keyset' - usageType: 'monthly_active_users' (for chat) or 'transaction' (for other use cases) - start: Start date in YYYY-MM-DD format - end: End date in YYYY-MM-DD format
| Parameter | Type | Description |
|---|---|---|
end * | string | End date in YYYY-MM-DD format. |
scope * | string | Scope of the metrics: 'app' to fetch metrics for an app, 'keyset' to fetch metrics for a keyset. |
start * | string | Start date in YYYY-MM-DD format. |
usageType * | string | Type of usage metrics: 'monthly_active_users' for chat, 'transaction' for other use cases. |
appId | string | The app ID to fetch metrics for. Required when scope='app'. |
keysetId | string | The keyset (key) ID to fetch metrics for. Required when scope='keyset'. |
manage_app_context Manage PubNub App Context
Manages PubNub App Context (Objects API) for users, channels, and memberships. Supports CRUD operations including get, set, remove, and getAll. Use this tool to manage user profiles, channel metadata, and membership relationships in your PubNub application.
| Parameter | Type | Description |
|---|---|---|
id * | string | Identifier: UUID (defaults to the SDK-configured user when omitted) for users and membership operations, channel metadata id (for example, team.red) for channel metadata and channel member operations |
operation * | string | Operation to perform: "get" to retrieve, "set" to create/update, "remove" to delete, "getAll" to list all |
publishKey * | string | Publish Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
subscribeKey * | string | Subscribe Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
type * | string | Type of App Context object: "user" for user metadata, "channel" for channel metadata, "membership" for user-channel relationships |
data | Data object for set/remove operations. For users: {name, email, externalId, profileUrl, custom}. For channels: {name, description, custom}. For memberships: {channels: [...]} — set operations accept… | |
options | object | Optional parameters for the operation |
send_pubnub_message Send Message or Signal to PubNub Channel
Send a message or signal to a PubNub channel in real-time. Supports both regular messages and lightweight signals. Plain strings are automatically wrapped in a 'text' field. Requires publish and subscribe keys from your PubNub keyset.
| Parameter | Type | Description |
|---|---|---|
channel * | string | Channel ID to publish message to |
message * | Message payload (can be any JSON-serializable value or plain string) | |
publishKey * | string | Publish Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
subscribeKey * | string | Subscribe Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
type | string | Type of message to publish: 'message' for regular messages or 'signal' for lightweight signals |
get_pubnub_presence Get Presence Data (HereNow / WhereNow)
Retrieves real-time presence information. Use 'channels'/'channelGroups' for HereNow (occupancy/users in channel) and/or 'uuid' for WhereNow (channels a user is in). Returns presence data in JSON format. Requires publish and subscribe keys from your PubNub keyset.
| Parameter | Type | Description |
|---|---|---|
publishKey * | string | Publish Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
subscribeKey * | string | Subscribe Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
channelGroups | array | List of channel group names (strings) to query presence data for |
channels | array | List of channel names (strings) to query presence data for |
uuid | string | UUID to query channel subscriptions for (WhereNow) |
subscribe_and_receive_pubnub_messages Subscribe to PubNub Channel and Receive Messages
Subscribe to a PubNub channel and receive messages in real-time. Specify the number of messages (default 1) and/or a timeout (default 10s, max 30s) to wait for. Requires publish and subscribe keys from your PubNub keyset.
| Parameter | Type | Description |
|---|---|---|
channel * | string | Channel ID to subscribe to and receive messages from |
publishKey * | string | Publish Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
subscribeKey * | string | Subscribe Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
messageCount | number | Number of messages to wait for before unsubscribing (default: 1 message) |
timeout | number | Maximum timeout in seconds. If not all messages are received within this time, the subscription will end (default: 10 seconds, max 30 seconds) |
get_pubnub_messages Get PubNub Channel History
Fetches historical messages from one or more PubNub channels. Call this tool whenever you need to access past message history. Provide a list of channel names. Returns message content and metadata in JSON format. Supports pagination with start/end timetokens and count limit.
| Parameter | Type | Description |
|---|---|---|
channels * | array | List of channel names to fetch history from |
publishKey * | string | Publish Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
subscribeKey * | string | Subscribe Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |
count | number | Number of historical messages to return per channel |
end | string | Timetoken delimiting the end (inclusive) of the time slice to pull messages from |
start | string | Timetoken delimiting the start (exclusive) of the time slice to pull messages from |