mcpField
N
notifyfan

notifyfan

本地服务
github.com/CloudCorpRecords通信协作01 周前更新

关于 notifyfan

notifyfan 是通过 Apprise API 服务器发送通知的 MCP 服务与命令行工具。它支持按已配置标签发送、发送至所有服务、使用 Apprise URL 单次发送,以及检查上游健康状态和运行状态。

主要功能

  1. 01发送到指定标签或所有服务
  2. 02向 Apprise URL 单次发送
  3. 03检查服务器健康状态和运行状态
  4. 04校验操作与通知类型
  5. 05命令行与 stdio 服务模式

适用场景

  1. 01向运维标签发送部署更新
  2. 02不指定标签时通知已配置服务
  3. 03向 Apprise URL 发送单次消息
  4. 04检查 Apprise API 是否可用

MCP 相关

它通过 MCP 工具 `apprise` 提供健康检查、状态、帮助和 Apprise API 服务器通知操作。stdio 服务从环境变量读取 URL 和可选的 bearer 令牌。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"cloudcorprecords-notifyfan": {
"command": "npx",
"args": [
"-y",
"@reneturcios/notifyfan"
]
}
}
}
启动命令npx -y @reneturcios/notifyfan

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@reneturcios/notifyfan0.1.0
ocighcr.io/cloudcorprecords/notifyfan:0.1.0

工具

1

收录的工具列表 · 更新于 1 周前

参数类型必填说明
tagstring否用于选择哪些已配置服务接收通知的标签筛选器。
bodystring否notify 操作的通知正文文本。
typeenum否通知类型:info、success、warning 或 failure。info | success | warning | failure
urlsstring否notify_url 操作的目标 Apprise URL(一个或多个)。
titlestring否notify 操作的通知标题。
actionenum是要运行的操作:health、status、help、notify 或 notify_url。health | status | help | notify | notify_url

详细介绍

notifyfan

notifyfan 通过 Apprise API 服务发送通知。单个工具 apprise 可将消息分发到 Apprise 配置的目标:发送到一个已配置的标签(或所有已配置的服务),直接向原始 Apprise URL schema 发送一次性通知,并检查上游服务是否正常运行——只需使用一个操作参数,无需每种操作都配备一个工具。一个二进制文件同时提供命令行界面和 stdio MCP 服务。

配置

两个环境变量用于配置上游连接:

  • APPRISE_URL — Apprise API 服务的基础 URL。默认为 http://localhost:8000。
  • APPRISE_TOKEN — 可选。当上游要求 bearer 身份验证时,设置此变量后,notifyfan 会在每次上游调用中发送 Authorization: Bearer <token>。它只从环境变量读取:不会作为 CLI 标志或 MCP 工具参数。

即使完全未配置任何内容,也可以使用 help 操作。

安装

npx @reneturcios/notifyfan health

也可以运行容器镜像:

docker run -i ghcr.io/cloudcorprecords/notifyfan

容器默认启动 MCP 服务。传入 CLI 参数即可将其用作 CLI。

CLI

notifyfan health
notifyfan status
notifyfan help
notifyfan notify "Deployment succeeded" --tag ops --title "Deploy complete" --type success
notifyfan notify "Standup notes are posted"
notifyfan notify-url "mailto://[email protected]" "Build finished" --type info

notifyfan --version

notify 只需要正文;省略 --tag 即可发送到所有已配置的服务。notify-url 先接收 Apprise URL(一个字符串;多个 URL 用逗号分隔),再接收正文。退出代码:成功时为 0,调用失败(验证错误或上游错误)时为 1,用法错误时为 2。

MCP 服务

npx -y @reneturcios/notifyfan mcp

MCP 客户端配置:

{
  "mcpServers": {
    "notifyfan": {
      "command": "npx",
      "args": ["-y", "@reneturcios/notifyfan", "mcp"],
      "env": {
        "APPRISE_URL": "http://localhost:8000"
      }
    }
  }
}

只有当你的 Apprise API 服务需要 APPRISE_TOKEN 时,才将其添加到 env 块中。

工具
工具输入功能
appriseaction(必填字符串)及以下各操作的参数对上游 Apprise API 服务执行指定操作。

操作:

操作必填可选功能
health——检查 Apprise API 服务的运行状况。
status——返回经过身份验证的部署和运行时状态。
help——返回内置的 Markdown 工具帮助。不调用上游。
notifybodytag、title、type发送到已配置的 Apprise 标签;省略 tag 时,发送到所有已配置的服务。
notify_urlurls、bodytitle、type向一个或多个 Apprise URL schema 发送无状态的一次性通知。urls 是单个字符串;多个 URL 用逗号分隔。

type 可选 info(信息)、success(操作成功)、warning(非严重警告)或 failure(严重故障或错误)。未知操作、缺少 body/urls 以及无效的 type 都会在调用上游之前报错。

调用示例:

{
  "name": "apprise",
  "arguments": {
    "action": "notify",
    "body": "Deployment succeeded",
    "tag": "ops",
    "title": "Deploy complete",
    "type": "success"
  }
}
上游映射和已知缺漏

上述操作目录是文档所述的功能范围。上游路径是根据标准 Apprise API 文档还原的:notify 将 {body, tag?, title?, type?} 发送到 POST /notify,notify_url 将 {urls, body, title?, type?} 发送到同一端点——这是无状态形式;上游 API 没有单独的 /notify_url 路由。health 读取 GET /(上游根路径),status 读取 GET /details。未提供的载荷字段会被省略,不会以空值发送。上游调用失败时,会返回 HTTP 状态码,以及上游提供的 message 或 error 字符串(如果存在);非 JSON 格式的成功响应正文会作为原始文本返回。

  • 未复现原项目的 HTTP 传输、OAuth 和 send_alert 提示词;此重建版本仅支持 stdio。
  • 构建期间未使用真实的 Apprise API 服务:所有上游行为均通过测试套件中的模拟 fetch 进行验证。

开发

npm install
npm run build   # tsc -> dist/
npm test        # node test runner over test/*.test.ts, no network (fake fetch fixtures)
npm run dev     # run the CLI from source via tsx

许可证

MIT — 参见 LICENSE。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。