Back to MCP directory
publicPublicdnsLocal runtime

pusher-mcp-server

一个基于MCP协议的Pusher Channels服务器,为AI代理提供实时消息推送、频道管理和用户连接控制功能。

article

README

🚀 Pusher Channels MCP 服务器

这是一个 MCP(模型上下文协议) 服务器,它使 AI 代理能够通过 Pusher Channels 发送实时消息、查询频道并管理用户。

🚀 快速开始

Pusher Channels MCP 服务器借助 MCP 协议,让 AI 代理可以利用 Pusher Channels 实现实时通信、频道管理等功能。

✨ 主要特性

| 工具 | 描述 | |------|-------------| | trigger_event | 向一个或多个频道发送事件 | | trigger_batch_events | 在单个 API 调用中发送多达 10 个事件 | | list_channels | 列出活跃频道,可选择使用前缀过滤器 | | get_channel_info | 获取频道的订阅/用户数量 | | get_presence_users | 列出连接到存在频道的用户 | | authorize_channel | 为私有/存在频道生成认证令牌 | | terminate_user_connections | 断开用户的所有连接 |

📦 安装指南

使用 npm 全局安装

npm install -g @crashbytes/pusher-mcp-server

从源代码克隆并构建

git clone https://github.com/CrashBytes/pusher-mcp-server.git
cd pusher-mcp-server
npm install
npm run build

🔧 配置说明

你需要从 Pusher 控制台 获取四个环境变量: | 变量 | 描述 | |----------|-------------| | PUSHER_APP_ID | 你的 Pusher 应用 ID | | PUSHER_KEY | 你的 Pusher 应用密钥 | | PUSHER_SECRET | 你的 Pusher 应用秘钥 | | PUSHER_CLUSTER | 你的 Pusher 集群(例如 us2euap1) |

💻 使用示例

与 Claude Desktop 配合使用

将以下内容添加到你的 Claude Desktop 配置文件中:

  • macOS~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows%APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "pusher": {
      "command": "node",
      "args": ["/path/to/pusher-mcp-server/build/index.js"],
      "env": {
        "PUSHER_APP_ID": "your_app_id",
        "PUSHER_KEY": "your_app_key",
        "PUSHER_SECRET": "your_app_secret",
        "PUSHER_CLUSTER": "us2"
      }
    }
  }
}

如果你是通过 npm 全局安装的:

{
  "mcpServers": {
    "pusher": {
      "command": "pusher-mcp-server",
      "env": {
        "PUSHER_APP_ID": "your_app_id",
        "PUSHER_KEY": "your_app_key",
        "PUSHER_SECRET": "your_app_secret",
        "PUSHER_CLUSTER": "us2"
      }
    }
  }
}

与 Claude Code 配合使用

claude mcp add pusher -- node /path/to/pusher-mcp-server/build/index.js

在运行之前,在你的 shell 中设置环境变量,或者在你的 Claude Code MCP 设置中进行配置。

示例提示

配置完成后,你可以向 Claude 提出如下问题:

  • "向通知频道发送一个 'deploy-complete' 事件,并附带消息 'v2.1.0 已部署'"
  • "显示所有活跃的存在频道"
  • "存在大厅频道上有多少用户?"
  • "断开用户 abc123 与所有频道的连接"

🔧 开发说明

npm install
npm run dev          # 使用 tsx 运行(热重载)
npm run build        # 编译 TypeScript
npm run type-check   # 检查类型而不生成文件

📚 详细文档

如需了解从头开始构建此服务器的详细步骤指南,请参阅 CrashBytes 上的完整教程。

📄 许可证

本项目采用 MIT 许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client