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.0.tar.gz (4.0 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.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for notification_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b72694c4d7e0062e2529d535caafc68bf03ce0ddacac4a24375e5b0a14cebeea
MD5 aa02c0ddbb46dfb65ce4453c686e0483
BLAKE2b-256 5414d021e3ef1346627a0d85fc8a9b97ffc9df22199d2a6f3fa1f1ef43988029

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for notification_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 920d8e182c41a685f62cffcda1c2fe65a5e31db0bed199b63e00f2da4033e870
MD5 371ef15f1b111b83fd9b732ced6d32d2
BLAKE2b-256 6bb7c74dc2844ab6eb9f405669318178a359368ef2ce193e88ac9ef3876b583f

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