Jon的Pushover MCP服务器
MCP服务器,用于通过以下方式发送推送通知 软蛋.
需求
- Python 3.10+
- 带有API令牌和用户密钥的推送帐户
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
PUSHOVER_API_TOKEN | 是 | 来自的应用程序API令牌https://pushover.net/apps |
PUSHOVER_USER_KEY | 是 | 用户密钥来自https://pushover.net |
安装
# Clone the repository
git clone
cd jons-mcp-pushover
# Install with uv
uv pip install -e .运行服务器
uv run jons-mcp-pushoverClaude桌面配置
将此添加到您的Claude Desktop配置文件中(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
"mcpServers": {
"pushover": {
"command": "uv",
"args": ["run", "--project", "/path/to/jons-mcp-pushover", "jons-mcp-pushover"],
"env": {
"PUSHOVER_API_TOKEN": "your-api-token-here",
"PUSHOVER_USER_KEY": "your-user-key-here"
}
}
}
}添加到克劳德代码
# Register the MCP server with Claude Code
claude mcp add jons-mcp-pushover \
-e PUSHOVER_API_TOKEN=your-api-token-here \
-e PUSHOVER_USER_KEY=your-user-key-here \
-- uv run --directory /path/to/jons-mcp-pushover jons-mcp-pushover可用工具
send_notification
向您的设备发送推送通知。
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
message | string | 是 | - | 通知消息正文 |
title | string | 否 | 应用程序名称 | 通知顶部显示的标题 |
url | string | 否 | - | 要包含的URL(可在通知中点击) |
url_title | string | 否 | - | URL的标签 |
priority | integer | 否 | 0 | 优先级:-2(无声)到2(紧急) |
sound | string | 否 | 设备默认值 | 通知声音名称 |
例子:
send_notification(
message="Build completed successfully!",
title="CI Pipeline",
url="https://github.com/user/repo/actions",
url_title="View Build",
priority=1,
sound="magic"
)发展
设置
# Install with dev dependencies
uv pip install -e ".[dev]"运行测试
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=src
# Run a specific test
uv run pytest tests/test_pushover.py::test_send_notification_success代码质量
# Type check
uv run mypy src/jons_mcp_pushover
# Format code
uv run black src tests
# Lint code
uv run ruff check src tests项目结构
jons-mcp-pushover/
├── src/
│ ├── __init__.py
│ └── jons_mcp_pushover/
│ ├── __init__.py # Package exports
│ ├── constants.py # Configuration constants
│ ├── exceptions.py # Custom exceptions
│ ├── utils.py # Utility functions
│ ├── server.py # FastMCP server setup
│ └── tools/
│ ├── __init__.py # Tool exports
│ └── pushover.py # Pushover notification tool
├── tests/
│ ├── conftest.py # Test fixtures
│ └── test_pushover.py # Pushover tool tests
├── pyproject.toml # Project configuration
├── CLAUDE.md # AI assistant guidance
└── README.md # This file添加新工具
- 在中创建新文件
src/jons_mcp_pushover/tools/或添加到现有文件 - 编写一个带有类型提示和docstring的异步函数:
async def my_tool(param: str) -> str:
"""Brief description for the MCP tool listing.
Args:
param: What this parameter does.
Returns:
What the tool returns.
"""
return f"Result: {param}"- 出口自
src/jons_mcp_pushover/tools/__init__.py - 注册
server.py和mcp.tool(my_tool)
许可证
麻省理工学院
