developer-tools

PubNub

by pubnub

Integrate PubNub's realtime messaging APIs and SDK info into AI assistants for seamless communication and instant docume

Enables AI assistants to interact with PubNub's realtime communication platform for retrieving documentation, accessing SDK information, and utilizing messaging APIs without leaving their conversation context.

github stars

30

20+ programming language SDKsWorks with Cursor, VS Code, and ClaudeBuilt with TypeScript for type safety

best for

  • / Developers building real-time chat applications
  • / Teams implementing live notifications and updates
  • / Creating community platforms with presence tracking
  • / AI assistants helping with PubNub integration

capabilities

  • / Access PubNub SDK documentation and code examples
  • / Create and manage PubNub applications and keysets
  • / Send and receive real-time messages across channels
  • / Manage user profiles and channel metadata
  • / Monitor real-time user presence and activity
  • / Configure message persistence and file sharing

what it does

Provides AI assistants with direct access to PubNub's real-time communication platform, including SDK documentation for 20+ languages and messaging APIs for building chat and real-time features.

about

PubNub is an official MCP server published by pubnub that provides AI assistants with tools and capabilities via the Model Context Protocol. Integrate PubNub's realtime messaging APIs and SDK info into AI assistants for seamless communication and instant docume It is categorized under developer tools.

how to install

You can install PubNub in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

license

NOASSERTION

PubNub is released under the NOASSERTION license.

readme

PubNub MCP Server v2

This repository provides a CLI-based Model Context Protocol (MCP) server that exposes PubNub SDK documentation and PubNub API resources to LLM-powered tools. This improves the LLM AI Agent's ability to understand and interact with PubNub's SDKs and APIs.

PubNub MCP Server v2

Features

  • 📚 Comprehensive SDK Documentation - Access detailed documentation, code examples, and implementation guides for 20+ programming languages including JavaScript, Python, Java, Swift, Kotlin, C#, Ruby, Go, and more
  • 🏗️ Application & Keyset Management - Create, configure, and manage PubNub applications and keysets with features like message persistence, file sharing, presence tracking, and app context
  • 💬 Real-time Communication - Send and receive messages across channels, implement live chat, notifications, and real-time updates with support for both messages and lightweight signals
  • 👥 User & Channel Management - Manage user profiles, channel metadata, and membership relationships with full CRUD operations for building community and social features
  • 📍 Presence & Activity Tracking - Monitor real-time user presence, see who's online in channels, and track user activity across your application
  • 🔧 Multi-Platform Integration - Works with Cursor, Visual Studio Code, Claude Code, and other MCP-compatible AI assistants
  • ⚡ Developer Experience - Built with TypeScript for type safety, includes testing infrastructure, and can be installed as either a Node package or a Docker image

Quick Start

API Key

Before you begin, we highly recommend creating a Service Integration in the PubNub Admin Portal and providing your API key to the MCP server. While some basic features will work without it, adding an API key unlocks much more functionality. Alternatively, refer to Advanced Usage for instructions on configuring the server to work with a single PubNub keyset.

The installation process for an MCP server depends on the AI assistant you’re using. For the standard setup, you’ll need Node.js (v20.0.0 or higher).

VS Code

Open in VS Code

Just click the link above, then select “Open in Visual Studio Code” on the page that appears. Back in VS Code, click “Install”. You’ll be prompted to enter your PubNub API Key. Once provided, your MCP server is ready to use. For additional configuration options, refer to Advanced usage.

Cursor

Add to Cursor

Click the link above, then select "Open Cursor" on the page that appears. Back in Cursor, there's a "Install MCP Server?" prompt. Make sure to provide the value for variable holding your PubNub API Key. Once you do, click "Install". Your MCP server is now ready to use. For additional configuration options, refer to Advanced usage.

Claude Code

With Claude Code installed run this command to have the MCP added to your configuration. Make sure to replace the value of <your-api-key>:

claude mcp add PubNub --env PUBNUB_API_KEY=<your-api-key> --scope user --transport stdio -- npx -y @pubnub/mcp@latest

Server is added in the "User" scope which means it will be available accross all projects. For additional configuration options, refer to Advanced usage.

Codex

With Codex installed run this command to have the MCP added to your configuration. Make sure to replace the value of <your-api-key>:

codex mcp add PubNub --env PUBNUB_API_KEY=<your-api-key> -- npx -y @pubnub/mcp@latest

For additional configuration options, refer to Advanced usage.

Gemini CLI

Gemini CLI does not support automatic MCP installations. You'll have manually edit your settings.json file and add the section below. Make sure to replace the value of <your-api-key>:

"mcpServers": {
  "pubnub": {
    "command": "npx",
    "args": [
      "-y",
      "@pubnub/mcp@latest"
    ],
    "env": {
      "PUBNUB_API_KEY": "<your-api-key>"
    }
  }
}

For additional configuration options, refer to Advanced usage.

Advanced usage

Configuration

  • PUBNUB_API_KEY - Your PubNub API Key. Required for all operations related to your account/keyset
  • PUBNUB_PUBLISH_KEY - Optional PubNub publish key for real-time operations
  • PUBNUB_SUBSCRIBE_KEY - Optional PubNub subscribe key for real-time operations
  • PUBNUB_USER_ID - Optional variable that can be provided to change the User ID for the SDK (real-time) operations (default: pubnub-mcp)
  • PUBNUB_EMAIL - (Deprecated - use API Key instead) Your PubNub account email. Required for all operations related to your account/keyset
  • PUBNUB_PASSWORD - (Deprecated - use API Key instead) Your PubNub account password. Required for all operations related to your account/keyset

