Skip to main content

一个基于 FastMCP 的消息推送工具,支持 PushDeer、Bark 等多种推送渠道

Project description

消息推送服务 (MCP)

这是一个使用 FastMCP 框架构建的消息推送服务集合。它允许您通过简单的 API 调用将消息发送到 PushDeer 和 Bark 服务。

功能

  • PushDeer 推送 (pushdeer.py):
    • 发送文本消息 (send_message)
    • 发送 Markdown 格式消息 (send_markdown)
    • 发送图片消息 (send_image)
  • Bark 推送 (barkme.py):
    • 发送带有标题和内容的消息 (send_message)

依赖

  • Python 3.x
  • httpx
  • fastmcp (请确保已安装)

具体依赖请参考 pyproject.toml

安装与配置

  1. 克隆仓库 (如果尚未完成):

    git clone <your-repo-url>
    cd mcp/fmt
    
  2. 安装依赖: 建议使用虚拟环境。

    # 使用 uv (推荐)
    uv venv
    source .venv/bin/activate
    uv pip install -r requirements.txt # 如果有 requirements.txt
    # 或者根据 pyproject.toml 安装
    uv pip install .
    
    # 或者使用 pip
    # python -m venv .venv
    # source .venv/bin/activate
    # pip install httpx fastmcp # 根据 pyproject.toml 调整
    
  3. 配置环境变量:

    在运行脚本前,请设置以下环境变量:

    • PushDeer (pushdeer.py):
      • PUSHDEER_KEYS: 必需。您的 PushDeer 推送密钥,多个密钥用英文逗号 , 分隔。
      • PUSHDEER_SERVER: 可选。您的自建 PushDeer 服务器地址,默认为 https://api2.pushdeer.com
    • Bark (barkme.py):
      • BARK_DEVICE_KEYS: 必需。您的 Bark 设备密钥,多个密钥用英文逗号 , 分隔。
      • BARK_SERVER: 可选。您的自建 Bark 服务器地址,默认为 https://api.day.app

    您可以将这些变量设置在 .env 文件中 (如果您的环境支持),或者直接在运行环境中导出。

运行服务

您可以使用 FastMCP 提供的命令行工具来运行这些服务,或者直接运行 Python 脚本:

# 运行 PushDeer 服务
# 方法一: 使用 FastMCP CLI
fastmcp run pushdeer.py
# 方法二: 直接运行脚本
python pushdeer.py

# 运行 Bark 服务
# 方法一: 使用 FastMCP CLI
fastmcp run barkme.py
# 方法二: 直接运行脚本
python barkme.py

贡献

欢迎提交 Pull Request 或提出 Issue。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notification_mcp-0.1.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notification_mcp-0.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file notification_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: notification_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.4

File hashes

Hashes for notification_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 747f1aab28290c999dd6713b5ffd164889904be12a51eaf90eccb1c62ab20e53
MD5 fd3137e2e2b8a798a0a8c198e7aa8c37
BLAKE2b-256 d1412681e2ed0a03a393ad53b73b96425baffc4341ea4861988ef0470898c67f

See more details on using hashes here.

File details

Details for the file notification_mcp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for notification_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9c950f614ff62b8b0e8a52649b5f77a5f760851a0545821bcb96190eec4f725
MD5 f085b825827dff1d55d7fa39ff14ae55
BLAKE2b-256 728fce2e2474e7c7ca0b0d6a0ae057fcb4bcfff7c6bf4987e722e2ed81fb8dd9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page