# PubNub MCP Server

Gives AI agents access to PubNub SDK documentation and API tools for managing apps, messages, channels, and user presence.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 33
- Author: pubnub
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pubnub/pubnub-mcp-server
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/pubnub-mcp-server

## What it does

The server connects an agent to PubNub documentation and API resources. It can help manage applications and keysets, send messages, work with user profiles and channel membership, and inspect presence. Usage data and analytics are also available. Real-time decisioning needs Illuminate; full analytics require Manage Premium.

For Claude Code, the local server runs through `npx -y @pubnub/mcp`. Its setup command passes API, publish, and subscribe keys, along with either `PUBNUB_PASSWORD` or `PUBNUB_USER_ID` and `PUBNUB_EMAIL`. The local process needs the supplied environment values to receive those credentials. Codex and Cursor are also listed as supported platforms.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `PUBNUB_API_KEY`, `PUBNUB_PUBLISH_KEY`, `PUBNUB_SUBSCRIBE_KEY`, `PUBNUB_USER_ID`, `PUBNUB_EMAIL`, `PUBNUB_PASSWORD` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env PUBNUB_API_KEY=<PUBNUB_API_KEY> --env PUBNUB_PUBLISH_KEY=<PUBNUB_PUBLISH_KEY> --env PUBNUB_SUBSCRIBE_KEY=<PUBNUB_SUBSCRIBE_KEY> --env PUBNUB_USER_ID=<PUBNUB_USER_ID> --env PUBNUB_EMAIL=<PUBNUB_EMAIL> --transport stdio pubnub-mcp-server -- npx -y @pubnub/mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Codex

**Platform CLI**
```bash
codex mcp add pubnub-mcp-server --env PUBNUB_API_KEY=<PUBNUB_API_KEY> --env PUBNUB_PUBLISH_KEY=<PUBNUB_PUBLISH_KEY> --env PUBNUB_SUBSCRIBE_KEY=<PUBNUB_SUBSCRIBE_KEY> --env PUBNUB_USER_ID=<PUBNUB_USER_ID> --env PUBNUB_EMAIL=<PUBNUB_EMAIL> -- npx -y @pubnub/mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "pubnub-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@pubnub/mcp"
            ],
            "env": {
                "PUBNUB_API_KEY": "<PUBNUB_API_KEY>",
                "PUBNUB_PUBLISH_KEY": "<PUBNUB_PUBLISH_KEY>",
                "PUBNUB_SUBSCRIBE_KEY": "<PUBNUB_SUBSCRIBE_KEY>",
                "PUBNUB_USER_ID": "<PUBNUB_USER_ID>",
                "PUBNUB_EMAIL": "<PUBNUB_EMAIL>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "pubnub-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@pubnub/mcp"
            ],
            "env": {
                "PUBNUB_API_KEY": "<PUBNUB_API_KEY>",
                "PUBNUB_PUBLISH_KEY": "<PUBNUB_PUBLISH_KEY>",
                "PUBNUB_SUBSCRIBE_KEY": "<PUBNUB_SUBSCRIBE_KEY>",
                "PUBNUB_USER_ID": "<PUBNUB_USER_ID>",
                "PUBNUB_EMAIL": "<PUBNUB_EMAIL>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e PUBNUB_API_KEY=<PUBNUB_API_KEY> -e PUBNUB_PUBLISH_KEY=<PUBNUB_PUBLISH_KEY> -e PUBNUB_SUBSCRIBE_KEY=<PUBNUB_SUBSCRIBE_KEY> -e PUBNUB_USER_ID=<PUBNUB_USER_ID> -e PUBNUB_EMAIL=<PUBNUB_EMAIL> pubnub-mcp-server npx -y @pubnub/mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README

## When to use it
- look up an SDK implementation example
- create an app and configure its keyset
- publish a message to a channel
- check user presence in a channel
- review app and keyset usage

## Example prompts
- Find a PubNub SDK example for subscribing to a channel.
- Create a PubNub app and configure a keyset for messaging.
- Show user activity and channel analytics in PubNub.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74559
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
