Integrations
Provides formatted SDK documentation for PubNub's JavaScript SDK, allowing developers to access reference materials for methods like subscribe() and publish() from within Cursor IDE.
Supports PubNub functionality through Node.js, allowing users to publish messages to channels, subscribe to channels, fetch message history, and retrieve presence information.
Offers access to PubNub's Python SDK documentation, enabling users to fetch docs for methods like publish() directly through Cursor IDE.
PubNub Model Context Protocol (MCP) Server for Cursor IDE
This repository provides a CLI-based Model Context Protocol (MCP) server that exposes PubNub SDK documentation and PubNub Functions resources to LLM-powered tools. By adding this server to Cursor IDE, you can:
- Fetch formatted PubNub JavaScript, Python, and Java SDK documentation.
- Access PubNub Functions documentation from a static Markdown file.
Example Prompts
- "Publish a message to the
my_channel
channel with the messageHello, PubNub!
." - "Show me the PubNub JavaScript SDK documentation for
subscribe()
." - "List all available PubNub Functions."
- "Fetch the Python SDK docs for the
publish()
method." - "Fetch the message history for the
test
channel." - "Retrieve presence information (occupancy and UUIDs) for the
test
channel and thedefault
channel group."
This requires Node.js (>= 18) and npm (https://nodejs.org/).
npx
will automatically fetch and run the latest MCP server.
Prerequisites
- Node.js (>= 18) and npm
- Cursor IDE with MCP support
- (Optional) PubNub account and API keys for live examples
Installation
The preferred way to run the PubNub MCP server locally or add it to Cursor IDE via npx:
Configuration
Cursor must be in AGENT MODE to use MCP servers.
Cursor IDE discovers MCP servers via a JSON config file. Configure the PubNub MCP server globally or per project.
Global Configuration
Edit or create ~/.cursor/mcp.json
:
Project Configuration
In your project directory, create .cursor/mcp.json
:
command
specifies the executable to launch the MCP server.args
specifies the arguments to pass to the command.env
sets environment variables for the server process.
Using in Cursor IDE
- Restart Cursor IDE or open a new session.
- Open the MCP settings pane and verify the pubnub server is listed under Available Tools & Resources.
- In chat, invoke available resources:
pubnub://docs/javascript
— Fetch PubNub JavaScript SDK documentationpubnub://docs/python
— Fetch PubNub Python SDK documentationpubnub://docs/java
— Fetch PubNub Java SDK documentationpubnub://functions
— List PubNub Functions (static content fromresources/pubnub_functions.md
)
- Approve resource execution when prompted, or enable auto-run in settings for trusted resources.
Claude Code
And the output will be:
Example prompt
Remove the MCP server with:
Using Claude Desktop
- In the Tools section, add a new tool named pubnub.
- Set the Command to
npx
and Arguments to["-y", "@pubnub/mcp"]
. - Add environment variables for your PubNub keys:
PUBNUB_SUBSCRIBE_KEY
PUBNUB_PUBLISH_KEY
- Save the configuration.
Claude Desktop may use an old verson of node. You may need to set the command to the full path of your node installation.
MCP server is located in the index.js
file.:
License
This project is licensed under the MIT License. See the LICENSE file for details.
Troubleshooting
- Must be in agents mode to use MCP servers.
- Verify Node.js and npm installation.
- Ensure
server.js
has execute permission. - Check that the
command
,args
, andenv
settings are correct. - Review Cursor IDE logs for MCP startup errors.
Direct JSON-RPC Command-Line Usage
You can invoke the MCP server directly over STDIN/STDOUT using JSON-RPC v2.0. Ensure your PubNub keys are set in the environment, for example:
Once the server is running (or using a one-off invocation), send requests by piping JSON into node index.js
. Examples:
Quick JSON-RPC Examples
Below are simplified JSON-RPC v2.0 command-line examples using STDIN/STDOUT to fetch PubNub SDK documentation and publish messages.
1) Fetch PubNub JavaScript SDK documentation
2) Publish a message to a PubNub channel
License
MIT
You must be authenticated.
Tools
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.
Related MCP Servers
- AsecurityAlicenseAqualityA template for creating and connecting custom tools to Cursor IDE using Model Context Protocol with support for cheerful server responses.Last updated -41PythonMIT License
- -securityFlicense-qualityA simple Model Context Protocol server that enables searching and retrieving relevant documentation snippets from Langchain, Llama Index, and OpenAI official documentation.Last updated -Python
- -securityFlicense-qualityA customized MCP server that enables integration between LLM applications and documentation sources, providing AI-assisted access to LangGraph and Model Context Protocol documentation.Last updated -Python
- AsecurityAlicenseAqualityA Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.Last updated -72927TypeScriptMIT License