PubNub Keys Configuration

The MCP server supports two modes for handling PubNub publish/subscribe keys:

Dynamic Mode (No env keys set)

When PUBNUB_PUBLISH_KEY and PUBNUB_SUBSCRIBE_KEY are not provided, the server operates in dynamic mode:

  • Tools will request keys as parameters in each call
  • The AI agent can work with multiple keysets in a single session
  • Keys can be discovered dynamically via manage_keysets tool
  • More autonomous - the agent decides which keyset to use based on context

This mode is ideal when you want the AI to help manage multiple applications or when the keyset should be determined at runtime.

Fixed Mode (Env keys set)

When both PUBNUB_PUBLISH_KEY and PUBNUB_SUBSCRIBE_KEY are provided, the server operates in fixed mode:

  • PubSub Keys parameters are hidden from tool schemas entirely
  • All real-time operations use the configured keys automatically
  • Operations are limited to a single keyset

This mode is ideal for focused workflows where you're working with a specific application and want streamlined interactions.

Example configuration with fixed keys:

{
  "env": {
    "PUBNUB_API_KEY": "<your-api-key>",
    "PUBNUB_PUBLISH_KEY": "pub-c-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "PUBNUB_SUBSCRIBE_KEY": "sub-c-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  }
}

Docker-Based Usage

If you prefer to run the MCP server via Docker, use the snippet below in your editor's config file mcpServers or servers section of the mcp.json:

{
  "mcpServers": {
    "PubNub": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PUBNUB_API_KEY",
        "pubnub/pubnub-mcp-server"
      ],
      "env": {
        "PUBNUB_API_KEY": "<your-api-key>",
      }
    }
  }
}

API Reference

This PubNub MCP server provides a comprehensive set of tools, resources, and prompts to help you build real-time applications. Below is a complete reference of all available functionality:

Tools

Documentation Access

  • get_sdk_documentation - Get PubNub Core SDK documentation for specific programming languages and features
  • get_chat_sdk_documentation - Get PubNub Chat SDK documentation for specific programming languages and features
  • how_to - Get PubNub conceptual guides for specific use cases and integrations
  • write_pubnub_app - Get PubNub best practices guide covering architecture, security, channel modeling, and optimization

App & Keyset Management

  • manage_apps - Manage PubNub apps with operations: list, create, and update (requires API key authentication)
  • manage_keysets - Manage PubNub keysets with operations: get, list, create, and update (requires API key authentication)
  • get_usage_metrics - Fetch usage metrics for an account, app, or keyset (requires API key authentication)

Real-time Communication

  • send_pubnub_message - Send messages or lightweight signals to PubNub channels in real-time
  • subscribe_and_receive_pubnub_messages - Subscribe to channels and receive real-time messages with configurable timeout and message limits
  • get_pubnub_messages - Fetch historical messages from one or more PubNub channels
  • get_pubnub_presence - Get presence data using HereNow (channel occupancy) or WhereNow (user's channels)
  • manage_app_context - Manage PubNub App Context (Objects API) for users, channels, and memberships with full CRUD operations

Prompts

Healthcare & HIPAA Compliance

  • hipaa-chat-short - Quick prompt to create HIPAA compliant chat applications
  • hipaa-chat-long - Detailed prompt for HIPAA compliant chat with Pub/Sub, Presence, and App Context

React Development

  • react-app-short - Scaffold a React app with PubNub Pub/Sub and Presence
  • react-app-long - Comprehensive React app with real-time messaging, presence indicators, and user metadata

Gaming Applications

  • gamelobby-short - Build multiplayer game lobby with chat and presence
  • gamelobby-long - Advanced multiplayer lobby with team assignments and real-time features

OEM & Multi-Tenant Solutions

  • oem-client-management - Create apps and configure keysets for OEM

FAQ

What is the PubNub MCP server?
PubNub is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
How do MCP servers relate to agent skills?
Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
How are reviews shown for PubNub?
This profile displays 10 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.5 out of 5—verify behavior in your own environment before production use.
MCP server reviews

Ratings

4.510 reviews
  • Shikha Mishra· Oct 10, 2024

    PubNub is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.

  • Piyush G· Sep 9, 2024

    We evaluated PubNub against two servers with overlapping tools; this profile had the clearer scope statement.

  • Chaitanya Patil· Aug 8, 2024

    Useful MCP listing: PubNub is the kind of server we cite when onboarding engineers to host + tool permissions.

  • Sakshi Patil· Jul 7, 2024

    PubNub reduced integration guesswork — categories and install configs on the listing matched the upstream repo.

  • Ganesh Mohane· Jun 6, 2024

    I recommend PubNub for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.

  • Oshnikdeep· May 5, 2024

    Strong directory entry: PubNub surfaces stars and publisher context so we could sanity-check maintenance before adopting.

  • Dhruvi Jain· Apr 4, 2024

    PubNub has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Rahul Santra· Mar 3, 2024

    According to our notes, PubNub benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.

  • Pratham Ware· Feb 2, 2024

    We wired PubNub into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.

  • Yash Thakker· Jan 1, 2024

    PubNub is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.