ntfy-me-mcp

Integrations

  • Allows configuration of the server using environment variables stored in .env files, supporting settings for notification topics, server URLs, and authentication tokens.

  • Provides containerized deployment option with official Docker images available on Docker Hub and GitHub Container Registry for running the server in a containerized environment.

  • Supports rich text formatting in notifications, with automatic detection and rendering of markdown syntax for creating formatted lists, code blocks, links, tables, and other text styling.

📤 ntfy-me-mcp

一个精简的模型上下文协议(MCP)服务器,用于通过 ntfy 服务(公共或自托管且支持令牌)发送通知📲

概述

ntfy-me-mcp 使 AI 助手能够通过ntfy服务(公共服务或支持令牌的自托管服务)向您的设备发送实时通知。当您的 AI 完成任务、遇到错误或达到重要里程碑时,您都会收到通知——所有这些都无需持续监控。

该服务器包括智能功能,例如用于创建视图操作的自动 URL 检测和智能 markdown 格式检测,使 AI 助手无需额外配置即可更轻松地创建丰富的交互式通知。

可通过以下方式获取:

姓名链接/徽章
Glama.ai
Smithery.ai

目录

特征

  • 🚀快速设置:使用 npx 或 docker 运行!
  • 🔔实时通知:任务完成时在手机/桌面上获取更新
  • 🎨丰富的通知:支持主题、标题、优先级、表情符号标签和详细消息
  • 🔍通知获取:从您的 ntfy 主题中获取并过滤缓存的消息
  • 🎯智能操作链接:自动检测消息中的 URL 并创建查看操作
  • 📄智能 Markdown :自动检测并启用 Markdown 格式(如果存在)
  • 🔒安全:使用访问令牌进行可选身份验证
  • 🔑输入屏蔽:将您的 ntfy 令牌安全地存储在您的 vs 配置中!
  • 🌐自托管支持:适用于 ntfy.sh 和自托管 ntfy 实例

(即将推出...)

  • 📨电子邮件:将通知发送到电子邮件(需要 ntfy 电子邮件服务器配置)
  • 🔗点击 URL :可自定义点击 URL
  • 🖼️图片 URL :智能图片 URL 检测,自动在消息和通知中包含图片 URL
  • 🏁还有更多!

快速入门 - MCP 服务器配置

NPM / NPX(推荐方法)

  • 需要在您的系统上安装 npm / npx。
  • 建议大多数用户使用此方法,因为它提供了一种简单、轻量级的服务器设置方法。

为了使用与 MCP 兼容的助手进行最轻松的设置,请将其添加到您的 MCP 配置中:

