P

Pubnub MCP Server

by pubnub · io.github.pubnub/mcp-server

A CLI-based Model Context Protocol server that exposes PubNub SDK documentation and Functions resources to LLM-powered tools like Cursor IDE, enabling users to fetch documentation and interact with PubNub channels via natural language prompts.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp"
      ],
      "env": {
        "PUBNUB_API_KEY": "<YOUR_VALUE>",
        "PUBNUB_PUBLISH_KEY": "<YOUR_VALUE>",
        "PUBNUB_SUBSCRIBE_KEY": "<YOUR_VALUE>",
        "PUBNUB_USER_ID": "<VALUE>",
        "PUBNUB_EMAIL": "<VALUE>",
        "PUBNUB_PASSWORD": "<YOUR_VALUE>",
        "HTTP_PORT": "<VALUE>",
        "MCP_SUBSCRIBE_ANALYTICS_DISABLED": "<VALUE>"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp"
      ],
      "env": {
        "PUBNUB_API_KEY": "<YOUR_VALUE>",
        "PUBNUB_PUBLISH_KEY": "<YOUR_VALUE>",
        "PUBNUB_SUBSCRIBE_KEY": "<YOUR_VALUE>",
        "PUBNUB_USER_ID": "<VALUE>",
        "PUBNUB_EMAIL": "<VALUE>",
        "PUBNUB_PASSWORD": "<YOUR_VALUE>",
        "HTTP_PORT": "<VALUE>",
        "MCP_SUBSCRIBE_ANALYTICS_DISABLED": "<VALUE>"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp"
      ],
      "env": {
        "PUBNUB_API_KEY": "<YOUR_VALUE>",
        "PUBNUB_PUBLISH_KEY": "<YOUR_VALUE>",
        "PUBNUB_SUBSCRIBE_KEY": "<YOUR_VALUE>",
        "PUBNUB_USER_ID": "<VALUE>",
        "PUBNUB_EMAIL": "<VALUE>",
        "PUBNUB_PASSWORD": "<YOUR_VALUE>",
        "HTTP_PORT": "<VALUE>",
        "MCP_SUBSCRIBE_ANALYTICS_DISABLED": "<VALUE>"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp"
      ],
      "env": {
        "PUBNUB_API_KEY": "<YOUR_VALUE>",
        "PUBNUB_PUBLISH_KEY": "<YOUR_VALUE>",
        "PUBNUB_SUBSCRIBE_KEY": "<YOUR_VALUE>",
        "PUBNUB_USER_ID": "<VALUE>",
        "PUBNUB_EMAIL": "<VALUE>",
        "PUBNUB_PASSWORD": "<YOUR_VALUE>",
        "HTTP_PORT": "<VALUE>",
        "MCP_SUBSCRIBE_ANALYTICS_DISABLED": "<VALUE>"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp"
      ],
      "env": {
        "PUBNUB_API_KEY": "<YOUR_VALUE>",
        "PUBNUB_PUBLISH_KEY": "<YOUR_VALUE>",
        "PUBNUB_SUBSCRIBE_KEY": "<YOUR_VALUE>",
        "PUBNUB_USER_ID": "<VALUE>",
        "PUBNUB_EMAIL": "<VALUE>",
        "PUBNUB_PASSWORD": "<YOUR_VALUE>",
        "HTTP_PORT": "<VALUE>",
        "MCP_SUBSCRIBE_ANALYTICS_DISABLED": "<VALUE>"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-pubnub-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pubnub/mcp"
      ],
      "env": {
        "PUBNUB_API_KEY": "<YOUR_VALUE>",
        "PUBNUB_PUBLISH_KEY": "<YOUR_VALUE>",
        "PUBNUB_SUBSCRIBE_KEY": "<YOUR_VALUE>",
        "PUBNUB_USER_ID": "<VALUE>",
        "PUBNUB_EMAIL": "<VALUE>",
        "PUBNUB_PASSWORD": "<YOUR_VALUE>",
        "HTTP_PORT": "<VALUE>",
        "MCP_SUBSCRIBE_ANALYTICS_DISABLED": "<VALUE>"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
PUBNUB_API_KEY secret No Your PubNub API Key. Required for all operations related to your account/keyset
PUBNUB_PUBLISH_KEY secret No Your PubNub publish key (required for publishing messages)
PUBNUB_SUBSCRIBE_KEY secret No Your PubNub subscribe key (required for subscribing and message history)
PUBNUB_USER_ID No Optional variable that can be provided to change the User ID for the SDK (real-time) operations (default: pubnub-mcp)
PUBNUB_EMAIL No (Deprecated - use API Key instead) Your PubNub account email. Required for all operations related to your account/keyset
PUBNUB_PASSWORD secret No (Deprecated - use API Key instead) Your PubNub account password. Required for all operations related to your account/keyset
HTTP_PORT No Port number to enable Server-Sent Events (SSE) HTTP transport mode
MCP_SUBSCRIBE_ANALYTICS_DISABLED No Set to 'true' to disable the PubNub server analytics subscription

Similar servers