折叠式mcp-rs
高性能 模型上下文协议(MCP) 用于通过发送推送通知的服务器 推倒API内置Rust,速度快,可靠性高。
概述
此服务器使LLM能够通过Pushover服务向您的设备发送推送通知。非常适合在长时间运行的任务完成时收到通知,接收警报,或任何需要人工智能助手引起您注意的场景。
特性
- 简单通知 -仅使用单个参数发送消息
- 丰富的格式 -HTML或单空间文本格式
- 优先级 -命名级别:静音、低、正常、高、紧急
- 应急管理 -检查收货状态并取消紧急通知
- 设备定位 -需要时发送到特定设备
- 补充网址 -将链接附加到通知
- 自定义声音 -从Pushover的声音库中选择
- 自动配置 -首次运行时自动创建的配置文件
- 快速启动 -亚秒级初始化
快速开始
1.建造
cargo build --release2.配置
第一次运行时,会自动创建一个配置文件。编辑它以添加您的Pushover凭据:
- Linux:
~/.config/pushover-mcp-rs/config.json - macOS:
~/Library/Application Support/pushover-mcp-rs/config.json - 视窗:
C:\Users\{user}\AppData\Roaming\pushover-mcp-rs\config.json
{
"token": "your-pushover-api-token",
"default_user_key": "your-user-key",
"default_device": null
}从获取API令牌和用户密钥 pushover.net.
3.跑步
./target/release/pushover-mcp-rs服务器通过JSON-RPC 2.0在stdin/stdout上进行通信。
MCP工具
服务器提供4个工具:
通知
| 工具 | 说明 |
|---|---|
send_notification | 发送推送通知(仅限 message 是必需的) |
list_devices | 列出针对特定设备的可用设备名称 |
应急管理
| 工具 | 说明 |
|---|---|
check_emergency_receipt | 检查紧急通知是否得到确认 |
cancel_emergency_notification | 取消仍在重试的紧急通知 |
通知参数
这 send_notification 该工具支持以下参数:
| 参数 | 必填 | 说明 |
|---|---|---|
message | 是 | 通知消息(最多1024个字符) |
title | 否 | 消息标题(最多250个字符,默认为应用程序名称) |
priority | 否 | 以下之一: silent, low, normal (默认), high, emergency |
sound | 否 | 以下之一: pushover, bike, bugle, cashregister, classical, cosmic, falling, gamelan, incoming, intermission, magic, mechanical, pianobar, siren, spacealarm, tugboat, alien, climb, persistent, echo, updown, vibrate, none |
url | 否 | 要包含的补充URL(最大512字节) |
url_title | 否 | URL的标题,需要 url (最多100个字符) |
html | 否 | 启用HTML格式(b、i、u、a、字体标记)。不能与一起使用 monospace |
monospace | 否 | 以等宽字体显示消息。不能与一起使用 html |
device | 否 | 目标特定设备(仅在明确要求时使用) |
ttl | 否 | 从设备中自动删除之前的时间(秒)。与…无关 expire. |
timestamp | 没有 | Unix时间戳显示为发送时间。适用于延迟通知。 |
retry | 否 | 仅紧急情况:重试间隔(秒)(分钟30,默认60) |
expire | 否 | 仅限紧急情况:以秒为单位继续重试的时间(最大10800,默认3600)。与…无关 ttl. |
优先级
| 价值观 | 行为 |
|---|---|
silent | 未生成警报。消息仅在用户打开应用程序时可见。 |
low | 安静的通知。没有声音,但可能会显示在屏幕上。 |
normal | 带有声音和振动的默认通知(如果未指定,则默认)。 |
high | 重要提示:即使在安静的时间,也要始终播放声音和振动。 |
emergency | 关键:每60秒重复一次,持续1小时,直到被确认。返回收据ID |
MCP客户端集成
克劳德代码
使用CLI添加到您的Claude代码配置中:
claude mcp add pushover -s user -- /path/to/pushover-mcp-rs或直接添加到 ~/.claude.json:
{
"mcpServers": {
"pushover": {
"type": "stdio",
"command": "/path/to/pushover-mcp-rs"
}
}
}通过以下方式进行验证:
claude mcp list然后使用 /mcp 在Claude Code内部检查连接状态。
Goose命令行界面
添加到 ~/.config/goose/config.yaml:
extensions:
pushover:
bundled: false
display_name: "Pushover"
enabled: true
name: "pushover"
timeout: 300
type: "stdio"
cmd: "/path/to/pushover-mcp-rs"
args: []或者以交互方式添加:
goose configure选择“添加扩展名”->“命令行扩展名”,然后输入二进制文件的路径。
通过以下方式进行验证:
goose info -v克劳德桌面版
添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
"mcpServers": {
"pushover": {
"command": "/path/to/pushover-mcp-rs"
}
}
}通用MCP客户端
服务器通过stdin/stdout使用JSON-RPC 2.0:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | ./pushover-mcp-rs使用示例
简单通知
{
"name": "send_notification",
"arguments": {
"message": "Build completed successfully!"
}
}标题优先级高
{
"name": "send_notification",
"arguments": {
"message": "Deployment to production finished",
"title": "CI/CD Pipeline",
"priority": "high"
}
}紧急通知
{
"name": "send_notification",
"arguments": {
"message": "Server is down! Immediate attention required.",
"title": "Critical Alert",
"priority": "emergency",
"retry": 60,
"expire": 3600
}
}返回一个 receipt 用于跟踪确认的ID。
检查紧急状态
{
"name": "check_emergency_receipt",
"arguments": {
"receipt": "receipt-id-from-send"
}
}取消紧急
{
"name": "cancel_emergency_notification",
"arguments": {
"receipt": "receipt-id-from-send"
}
}带URL
{
"name": "send_notification",
"arguments": {
"message": "New PR ready for review",
"url": "https://github.com/org/repo/pull/123",
"url_title": "View Pull Request"
}
}HTML格式
{
"name": "send_notification",
"arguments": {
"message": "Task Complete
Processed 1,234 records",
"html": true
}
}单体空间(代码)
{
"name": "send_notification",
"arguments": {
"message": "Error: connection refused\n at main.rs:42",
"monospace": true
}
}自定义声音
{
"name": "send_notification",
"arguments": {
"message": "Timer finished!",
"sound": "siren"
}
}列出设备
{
"name": "list_devices",
"arguments": {}
}发送到特定设备
{
"name": "send_notification",
"arguments": {
"message": "Sent to your phone only",
"device": "iphone"
}
}发展
先决条件
- Rust 1.85或更高版本(2024年版)
构建
cargo build --release棉绒
cargo clippy --release -- -W clippy::all -W clippy::pedantic调试日志记录
RUST_LOG=pushover_mcp_rs=debug ./target/release/pushover-mcp-rs版本管理
检查版本:
./pushover-mcp-rs --version发布新版本:
./set-version.sh 1.2.3
git push origin main --follow-tags项目结构
src/
├── main.rs # Entry point, CLI, MCP server initialization
├── server.rs # MCP server and tool implementations
├── model.rs # Data structures for parameters and responses
└── config.rs # Configuration file management故障排除
“未配置Pushover API令牌”
- 编辑配置文件并添加您的API令牌
- 从获取您的令牌 pushover.net/apps
“未提供user_key”
- 添加
default_user_key到您的配置文件 - 从以下位置获取用户密钥 pushover.net
“消息不能为空”
- 这
message参数是必需的,不能为空
“不能同时使用html和等宽格式”
- 选择一个格式选项:
html: true或monospace: true
Claude代码中的连接问题
- 跑
/mcp检查服务器状态 - 验证二进制路径是否正确
- 检查日志:
RUST_LOG=pushover_mcp_rs=debug用于详细输出
Goose中的连接问题
- 跑
goose info -v验证配置 - 如果服务器启动缓慢,则增加超时时间
许可证
MIT许可证。看 许可证 了解详情。
作者
克里斯蒂安·沃勒特
相关项目
- appbase云日志mcp-rs -用于分析Kubernetes日志文件的MCP服务器
- ro mongodb mcp rs -只读MongoDB MCP服务器
