README
🚀 Ntfy MCP 服务器
Ntfy MCP 服务器是一款基于 Model Context Protocol (MCP) 的实用工具,它能将长语言模型 (LLM) 与 Ntfy.sh 通知服务相连接。借助该服务器,LLM 可通过自然语言处理来发送通知、设置提醒以及触发警报。
🚀 快速开始
Ntfy MCP 服务器可让长语言模型轻松与 Ntfy.sh 通知服务交互。你可以按照以下步骤使用该服务器:
# 安装依赖
npm install
# 编译代码
npm run build
# 启动开发服务器
npm start
# 测试命令
npm test
✨ 主要特性
- send_ntfy 工具:LLM 可借助此工具向指定的 Ntfy 频道发送自定义通知,还支持丰富的通知格式。
- 资源模板:
ntfy://default:用于查询默认 Ntfy 主题的信息。ntfy://{topic}:可获取特定 Ntfy 主题的详细信息。
📦 安装指南
# 安装依赖
npm install
# 编译代码
npm run build
💻 使用示例
基础用法
长时间运行的任务通知
<TN>
<action>tnfy Notify</action>
<parameters>
<topic>default</topic>
<title>Long-running Task Complete</title>
<message>The background data processing task has finished successfully.</message>
<tags>info</tags>
</parameters>
</TN>
设置提醒
<TN>
<action>tnfy Schedule Reminder</action>
<parameters>
<topic>reminders</topic>
<title>Team Meeting</title>
<message>Don't forget the team meeting at 3 PM today.</message>
<tags>calendar, reminder</tags>
<priority>4</priority>
</parameters>
</TN>
📚 详细文档
工具参数
send_ntfy 工具参数
该工具支持以下参数: | 参数名称 | 详情 | 示例值 | | ---- | ---- | ---- | | topic | 通知的主题,必须是有效的 Ntfy 主题。 | "alerts", "updates" | | title | 通知的标题(可选)。 | "Task Completed" | | message | 通知的主要内容,支持 Markdown 格式(如果启用 markdown 参数)。 | "Your requested data analysis has finished" | | tags | 关联到通知的主题标签。 | ["check"], ["warning", "critical"] | | priority | 通知的优先级,范围从 1 到 5,5 表示最高优先级。 | 5 | | actions | 与通知相关联的操作列表,允许用户点击执行特定操作。 | 见下方示例 | | markdown | 是否启用 Markdown 格式解析(true 或 false)。 | true |
资源模板
ntfy://default
- 描述:返回默认 Ntfy 主题的信息。
- 响应格式:
{
"topic": "default",
"messages": number,
"created_at": timestamp,
"updated_at": timestamp
}
ntfy://{topic}
- 描述:返回指定主题的详细信息。
- 示例 URL:
ntfy://alerts - 响应格式:
{
"topic": string,
"messages": array of messages,
"created_at": timestamp,
"updated_at": timestamp
}
贡献指南
如何贡献
- 报告问题:通过 GitHub Issues 提交错误或功能请求。
- 提交修复: Fork 仓库,创建分支,提交 Pull Request。
- 开发新特性:查看未完成的功能列表并开始贡献。
开发最佳实践
- 遵循 TypeScript 最佳实践并保持强类型。
- 确保代码可读性和文档清晰度。
- 提交小而频繁的更改,并提供详细的提交信息。
- 在合并请求中包含相关测试用例。
📄 许可证
项目以 MIT License 分发,具体条款见 LICENSE 文件。
致谢
感谢以下项目的贡献者:
- 开发团队:[Your Name], [Collaborator Name]
- 社区贡献者:[Contributor 1], [Contributor 2]
Scan to contact