最小配置(针对ntfy.sh上的公共主题)
{ "ntfy-me-mcp": { "command": "npx", "args": ["ntfy-me-mcp"], "env": { "NTFY_TOPIC": "your-topic-name" } } }
完整配置(用于私人服务器或受保护主题)
选项 1:在配置中直接使用令牌
{ "ntfy-me-mcp": { "command": "npx", "args": ["ntfy-me-mcp"], "env": { "NTFY_TOPIC": "your-topic-name", "NTFY_URL": "https://your-ntfy-server.com", "NTFY_TOKEN": "your-auth-token" // Use if using a protected topic/server } } }
选项 2:使用 VS Code 输入进行安全令牌处理(推荐)

将其添加到您的 VS Code settings.json 文件中:

"mcp": { "inputs": [ { // Add this to your inputs array "type": "promptString", "id": "ntfy_token", "description": "Ntfy Token", "password": true } ], "servers": { // Other servers... "ntfy-me-mcp": { "command": "npx", "args": ["ntfy-me-mcp"], "env": { "NTFY_TOPIC": "your-topic-name", "NTFY_URL": "https://your-ntfy-server.com", "NTFY_TOKEN": "${input:ntfy_token}", // Use the input id variable for the token "PROTECTED_TOPIC": "true" // Prompts for token and masks it in your config } } } }

通过此设置,VS Code 将在启动服务器时提示您输入令牌,并且在输入时令牌将被屏蔽。

Docker

在 Docker 中使用 MCP

  • 需要在您的系统上安装 Docker。
  • 此方法对于在容器环境中运行服务器很有用。
  • 您可以使用 Docker Hub 或 GitHub Container Registry 上提供的官方 Docker 镜像。

Docker 镜像:

  • gitmotion/ntfy-me-mcp:latest (Docker Hub)
  • ghcr.io/gitmotion/ntfy-me-mcp:latest容器注册表)

在您的 MCP 配置中(例如 VS Code settings.json):

"mcp": { "servers": { "ntfy-mcp": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "NTFY_TOPIC", "-e", "NTFY_URL", "-e", "NTFY_TOKEN", "-e", "PROTECTED_TOPIC", "gitmotion/ntfy-me-mcp", // OR use ghcr.io/gitmotion/ntfy-me-mcp:latest ], "env": { "NTFY_TOPIC": "your-topic-name", "NTFY_URL": "https://your-ntfy-server.com", "NTFY_TOKEN": "${input:ntfy_token}", "PROTECTED_TOPIC": "true" } } } }

安装

如果您需要直接安装并运行服务器(替代上面的 MCP 配置):

选项 1:全局安装

npm install -g ntfy-me-mcp

选项 2:使用 npx 运行

npx ntfy-me-mcp

选项 3:本地安装

# Clone the repository git clone https://github.com/gitmotion/ntfy-me-mcp.git cd ntfy-me-mcp # Install dependencies npm install # Copy the example environment file and configure it cp .env.example .env # Edit .env with your preferred editor and update the variables # nano .env # or use your preferred editor # Build the project npm run build # Start the server npm start

选项 4:使用 node 命令在本地构建并使用

如果您正在开发或定制服务器,您可能希望直接使用节点运行它:

# Clone the repository git clone https://github.com/gitmotion/ntfy-me-mcp.git cd ntfy-me-mcp # Install dependencies npm install # Copy the example environment file and configure it cp .env.example .env # Edit the .env file to set your NTFY_TOPIC and other optional settings # nano .env # or use your preferred editor # Build the project npm run build # Run using node directly npm start
使用本地构建的服务器和 MCP

当配置您的 MCP 使用本地构建版本时,请指定节点命令和构建的 index.js 文件的路径:

{ "ntfy-me": { "command": "node", "args": ["/path/to/ntfy-mcp/build/index.js"], "env": { "NTFY_TOPIC": "your-topic-name", //"NTFY_URL": "https://your-ntfy-server.com", // Use if using a self-hosted server //"NTFY_TOKEN": "your-auth-token" // Use if using a protected topic/server } } }

请记住在 args 数组中使用 build/index.js 文件的绝对路径。

选项 5:MCP Marketplace 安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 ntfy-me-mcp:

npx -y @smithery/cli install @gitmotion/ntfy-me-mcp --client claude

配置

环境变量

通过复制提供的示例在项目目录中创建一个.env文件:

# Copy the example file cp .env.example .env # Edit the file with your preferred editor nano .env # or vim, code, etc.

您的.env文件应包含以下变量:

# Required NTFY_TOPIC=your-topic-name # Optional - Configure these if using a private/protected ntfy server # NTFY_URL=https://ntfy.sh # Default is ntfy.sh, change to your self-hosted ntfy server URL if needed # Include port if needed, e.g., https://your-ntfy-server.com:8443 # NTFY_TOKEN=your-access-token # Required for authentication with protected topics/servers # PROTECTED_TOPIC=false # Set to "true" if your topic requires authentication (helps prevent auth errors)

注意PROTECTED_TOPIC标志可帮助应用程序确定您的主题是否需要身份验证。如果设置为“true”且未提供令牌,系统将提示您输入令牌。这可以防止受保护主题的身份验证失败。

用法

验证

该服务器支持经过身份验证和未经身份验证的 ntfy 端点:

  • 公共主题:在 ntfy.sh 或其他公共服务器上使用公共主题时,无需身份验证。
  • 受保护的主题:对于受保护的主题或私有服务器,您需要提供访问令牌。

如果需要身份验证但未提供,您将收到一条清晰的错误消息,解释如何添加您的令牌。

设置通知接收器

  1. 在您的设备上安装ntfy 应用
  2. 订阅您选择的主题(与您的NTFY_TOPIC设置相同)

发送通知(ntfy_me 工具)

本节涵盖使用 ntfy_me 工具发送通知相关的所有功能。

使用自然语言

与人工智能助手一起工作时,您可以使用自然的短语,例如:

"Send me a notification when the build is complete" "Notify me when the task is done" "Alert me after generating the code" "Message me when the process finishes" "Send an alert with high priority"
消息参数

该工具接受以下参数:

范围描述必需的
任务标题通知标题是的
任务概要通知主体是的
优先事项消息优先级:最小、低、默认、高、最大
标签通知标签数组(支持表情符号短代码)
降价启用 Markdown 格式的布尔值(true/false)
行动可点击链接的视图操作对象数组

例子:

{ taskTitle: "Code Generation Complete", taskSummary: "Your React component has been created successfully with proper TypeScript typing.", priority: "high", tags: ["check", "code", "react"] }

这将发送带有复选标记表情符号的高优先级通知。

动作链接

您可以使用actions参数向通知添加可点击的操作按钮,或者让服务器自动检测消息中的 URL。

自动 URL 检测

当邮件正文中存在 URL 时,服务器会自动从检测到的第一个 URL 中创建最多 3 个查看操作(ntfy 的最大限制)。这样可以轻松添加可点击的链接,而无需手动指定操作数组。

例如,此消息:

{ taskTitle: "Build Complete", taskSummary: "Your PR has been merged! View the changes at https://github.com/org/repo/pull/123 or check the deployment at https://staging.app.com" }

将自动为两个 URL 生成查看操作,使它们在通知中可轻松点击。

手动操作配置

为了获得更多控制,您可以手动指定操作:

财产描述必需的
行动必须是“查看”是的
标签要显示的按钮文本是的
网址点击后打开的 URL是的
清除是否在点击时清除通知(可选)

带有操作链接的示例:

{ taskTitle: "Pull Request Review", taskSummary: "Your code has been reviewed and is ready for final checks", priority: "high", tags: ["check", "code"], actions: [ { action: "view", label: "View PR", url: "https://github.com/org/repo/pull/123" }, { action: "view", label: "View Changes", url: "https://github.com/org/repo/pull/123/files", clear: true } ] }
表情符号短代码

您可以在标签中使用表情符号短代码作为视觉指示:

  • warning → ⚠️
  • check →✅
  • rocket → 🚀
  • tada → 🎉

查看支持的表情符号短代码的完整列表

Markdown 格式

您的通知支持丰富的 Markdown 格式,并具备智能检测功能!当您在taskSummary中添加 Markdown 语法时,服务器会自动检测并启用 Markdown 解析 - 无需明确设置markdown: true

自动检测

服务器检查常见的 markdown 模式,例如:

  • 标题(#、## 等)
  • 列表(-、*、数字)
  • 代码块(```
  • 链接(文本
  • 粗体/斜体(文本文本

当检测到这些模式时,会自动为消息启用 markdown 解析。

手动超控

虽然大多数情况下自动检测都有效,但您仍然可以明确控制 markdown 解析:

{ taskTitle: "Task Complete", taskSummary: "Regular plain text message", markdown: false // Force disable markdown parsing }

检索消息(ntfy_me_fetch 工具)

本节介绍使用 ntfy_me_fetch 工具获取和过滤消息的所有功能。

使用自然语言

AI助手了解请求消息获取的各种方式:

"Show me my recent notifications" "Get messages from the last hour" "Find notifications with title 'Build Complete'" "Search for messages with the test_tube tag" "Show notifications from the updates topic from the last 24hr" "Check my latest alerts"
消息参数

该工具接受以下参数:

范围描述必需的
ntfyTopic从中获取消息的主题(默认为 NTFY_TOPIC 环境变量)
自从检索多久以前的消息(“10m”、“1h”、“1d”、时间戳、消息 ID 或“全部”)
消息ID通过 ID 查找特定消息
消息文本查找包含精确文本内容的消息
消息标题查找具有精确标题/主题的邮件
优先事项查找具有特定优先级的消息
标签查找具有特定标签的消息
示例
  1. 获取最近消息
{ since: "30m" // Get messages from last 30 minutes }
  1. 按标题和优先级过滤
{ messageTitle: "Build Complete", priorities: "high", since: "1d" }
  1. 使用标签搜索不同主题
{ ntfyTopic: "updates", tags: ["error", "warning"], since: "all" }
  1. 查找特定消息
{ messageId: "xxxxXXXXxxxx" }

返回的消息包含完整详细信息,包括:

  • 消息ID和时间戳
  • 主题和标题
  • 内容和优先级
  • 标签和附件
  • 操作链接和到期

注意:消息历史记录的可用性取决于您的 ntfy 服务器的缓存设置。公共 ntfy.sh 服务器通常会缓存 12 小时的消息。

发展

从源代码构建

git clone https://github.com/gitmotion/ntfy-me-mcp.git cd ntfy-me-mcp npm install npm run build

执照

该项目根据 GNU 通用公共许可证 v3.0 获得许可 - 有关详细信息,请参阅LICENSE文件。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。


gitmotion用❤️制作

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

精简的 MCP 服务器,使 AI 助手能够通过 ntfy 服务向您的设备发送实时通知,让您在任务完成或发生重要事件时收到警报。

  1. 概述
    1. 可通过以下方式获取:
  2. 目录
    1. 特征
      1. (即将推出...)
    2. 快速入门 - MCP 服务器配置
      1. NPM / NPX(推荐方法)
    3. Docker
      1. 在 Docker 中使用 MCP
    4. 安装
      1. 选项 1:全局安装
      2. 选项 2:使用 npx 运行
      3. 选项 3:本地安装
      4. 选项 4:使用 node 命令在本地构建并使用
      5. 选项 5:MCP Marketplace 安装
    5. 配置
      1. 环境变量
    6. 用法
      1. 验证
      2. 设置通知接收器
      3. 发送通知(ntfy_me 工具)
      4. 检索消息(ntfy_me_fetch 工具)
    7. 发展
      1. 从源代码构建
    8. 执照
      1. 贡献

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          An MCP server that lets AI assistants interact with your Lunchmoney data, enabling natural language queries about transactions, budgets, and spending patterns.
          Last updated -
          4
          3
          8
          TypeScript
          MIT License
        • -
          security
          A
          license
          -
          quality
          An MCP server that helps AI assistants access text content from websites that implement bot detection, bridging the gap between what you can see in your browser and what the AI can access.
          Last updated -
          1
          Python
          Apache 2.0
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server enabling AI systems to send real-time notifications to phones, desktops, and other devices through the ntfy publish/subscribe service.
          Last updated -
          71
          4
          TypeScript
          Apache 2.0
          • Apple
        • -
          security
          -
          license
          -
          quality
          An MCP server that allows AI assistants to utilize human capabilities by sending requests to humans and receiving their responses through a Streamlit UI.
          Last updated -
          23
          Python
          MIT License

        View all related MCP servers

        ID: fmis2ffviw