pubnub
PubNub MCP Model Context Protocol Server for use in Cursor, Windsurf, Claude Desktop, Claude Code and OpenAI Codex and more!
claude mcp add --transport stdio pubnub-pubnub-mcp-server npx -y @pubnub/mcp@latest \ --env PUBNUB_API_KEY="<your-pubnub-api-key>"
How to use
The PubNub MCP Server exposes PubNub SDK documentation, API resources, and common workflows as MCP tools that an AI agent can invoke. It provides access to PubNub Core SDK docs, PubNub Chat SDK docs, and a collection of prompts and utilities for managing keys, apps, and keysets, as well as real-time publish/subscribe interactions across channels. Use the tools to fetch SDK guidance, generate example code snippets, manage keysets, and perform live-style operations through the MCP prompts described in the API Reference. The server supports either dynamic key handling (where publish/subscribe keys are requested per call) or fixed keys (where keys are supplied at startup). This allows you to run the server in a multi-tenant mode or with a single, fixed PubNub configuration depending on your needs.
To get started, configure your environment with a PubNub API Key and, optionally, publish/subscribe keys. Then run the MCP server via your preferred integration (VS Code, Cursor, Claude Code, or a Gemini/CLI setup). The available tools include documentation fetchers like get_sdk_documentation and get_chat_sdk_documentation, as well as keyset management and real-time operation helpers, enabling an AI agent to explore PubNub capabilities directly within your workflow.
How to install
Prerequisites:
- Node.js v20.0.0 or higher and npm
- Access to an API key pair (PUBNUB_API_KEY) to unlock full functionality
-
Install Node.js (if not already installed):
- macOS: brew install node
- Windows: download and install from nodejs.org
- Linux: use your distribution’s package manager (e.g., apt, yum)
-
Install or pull the MCP server via npx (recommended for quick start):
- Ensure you have an API key ready
- Run the MCP server (example using the recommended config): npx -y @pubnub/mcp@latest
-
Alternative: Run via Docker
- Prerequisites: Docker installed and running
- Run the container: docker run -i --rm -e PUBNUB_API_KEY=<your-api-key> pubnub/pubnub-mcp-server
-
Configure your MCP server in your editor or integration:
- For VS Code, Cursor, Claude Code, or Gemini, use the provided mcpServers configuration (see README examples) and supply PUBNUB_API_KEY as needed.
- Example config snippet is available in the README under Advanced usage (PubNub Keys Configuration and Docker-Based Usage).
Additional notes
Tips and notes:
- PUBNUB_API_KEY is required for full functionality; without it, basic features may work but some keyset-dependent actions will be limited.
- You can operate in Dynamic Mode (no env keys) to allow the agent to select keysets per request, or Fixed Mode (env keys provided) for a single keyset.
- If you plan to run multiple PubNub apps or keysets in one session, Dynamic Mode is recommended to maximize flexibility.
- When using Docker, ensure the container has access to the required environment variables and that the image pubnub/pubnub-mcp-server is up to date.
- The MCP server can be installed as a Node package or Docker image, enabling integration with modern editor environments and AI assistants.
- For Gemini CLI users, the config example includes an explicit mcpServers entry with npx @pubnub/mcp@latest and env PUBNUB_API_KEY.
Related MCP Servers
mcp-graphql
Model Context Protocol server for GraphQL
systemprompt-code-orchestrator
MCP server for orchestrating AI coding agents (Claude Code CLI & Gemini CLI). Features task management, process execution, Git integration, and dynamic resource discovery. Full TypeScript implementation with Docker support and Cloudflare Tunnel integration.
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)
mcp -chart-minio
mcp-server-chart私有化部署方案
modular
A Model Context Protocol (MCP) proxy server that enables efficient management of large tool collections across multiple MCP servers by grouping them and loading tool schemas on-demand.
cco
Real-time audit and approval system for Claude Code tool calls.