GET Method

https://www.phprm.com/services/push/trigger/xxxxxxxxxxxxxxx?head=msgHead&body=msgBody

Note: Garbled? Encode parameters yourself. Long body? Use POST. To open a custom message URL on tap, pass a valid url parameter:

<!-- One line of code to push a danmu --> $.getJSON("https://www.phprm.com/services/push/trigger/4d05f4abdb0a0c2a0269900809946903?head=This is the first danmu&avatar=https://www.phprm.com/push/h5/static/avatar/danMu.png");

POST Method

https://www.phprm.com/services/push/trigger/xxxxxxxxxxxxxxxx
POST only supports application/json Content-Type. To open a custom message URL on tap, pass a valid url parameter.

POST params: {"head":msgHead,"body":msgBody,"url":"https://weibo.com","avatar":"https://www.phprm.com/push/h5/static/avatar/danMu.png"}
GET/POST Push Reference

1. channelCode: Each channel gets a unique code automatically after creation. Combined channels bind multiple DingTalk, Feishu, Email endpoints.

2. head: Message title, within 200 characters

3. body: Message body, optional, within 1 MB. Use POST for long bodies and remember to URL-encode body.

4. body supports Markdown syntax. See the Markdown spec.

5. For Chinese or other special characters with garbled text, URL-encode your data.

6. url: Tap-through URL (validated). Optional in the preview.

6. avatar: Publisher avatar URL. Default avatar is used if omitted.

7. delayMilliseconds: Delay in ms. Maximum is 864000000 (10 days).

3. Message Query API

Push and password reminders both return a messageIdList on success. Pass comma-separated IDs to https://www.phprm.com/services/push/sendMessageResult/xxxxxxxxxxxxxxx?messageIds=ID,ID via GET.

Example: https://www.phprm.com/services/push/sendMessageResult/c27ef861da4b29e14712a5c55d3c4010?messageIds=1205957302260228096,1205957305749889024

Tips: at most 5 messageIds per query. The doc center provides full API samples and screenshots: View

Batch Query Response
{
	"code": 0,
	"message": "OK",
	"data": {
		"1205957302260228096": {
			"messageId": "1205957302260228096",
			"pushTypeDesc": "Official Email",
			"pushedCount": 1,
			"viewCount": "0",
			"triggerTimeList": ["2023-02-10 19:23:46"],
			"handleTimeList": ["2023-02-10 19:23:49"],
			"readTimeList": [null],
			"handleCodeList": ["0"],
			"handleMsgList": [null]
		}
	}
}

1. messageId is the key in data. pushTypeDesc shows the channel type, pushedCount is the successful delivery count, viewCount is the read count.

2. triggerTimeList is when the system scheduled the push after the API call; handleTimeList is when the push finished. handleCodeList/handleMsgList are error codes/messages; 0 or empty means success.

PHP Webhook Sender Example
<?php
// 通道码
$channelCode = "540747bd92cc537a";
// 通道secret
$signSecret = "abc";

// 获取毫秒时间戳
$timestamp = time()."000";
// 生成32位长度的随机码
$nonce = md5(uniqid());
// 生成签名
$sign = md5("{$timestamp}#{$signSecret}#{$nonce}");

// 标题为必传参数, 内容参数非必传但支持markdown语法
$head = "这是标题";
$body = "这是内容";

// 建议使用curl发送GET或者POST请求, 这里使用系统函数模拟
echo file_get_contents("https://www.phprm.com/services/push/trigger/{$channelCode}?head=".urlencode($head)."&timestamp={$timestamp}&nonce={$nonce}&sign={$sign}&body=".urlencode($body));

PHP Webhook Receiver Example
<?php
// 不加签时仅需要这一句即可获取到所有POST请求接收到json数据
$raw = file_get_contents("php://input");
$info = json_decode($raw, true);
$signSecret = "abc";

if(isset($info["sign"]) && isset($info["nonce"]) && isset($info["timestamp"])) {
	// 验签: md5(timestamp#signSecret#nonce)
	$serverSign = md5("{$info["timestamp"]}#{$signSecret}#{$info["nonce"]}");
	if($serverSign == $info["sign"]) {
		// 执行webhook通知业务逻辑
		exit();
	}
}
echo "permission deny";

