# PubNub MCP Server

> PubNub's own MCP server: your agent manages apps and keysets, sends and reads real-time messages, and looks up current PubNub SDK docs.

PubNub's own MCP server lets your agent work on your PubNub account from plain-language requests. It acts on your real apps, keysets and channels, and pulls current PubNub SDK documentation instead of relying on what the model remembers.

What you can do with it
- Look up current Core SDK and Chat SDK docs, how-to guides, best practices and migration guides
- List, create and rename apps, and create and configure keysets with Message Persistence, Presence, App Context and File Sharing
- Publish messages and signals, subscribe and wait for messages, and read message history
- See who's in a channel, and manage App Context users, channels and memberships
- Read usage metrics and Insights analytics, such as top channels and new vs. recurring users
- Set up Illuminate business objects, metrics and decisions, and manage Functions packages and deployments

How it connects
This listing installs the local server, PubNub's @pubnub/mcp npm package, which your agent starts with npx and which needs Node.js 20 or later. Give it a Service Integration API key from the PubNub Admin Portal as PUBNUB_API_KEY. Without one, only the documentation tools, and the real-time tools you pass a publish and subscribe key to, work. Anything the key can do, your agent can do, so grant only the permissions you want it to have, and keep the key out of files you commit.

Good to know
- PubNub also hosts the same tools at https://mcp.pubnub.com, where you sign in with your PubNub account instead of using an API key. PubNub suggests it when your agent supports remote MCP servers.
- Insights needs the Insights Premium plan, and on the local server the key needs Insights Read access.
- It also ships prompt templates for builds such as HIPAA-compliant chat, a React app with Pub/Sub and Presence, multiplayer game lobbies and multi-tenant onboarding.
- Set MCP_ANALYTICS_DISABLED=true to turn off the usage analytics it reports.

- Type: Plugin
- Made by: pubnub
- Category: Developer tools
- Formats: Local MCP
- Version: 2.3.2
- Website: https://www.pubnub.com/docs/ai-development/mcp-server
- Source: https://github.com/pubnub/pubnub-mcp-server
- Page: https://pluginboard.ai/plugins/pubnub-mcp

## Works with

- Claude
- GitHub Copilot
- Cursor
- Claude Code
- Codex
- Antigravity
- Gemini CLI
- OpenClaw
- OpenCode
- Hermes Agent

## Install

You'll need:

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

Replace each `<NAME>` placeholder with your own value.

### Claude

Add to claude_desktop_config.json:

```json
{
  "mcpServers": {
    "pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp@2.3.2"
      ]
    }
  }
}
```

### GitHub Copilot

Add to VS Code: vscode:mcp/install?%7B%22name%22%3A%22pubnub-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40pubnub%2Fmcp%402.3.2%22%5D%7D

Run in your terminal:

```shell
code --add-mcp '{"name":"pubnub-mcp-server","command":"npx","args":["-y","@pubnub/mcp@2.3.2"]}'
```

Copilot CLI:

```shell
copilot mcp add pubnub-mcp-server -- npx -y @pubnub/mcp@2.3.2
```

### Cursor

Add to Cursor: cursor://anysphere.cursor-deeplink/mcp/install?name=pubnub-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBwdWJudWIvbWNwQDIuMy4yIl19

Add to .cursor/mcp.json:

```json
{
  "mcpServers": {
    "pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp@2.3.2"
      ]
    }
  }
}
```

### Claude Code

Run in your terminal:

```shell
claude mcp add pubnub-mcp-server -- npx -y @pubnub/mcp@2.3.2
```

### Codex

Run in your terminal:

```shell
codex mcp add pubnub-mcp-server -- npx -y @pubnub/mcp@2.3.2
```

### Antigravity

Add to ~/.gemini/config/mcp_config.json:

```json
{
  "mcpServers": {
    "pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp@2.3.2"
      ]
    }
  }
}
```

### Gemini CLI

Run in your terminal:

```shell
gemini mcp add pubnub-mcp-server npx -y @pubnub/mcp@2.3.2
```

### OpenClaw

In a terminal: Run openclaw mcp add pubnub-mcp-server --command npx, with --arg before each argument (-y @pubnub/mcp@2.3.2) and --env NAME=value for each variable it needs.

### OpenCode

Run in your terminal:

```shell
opencode mcp add pubnub-mcp-server -- npx -y @pubnub/mcp@2.3.2
```

### Hermes Agent

Add to ~/.hermes/config.yaml:

```json
{
  "mcp_servers": {
    "pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp@2.3.2"
      ]
    }
  }
}
```

---
From Pluginboard (https://pluginboard.ai).
