PushPlus推送消息
pushplus_send_msgSend notifications to WeChat, email, or webhook via PushPlus. Supports HTML, plain text, or Markdown content with optional title and token.
Instructions
通过PushPlus(推送加)推送消息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | 消息内容 | |
| title | No | 消息标题 | |
| token | No | 用户token,默认从环境变量获取 | |
| template | No | 消息内容格式: `html`(默认)/`txt`/`markdown` | |
| channel | No | 发送渠道: `wechat`(默认)/`webhook`/`mail` |
Implementation Reference
- mcp_notify/other.py:191-213 (handler)The pushplus_send_msg tool handler function. It sends a message via PushPlus using the provided content, title, token, template, and channel parameters. Falls back to PUSH_PLUS_TOKEN env var if token is not provided, and PUSH_PLUS_BASE_URL env var for the base URL.
def pushplus_send_msg( content: str = Field(description="消息内容"), title: str = Field("", description="消息标题"), token: str = Field("", description="用户token,默认从环境变量获取"), template: str = Field("", description="消息内容格式: `html`(默认)/`txt`/`markdown`"), channel: str = Field("", description="发送渠道: `wechat`(默认)/`webhook`/`mail`"), ): """ https://www.pushplus.plus/doc/guide/api.html """ if not token: token = os.getenv("PUSH_PLUS_TOKEN", "") base = os.getenv("PUSH_PLUS_BASE_URL") or "http://www.pushplus.plus" res = requests.post( f"{base}/{token}", json={ "content": content, "title": title, "template": template, "channel": channel, }, ) return res.json() - mcp_notify/other.py:187-190 (registration)The @mcp.tool decorator registering pushplus_send_msg as a tool with title 'PushPlus推送消息' and description '通过PushPlus(推送加)推送消息'.
@mcp.tool( title="PushPlus推送消息", description="通过PushPlus(推送加)推送消息", ) - mcp_notify/other.py:191-196 (schema)The function signature with Pydantic Field definitions for content (required), title, token, template, and channel parameters.
def pushplus_send_msg( content: str = Field(description="消息内容"), title: str = Field("", description="消息标题"), token: str = Field("", description="用户token,默认从环境变量获取"), template: str = Field("", description="消息内容格式: `html`(默认)/`txt`/`markdown`"), channel: str = Field("", description="发送渠道: `wechat`(默认)/`webhook`/`mail`"), - mcp_notify/__init__.py:21-23 (helper)Registration of the other.add_tools(mcp) module, which includes the pushplus_send_msg tool.
other.add_tools(mcp) hass.add_tools(mcp) util.add_tools(mcp)