Pushover MCP服务器
一种MCP(模型上下文协议)服务器,允许从Cursor、Claude Code和其他MCP兼容工具发送Pushover通知。
警告
此存储库是一个个人项目,没有经过很好的测试,也不受支持。代码在我使用的范围内进行了测试。欢迎其他人自担风险进行分叉和使用。
特性
- pushover_send -发送完全自定义的推送通知(优先级、声音、URL、HTML、TTL)
- pushover_send_urgent -发送带有响亮声音的高优先级通知
- pushover_验证 -验证凭据并列出设备
- 推覆限制 -检查API消息限制
- pushover_健康 -服务器的运行状况检查
先决条件
- 在以下网址创建Pushover帐户https://pushover.net
- 在以下网址注册申请https://pushover.net/apps得到你的 应用令牌
- 得到你的 用户密钥 从您的Pushover仪表板
- 安装 紫外线 用于Python包管理
在Cursor中安装
添加到您的全局Cursor MCP配置 ~/.cursor/mcp.json:
{
"mcpServers": {
"Pushover": {
"command": "/bin/sh",
"args": ["-c", "cd \"$HOME/code/pushover-mcp-server\" && uv run pushover-mcp"],
"env": {
"PUSHOVER_TOKEN": "your-app-token-here",
"PUSHOVER_USER_KEY": "your-user-key-here"
}
}
}
}此配置通过使用shell扩展在Linux和macOS上都有效 $HOME.
用Claude代码安装
Claude Code在项目和用户级别都支持MCP服务器。
项目级别(建议用于团队项目)
添加到 .mcp.json 在项目根目录中:
{
"mcpServers": {
"Pushover": {
"command": "uvx",
"args": [
"--from", "git+ssh://git@github.com/mlgill/pushover-mcp-server.git",
"pushover-mcp"
],
"env": {
"PUSHOVER_TOKEN": "your-app-token-here",
"PUSHOVER_USER_KEY": "your-user-key-here"
}
}
}
}用户级别(适用于所有项目)
添加到 ~/.claude.json:
{
"mcpServers": {
"Pushover": {
"command": "uvx",
"args": [
"--from", "git+ssh://git@github.com/mlgill/pushover-mcp-server.git",
"pushover-mcp"
],
"env": {
"PUSHOVER_TOKEN": "your-app-token-here",
"PUSHOVER_USER_KEY": "your-user-key-here"
}
}
}
}单层衬里安装
或者,直接从命令行安装:
claude mcp add-json pushover '{
"command": "uvx",
"args": [
"--from",
"git+ssh://git@github.com/mlgill/pushover-mcp-server.git",
"pushover-mcp"
],
"env": {
"PUSHOVER_TOKEN": "xxx",
"PUSHOVER_USER_KEY": "xxx"
}
}'替换 xxx 使用您的Pushover证书。
添加配置后,重新启动Claude Code或运行 /mcp 重新加载MCP服务器。
与CLAUDE.md一起使用
复制 claude/CLAUDE.md 以在Claude Code等待用户批准时启用自动通知行为。这将配置:
- 2分钟怠速:发送正常优先级通知
- 8分钟怠速:升级到高优先级(防止会话超时)
在多台机器上安装
选项1:克隆仓库
- 克隆仓库 每台机器
~/code/pushover-mcp-server - 确保
uv安装在每台机器上 - 将配置添加到
~/.cursor/mcp.json(光标)或~/.claude.json(克劳德密码) - 将令牌和用户密钥值替换为您的实际Pushover凭据
- 重新启动游标或Claude代码
选项2:直接从GitHub安装(无需克隆)
从GitHub安装软件包:
# Via SSH (private repos)
uv pip install git+ssh://git@github.com/mlgill/pushover-mcp-server.git
# Via HTTPS (public repos, or with token for private)
uv pip install git+https://github.com/mlgill/pushover-mcp-server.git
# Specific branch or tag
uv pip install git+ssh://git@github.com/mlgill/pushover-mcp-server.git@main然后使用此MCP配置(在 ~/.cursor/mcp.json 或 ~/.claude.json):
{
"mcpServers": {
"Pushover": {
"command": "uvx",
"args": [
"--from", "git+ssh://git@github.com/mlgill/pushover-mcp-server.git",
"pushover-mcp"
],
"env": {
"PUSHOVER_TOKEN": "your-app-token-here",
"PUSHOVER_USER_KEY": "your-user-key-here"
}
}
}
}这需要SSH访问每台机器上的GitHub仓库。
选项3:从PyPI安装(发布后)
如果发布到PyPI,请使用最简单的配置:
{
"mcpServers": {
"Pushover": {
"command": "uvx",
"args": ["pushover-mcp"],
"env": {
"PUSHOVER_TOKEN": "your-app-token-here",
"PUSHOVER_USER_KEY": "your-user-key-here"
}
}
}
}出版
构建包
uv build发布到PyPI
- 复制
.pypirc.example到~/.pypirc并添加您的PyPI API令牌 - 发布:
uv publish发布到测试PyPI(用于测试)
uv publish --publish-url https://test.pypi.org/legacy/本地开发
# Install dependencies
uv sync
# Run the server (stdio mode for Cursor/Claude Code)
uv run pushover-mcp测试
使用pytest运行测试套件:
# Install dev dependencies
uv sync --extra dev
# Run all tests
uv run pytest
# Run with verbose output
uv run pytest -v
# Run a specific test file
uv run pytest tests/test_client.py
# Run with coverage (if pytest-cov is installed)
uv run pytest --cov=pushover_mcpWeb服务部署
服务器可以使用SSE(服务器发送事件)传输部署为web服务,允许MCP客户端通过HTTP连接。
作为Web服务运行
# Run directly with custom host/port
pushover-mcp --transport sse --host 0.0.0.0 --port 8000
# Or with uv
uv run pushover-mcp --transport sse --host 0.0.0.0 --port 8000Docker部署
使用Docker构建和运行:
# Build the image
docker build -t pushover-mcp .
# Run the container
docker run -d \
-p 8000:8000 \
-e PUSHOVER_TOKEN=your-app-token \
-e PUSHOVER_USER_KEY=your-user-key \
--name pushover-mcp \
pushover-mcpDocker Compose
为了更容易部署,请使用Docker Compose:
- 创建一个
.env使用您的凭据文件:
PUSHOVER_TOKEN=your-app-token
PUSHOVER_USER_KEY=your-user-key- 启动服务:
docker compose up -d服务器将在以下时间可用 http://localhost:8000.
连接MCP客户端
一旦作为web服务运行,MCP客户端就可以使用SSE端点进行连接:
http://your-server:8000/sse环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
PUSHOVER_TOKEN | 是 | 您的Pushover应用程序API令牌 |
PUSHOVER_USER_KEY | 是 | 您的Pushover用户或组密钥 |
或者,在以下位置创建一个配置文件 ~/.config/pushover-mcp/config.json:
{
"token": "your-app-token",
"user_key": "your-user-key"
}可用工具
pushover_send
通过Pushover发送具有完全自定义功能的推送通知。
参数:
message(必填):消息正文(最多1024个字符)title(可选):消息标题(最多250个字符)priority(可选):-2(静音)、-1(安静)、0(正常)、1(高)、2(紧急)sound(可选):通知声音(推送、自行车、警报器、宇宙声等)device(可选):目标特定设备名称url(可选):补充URLurl_title(可选):URL的标题html(可选):启用HTML格式ttl(可选):生存时间(秒)(自动删除)
pushover_send_urgent
发送带有响亮声音的高优先级通知(默认:警报器)。
参数:
message(必填):紧急消息正文title(可选):消息标题sound(可选):要使用的声音(默认:警报器)
pushover_验证
验证凭据并列出已注册的设备。无需参数。
推覆限制
检查API消息限制(每月限制、剩余时间、重置时间)。无需参数。
pushover_健康
健康检查,验证凭据并确认服务器正在工作。
许可证
麻省理工学院