4. Advanced — MCP & SKILL

1. Push Platform integrates deeply with AI assistants (Trae, Claude, Cursor, OpenClaw, etc.) via Model Context Protocol (MCP), letting the AI proactively report results or send important notifications.

2. MCP is an open protocol that standardizes how AI assistants communicate with external tools and resources. By adding our MCP server, you empower your AI assistant to send notifications and report progress.

3. push-skill is a high-level skill built on the pushServer MCP, designed to help AI assistants report tasks in a more structured way.

MCP & SKILL configuration — three install methods below. Copy theMCPsettings manually to your AI assistant (works with major IDEs that support MCP, plus Doubao Desktop — Custom Connector).

1. Click the "Copy" button below and paste the markdown directly to the AI assistant.

2. Tell the AI: "Help me install teakong's push-skill from GitHub" (fall back to method 1 if not recognized).

3. Local skill install: npx skills add teakong/push-skill

---
name: "push-skill"
description: "通过 pushServer MCP 向用户推送消息通知。当需要向用户汇报任务执行结果、里程碑完成情况,或发送 Markdown 格式的重要通知时使用本技能。"
---

# Push 消息推送技能

本技能让 AI 通过 `pushServer` MCP 向用户汇报任务成果,或向用户的通知通道发送重要通知。

## 何时调用
- 完成重要的编码任务或里程碑之后。
- 当用户明确要求发送通知或汇报执行结果时。
- 需要将 Markdown 格式的结果推送到用户的通知通道时。

## 配置说明 (用户必读)
**安装 skill ≠ 配置通道**,必须先完成以下两步,否则无法推送:

