Compatible with every major AI agent and IDE
What is the PubNub (Real-time Messaging) MCP Server?
Connect your PubNub account to any AI agent to orchestrate real-time communication, monitor user presence, and manage data streams through natural language.
What you can do
- Real-time Messaging — Publish JSON payloads to any channel and retrieve historical message logs with precise timetokens.
- Presence Monitoring — Track who is online (
here_now), see which channels a user is in (where_now), and manage custom presence states. - User & Channel Metadata — Manage App Context by creating and retrieving user profiles, channel metadata, and memberships.
- Message Management — Count messages sent after specific timestamps or purge history for compliance and storage management.
- File Sharing — Generate upload URLs and manage files stored within the PubNub network.
- Admin & Push — Monitor keyset metrics, manage applications, and configure mobile push notifications (APNS/FCM).
How it works
- Subscribe to this server
- Enter your PubNub Subscribe Key, Publish Key, and UUID
- Start streaming data and managing real-time interactions from your MCP-compatible client
Who is this for?
- IoT Developers — Monitor device heartbeats and send control commands via real-time channels.
- Support Teams — Inspect chat history and user presence to provide better live assistance.
- System Architects — Audit channel metadata and monitor keyset metrics directly from the AI interface.
Built-in capabilities (31)
Create a new PubNub app (Admin API)
Get usage metrics (Admin API)
List all PubNub apps (Admin API)
List all keysets (Admin API)
Delete a file from a channel
Delete message history for channels
Generate a file upload URL
Get all channels (App Context)
Get all users (App Context)
Get a specific channel (App Context)
Get a file URL
Get memberships for a user (App Context)
Get message count for channels
Get message history for channels
Get a specific user (App Context)
List files in a channel
Grant a PAM v3 token
Revoke a PAM v3 token
Get presence state for a user in a channel
Send presence heartbeat
Get current channel occupancy (Here Now)
Leave a channel (Presence)
Set presence state for a user in a channel
Get channels a user is in (Where Now)
Publish a message to a channel
Manage or list push notification channels for a device (APNS v2)
Remove all push notification channels for a device (APNS v2)
Remove a user (App Context)
Set or update a channel (App Context)
Set or update memberships for a user (App Context)
Set or update a user (App Context)
Why Mastra AI?
Mastra's agent abstraction provides a clean separation between LLM logic and PubNub (Real-time Messaging) tool infrastructure. Connect 31 tools through Vinkius and use Mastra's built-in workflow engine to chain tool calls with conditional logic, retries, and parallel execution. deployable to any Node.js host in one command.
- —
Mastra's agent abstraction provides a clean separation between LLM logic and tool infrastructure. add PubNub (Real-time Messaging) without touching business code
- —
Built-in workflow engine chains MCP tool calls with conditional logic, retries, and parallel execution for complex automation
- —
TypeScript-native: full type inference for every PubNub (Real-time Messaging) tool response with IDE autocomplete and compile-time checks
- —
One-command deployment to any Node.js host. Vercel, Railway, Fly.io, or your own infrastructure
PubNub (Real-time Messaging) in Mastra AI
PubNub (Real-time Messaging) and 4,000+ other MCP servers. One platform. One governance layer.
Teams that connect PubNub (Real-time Messaging) to Mastra AI through Vinkius don't need to source, host, or maintain individual MCP servers. Every tool call runs inside a hardened runtime with credential isolation, DLP, and a signed audit chain.
Raw MCP | Vinkius | |
|---|---|---|
| Server catalog | Find and host yourself | 4,000+ managed |
| Infrastructure | Self-hosted | Sandboxed V8 isolates |
| Credential handling | Plaintext in config | Vault + runtime injection |
| Data loss prevention | None | Configurable DLP policies |
| Kill switch | None | Global instant shutdown |
| Financial circuit breakers | None | Per-server limits + alerts |
| Audit trail | None | Ed25519 signed logs |
| SIEM log streaming | None | Splunk, Datadog, Webhook |
| Honeytokens | None | Canary alerts on leak |
| Custom domains | Not applicable | DNS challenge verified |
| GDPR compliance | Manual effort | Automated purge + export |
Why teams choose Vinkius for PubNub (Real-time Messaging) in Mastra AI
The PubNub (Real-time Messaging) MCP Server runs on Vinkius-managed infrastructure inside AWS — a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts. All 31 tools execute in hardened sandboxes optimized for native MCP execution.
Your AI agents in Mastra AI only access the data you authorize, with DLP that blocks sensitive information from ever reaching the model, kill switch for instant shutdown, and up to 60% token savings. Enterprise-grade infrastructure, zero maintenance.

* Every MCP server runs on Vinkius-managed infrastructure inside AWS - a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts optimized for native MCP execution. See our infrastructure
How Vinkius secures
PubNub (Real-time Messaging) for Mastra AI
Every tool call from Mastra AI to the PubNub (Real-time Messaging) MCP Server is protected by DLP redaction, cryptographic audit chains, V8 sandbox isolation, kill switch, and financial circuit breakers.
Frequently asked questions
How can I check if a specific user is currently online in a channel?
You can use the presence_here_now tool to see a list of all active UUIDs in a specific channel, or presence_where_now to find all channels a specific UUID is currently subscribed to.
Can the AI retrieve past messages from a channel?
Yes, the get_message_history tool allows the agent to fetch historical messages from one or more channels, including metadata and specific time ranges.
Is it possible to manage user profiles and metadata through this server?
Absolutely. You can use set_user to create or update profiles and get_user to retrieve them. You can also manage channel metadata using set_channel and get_channel.
How does Mastra AI connect to MCP servers?
Create an MCPClient with the server URL and pass it to your agent. Mastra discovers all tools and makes them available with full TypeScript types.
Can Mastra agents use tools from multiple servers?
Yes. Pass multiple MCP clients to the agent constructor. Mastra merges all tool schemas and the agent can call any tool from any server.
Does Mastra support workflow orchestration?
Yes. Mastra has a built-in workflow engine that lets you chain MCP tool calls with branching logic, error handling, and parallel execution.
createMCPClient not exported
Install: npm install @mastra/mcp
Explore More MCP Servers
View all →
Gusto
10 toolsManage employees, run payroll, view benefits and time-off policies — HR automation for AI agents.

K-Fold Split Engine
1 toolsGenerate rigorous, leak-proof cross-validation indices for train and test splits in machine learning pipelines.

Swan
9 toolsEmpowers algorithmic control over European Bank Accounts. Execute SEPA transfers and manage Virtual Corporate Cards programmatically.

Fxiaoke
10 toolsLeading sales management and CRM platform in China — manage leads, opportunities, and approvals via AI.