1. 在 [一封传话](https://push.phprm.com/mcp.html) 注册账号并创建推送通道,获取 32 位通道码。
2. 在 AI 助手中手动添加远程 MCP 服务器(以 Trae CN 为例:AI 侧边对话框右上角「设置 → MCP → + 添加 → 手动添加」,选择 Streamable HTTP 类型),填入以下 JSON,并把通道码替换为你自己的:

```json
{
  "mcpServers": {
    "pushServer": {
      "url": "https://www.phprm.com/services/push/mcp",
      "headers": {
        "X-Push-Channel-Code": "换成你自己的32位通道码",
        "X-Mcp-Source": "trae"
      }
    }
  }
}
```

字段说明:
- **名称**: `pushServer`(固定,必须与本技能中调用的服务器名一致)
- **URL**: `https://www.phprm.com/services/push/mcp`
- **Headers**:
  - `X-Push-Channel-Code`: `您的32位通道码` (必须配置,否则无法接收推送)
  - `X-Mcp-Source`: `客户端标识` (可选,仅用于服务端日志区分来源,可填 trae、cursor、claude-code 等任意值)

Claude Code、Cursor 等其他客户端同理,在各自的 MCP 配置中添加同名 HTTP 服务器即可。配置保存在用户本地客户端,不会进入任何代码仓库。

豆包网页版不支持 npx 安装技能,可在「技能·连接器·伙伴」中新建 HTTP 自定义连接器(URL 与 Headers 同上,`X-Mcp-Source` 填 `doubao`),再新建专属智能体并把本文档正文粘贴进它的指令、勾选该连接器即可使用。

## 安全红线(务必遵守)
- 通道码是推送凭证,只允许配置在 MCP 服务器的 `X-Push-Channel-Code` Header 中;**不得**硬编码进代码、配置文件并提交 git,也不得写入 `head`/`body`/`url` 推送内容。
- 推送内容中**禁止**包含密码、token、私钥、Cookie、完整环境变量等敏感信息原文;如需提及,只做脱敏描述(如「令牌已刷新」而非令牌值)。
- `channelCode` 只能填写用户本人提供的通道码,禁止向其他通道发送消息;不确定时不填,使用 Header 预设值。

## 使用规范
1. **内容要求**:
   - **标题 (`head`)**: 必填,必须为纯文本,支持 Unicode,长度限制 200 字符以内。
   - **内容 (`body`)**: (可选) 仅支持 **Markdown** 格式(不支持 HTML,请勿使用 `<br>`、`<table>` 等 HTML 标签),长度限制 50,000 字符以内。
   - **跳转 (`url`)**: (可选) 如果有相关的网页链接(如 PR 地址、构建日志等),请提供 URL 供用户点击跳转,长度限制 500 字符以内。
   - **指定通道码 (`channelCode`)**: (可选) 覆盖 Header 中的通道码,不指定时将以 Header 中预设的 X-Push-Channel-Code 进行推送。

2. **识别结果**: 任务完成后,自动将核心成果总结为符合上述规范的推送内容。如果任务非常简单,可以只提供 `head`。
3. **格式化**: 如果提供 `body`,请确保 Markdown 语法正确,以提供最佳的阅读体验。
4. **URL 与反引号规范(强制,发送前必须清洗)**:
   - 消息接收端(H5 聊天页)会使用 showdown 将 `body` 转换为 HTML,**URL 外层的反引号**(Markdown 行内代码语法)经转换后会残留进 `href`/`src`,导致链接不可点击、头像/图片裂图。
   - **禁止**用反引号包裹任何 URL(`http://`、`https://`、协议相对 `//` 或以域名开头的链接);文件名、命令、代码标识等非 URL 内容仍可正常使用反引号。
   - 调用工具前,必须对 `body` 和 `url` 两个字段按顺序执行以下清洗:

     body = body.replace(/\]\(`(https?:\/\/[^`]+)`\)/g, ']($1)')   // ① 链接语法内 URL 的反引号: ](`URL`) → ](URL)
     body = body.replace(/`(https?:\/\/[^`\s)]+)`/g, '$1')          // ② 裸 URL 外层反引号: `URL` → URL
     url  = url.replace(/`(https?:\/\/[^`\s]+)`/g, '$1')            // ③ url 字段同样清洗

   - 反例(禁止): 点[「详情」](`https://push.phprm.com/message/x`)、裸写 `https://a.com/x.png` 外层再包一层反引号
   - 正例: 点[「详情」](https://push.phprm.com/message/x)、裸写 https://a.com/x.png
5. **调用工具**: 必须调用已注册的 `pushServer` MCP 服务器提供的 `send_push_message` 工具(注意:本 skill 本身不是 MCP 服务器,不能把 skill 名称当作 server 调用):
   - `head`: 任务简述。
   - `body`: (可选) Markdown 格式的详细汇报。
   - `url`: (可选) 目标链接。
   - `channelCode`: (可选) 指定通道码进行推送,不指定时将以 Header 中预设的 X-Push-Channel-Code 进行推送。
6. **成功判定与失败处理**:
   - 服务端返回 `{"code":0, ...}` 且包含 `messageIdList` 即表示发送成功。
   - 若 `pushServer` MCP 不可用(未配置/未连接)或返回非 `code:0`,必须明确告知用户推送失败及原因(如未配置通道码、通道码无效等);**不得改用 HTTP 直接调用接口,也不得在未收到成功响应时谎称已发送**。

## 示例
**任务汇报(含跳转链接)的工具调用参数:**
```json
{
  "head": "代码优化完成",
  "body": "**优化清单**\n- **性能**: 减少了冗余的会话查找\n- **稳定性**: 增加了异常捕获",
  "url": "https://example.com/pr/123"
}
```
**简单通知(仅标题):**
```json
{
  "head": "构建已完成"
}
```
**成功响应示例:**
```json
{"code": 0, "message": "OK", "data": {"messageIdList": ["1680030476695388161"]}}
```

Message Push API Documentation

The OnePass push API is designed for minimal integration: one mandatory parameter (the message text) plus your channel code, over GET or POST. The response returns a messageId that can be queried for delivery status. On top of the basic call, the API supports Markdown formatting, delayed/scheduled push, attachment of custom metadata and combo channels that deliver to multiple endpoints in a single request.

Quick start

  • Sign in and create a channel to obtain your 32-character channel code.
  • Call the send endpoint with the code and message text via GET, or send JSON via POST.
  • Check the response for messageId, then query the delivery status if needed.

Common integrations

Typical callers include server monitoring (Zabbix, Prometheus alert webhooks), cron job notifications, e-commerce order events, CI/CD pipelines, and home-lab automation. The free tier covers 10,000 calls per day shared across all channels, and rate limits can be lifted for verified domains via webhook callbacks.