ntfy我mcp
  ](https://www.npmjs.com/package/ntfy-me-mcp) ](https://hub.docker.com/r/gitmotion/ntfy-me-mcp)  ](https://github.com/gitmotion/ntfy-me-mcp)
一个简化的模型上下文协议(MCP)服务器,用于通过ntfy服务(公共或带有令牌支持的自托管)发送通知📲
概述
ntfy me mcp为AI助手提供了通过以下方式向您的设备发送实时通知的能力 ntfy.sh 服务(公共或带有令牌支持的自托管)。当你的人工智能完成任务、遇到错误或达到重要里程碑时,你会收到通知——所有这些都没有持续的监控。
该服务器包括智能功能,如用于创建视图操作的自动URL检测和智能标记格式检测,使人工智能助手更容易创建丰富的交互式通知,而无需额外配置。
Preview Available via
NameLink / Badge
ntfy.sh Featured on ntfy.sh
Glama.ai
Smithery.ai
MseeP.ai
Archestra.ai
特性
- 🚀 快速设置:使用npx或docker运行!
- 🔔 实时通知:任务完成后,在手机/桌面上获取更新
- 🎨 丰富的通知:支持主题、标题、优先级、表情符号标签和详细消息
- 🔍 通知获取:从ntfy主题中获取并过滤缓存的消息
- 🎯 智能操作链接:自动检测消息中的URL并创建查看操作
- 📄 智能Markdown:自动检测并启用markdown格式(如果存在)
- 🔒 安全:可选的访问令牌身份验证
- 🔑 输入屏蔽:将ntfy令牌安全地存储在vs配置中!
- 🌐 自助支持:适用于ntfy.sh和自托管ntfy实例
马上就来。..
- 📨 电子邮件:向电子邮件发送通知(需要ntfy电子邮件服务器配置)
- 🔗 点击网址:能够自定义点击URL
- 🖼️ 图像URL:智能图像url检测,自动将图像url包含在消息和通知中
- 🏁 以及更多!
目录
Section Topics
Quickstart - MCP Server Configuration
Configuration Examples
Installation
Setting Up the Notification Receiver
Configuration
Environment Variables
Authentication
↳ Secure Token Handling (vscode)
Tools & Usage
ntfy_me: Sending Notifications
↳ Using Natural Language
↳ Example Usage
↳ Message Parameters
ntfy_me_fetch: Polling Notifications
↳ Using Natural Language
↳ Example Usage
↳ Fetch Parameters
Development & Contributions
License
快速入门-MCP服务器配置
选择与您的客户端匹配的配置形状。以下所有示例均使用 NTFY_TOPIC 将可选的auth设置作为必需变量,并在需要之前将其注释掉。
配置示例
Type Use Case Example
NPM / NPX Recommended for most MCP clients when you want the lightest setup.
Show config
{ "ntfy-me-mcp": { "command": "npx", "args": ["-y", "ntfy-me-mcp"], "env": { "NTFY_TOPIC": "your-ntfy-topic", "NTFY_URL": "https://ntfy.sh", // "NTFY_TOKEN": "add-your-ntfy-token" } } }
Local Use a local checkout when you are developing or changing the server yourself.
Replace /absolute/path/to/ntfy-me-mcp/build/index.js after building.
Show config
{ "ntfy-me-mcp": { "command": "node", "args": ["/absolute/path/to/ntfy-me-mcp/build/index.js"], "env": { "NTFY_TOPIC": "your-ntfy-topic", "NTFY_URL": "https://ntfy.sh", // "NTFY_TOKEN": "add-your-ntfy-token" } } }
Docker Use a containerized setup when Docker is already part of your environment.
- DockerHub: gitmotion/ntfy-me-mcp:latest - GHCR: ghcr.io/gitmotion/ntfy-me-mcp:latest
Show config
{ "ntfy-me-mcp": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "NTFY_TOPIC", "-e", "NTFY_URL", "-e", "NTFY_TOKEN", "gitmotion/ntfy-me-mcp:latest" ], "env": { "NTFY_TOPIC": "your-ntfy-topic", "NTFY_URL": "https://ntfy.sh", // "NTFY_TOKEN": "add-your-ntfy-token" } } }
OpenCode Add to opencode.json in your project root (for project-level config) or ~/.config/opencode/opencode.json (for global config). Uses "mcp" as the top-level key with type: "local" and command as an array.
Show config
{ "$schema": "https://opencode.ai/config.json", "mcp": { "ntfy-me-mcp": { "type": "local", "command": ["npx", "-y", "ntfy-me-mcp"], "environment": { "NTFY_TOPIC": "your-ntfy-topic", "NTFY_URL": "https://ntfy.sh", // "NTFY_TOKEN": "add-your-ntfy-token" } } } }
ClaudeCode Add to .mcp.json at your project root (shared with your team via version control), or to ~/.claude.json for user-level access across all projects.
Show config
{ "mcpServers": { "ntfy-me-mcp": { "command": "npx", "args": ["-y", "ntfy-me-mcp"], "env": { "NTFY_TOPIC": "your-ntfy-topic", "NTFY_URL": "https://ntfy.sh", "NTFY_TOKEN": "${NTFY_TOKEN}" } } } }
Copilot CLI Add to ~/.copilot/mcp-config.json for user-level access across all sessions. Use type: "local" for stdio-based servers like this one.
Show config
{ "mcpServers": { "ntfy-me-mcp": { "type": "local", "command": "npx", "args": ["-y", "ntfy-me-mcp"], "env": { "NTFY_TOPIC": "your-ntfy-topic", "NTFY_URL": "https://ntfy.sh", "NTFY_TOKEN": "your-access-token" }, "tools": ["*"] } } }
Token Auth Required for protected topics or self-hosted servers. See Secure Token Handling (vscode) or set NTFY_TOKEN directly.
Show config
{ "ntfy-me-mcp": { "command": "npx", "args": ["-y", "ntfy-me-mcp"], "env": { "NTFY_TOPIC": "your-ntfy-topic", "NTFY_URL": "https://your-ntfy-server.com", "NTFY_TOKEN": "your-access-token" } } }
安装
如果您需要直接安装并运行服务器(作为上述MCP配置的替代方案):
Option Example
Install globally Install once, run anywhere with the ntfy-me-mcp command.
npm install -g ntfy-me-mcp
Run with npx No install needed — ideal for a quick one-off run or testing.
npx ntfy-me-mcp
Install locally Clone the repo, install deps, build, and run via npm start.
Show steps
Clone repo, install deps, configure .env, build, run
git clone https://github.com/gitmotion/ntfy-me-mcp.git cd ntfy-me-mcp npm install cp .env.example .env npm run build npm start
MCP Marketplace — Smithery One-command install for Claude Desktop via Smithery.
Show command
npx -y @smithery/cli install @gitmotion/ntfy-me-mcp --client claude
设置通知接收器
View ntfy receiver Section
- 安装 Ntfy应用程序 在您的设备上
- 或者部署自己的ntfy服务器:https://docs.ntfy.sh/install/
- 订阅您选择的主题(与您的主题相同
NTFY_TOPIC设置)
配置
环境变量
创建一个 .env 通过复制示例来创建文件: cp .env.example .env --看 .env.example 以供参考。
| 变量 | 必填 | 默认 | 描述 |
|---|---|---|---|
NTFY_TOPIC | 是 | -- | 要向其发布通知的ntfy主题 |
NTFY_URL | 没有 | https://ntfy.sh | ntfy服务器URL--更改自托管实例的URL |
(如果需要,包括端口,例如。 https://your-server.com:8443) | |||
NTFY_TOKEN | 没有 | -- | 受保护主题或专用服务器的访问令牌 |
认证
View Authentication Section
此MCP服务器支持已验证和未验证的ntfy端点:
- 公共话题:在ntfy.sh或其他公共服务器上使用公共主题时,不需要身份验证。
- 受保护的主题:
- 对于受保护的主题或专用服务器,您需要通过以下方式提供访问令牌 NTFY_TOKEN env变量或 accessToken 工具的参数。 - 如果需要身份验证但未提供,您将收到一条明确的错误消息,解释如何添加令牌。
安全令牌处理(vscode)
- 如果您的客户端支持基于提示的秘密输入(即VS代码),请选择它而不是硬编码
NTFY_TOKEN在配置文件中。(否则直接使用您的代币) - 在您的
mcp.json文件:
Show VS Code mcp.json example
// Add this to your VS Code `mcp.json` file, either the user-level file or your workspace `.vscode/mcp.json`
// Set `NTFY_TOKEN` exactly to `"${input:ntfy_token}"` when you want VS Code to treat it as a secure prompt-backed value.
{
"inputs": [
{
"type": "promptString",
"id": "ntfy_token",
"description": "Ntfy Token",
"password": true
}
],
"servers": {
"ntfy-me-mcp": {
"command": "npx",
"args": ["-y", "ntfy-me-mcp"],
"env": {
"NTFY_TOPIC": "your-ntfy-topic",
"NTFY_URL": "https://your-ntfy-server.com",
"NTFY_TOKEN": "${input:ntfy_token}"
}
}
}
}| 字段 | 值 | 目的 |
|---|---|---|
env.NTFY_TOKEN | "${input:ntfy_token}" | 引用安全提示支持的令牌值 |
inputs[].id | "ntfy_token" | 定义所使用的输入名称 NTFY_TOKEN |
inputs[].type | "promptString" | 在运行时提示用户输入令牌 |
如果客户端解决"${input:ntfy_token}"在启动之前,服务器直接接收真实令牌。如果占位符原封不动地传递,ntfy me mcp会检测到未解析的输入引用,并在启动时提示输入令牌本身。 自从v1.4.0+,thePROTECTED_TOPICenv已被删除。此处理现在已从未解决的问题中自动检测到NTFY_TOKEN输入参考。
工具和用法
ntfy_me:发送通知
使用自然语言
- 使用人工智能助手时,您可以使用自然短语请求通知:
"ntfyme with a summary of the task when complete"
"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"示例用法
Input Output
{ "title": "Code Generation Complete", "message": "Your React component has been created successfully with proper TypeScript typing.", "priority": "high", "tags": ["white_check_mark", "code", "react"] }
{ "success": true, "endpoint": "https://ntfy.sh/ntfymetest" }
消息参数
Parameter Description Required Details / Example
title The notification title Yes —
message The notification body Yes —
url Custom ntfy server URL No Default: NTFY_URL
topic Custom ntfy topic No Default: NTFY_TOPIC
accessToken Access token for protected topics No Default: NTFY_TOKEN
priority Message priority level No Default: "default" Options: min, low, default, high, max
tags Array of notification tags. Supports emoji shortcodes for visual indicators — see the full list. No
warning → ⚠️
white_check_mark → ✅
rocket → 🚀
tada → 🎉
markdown Boolean to enable markdown formatting. Auto-detected when markdown syntax is present (headers, lists, code blocks, links, bold/italic) — no need to set explicitly. Can be overridden manually. No
Auto-detection: no configuration needed.
Manual override example
{ title: "Task Complete", message: "Regular plain text message", markdown: false // Force disable }
actions Array of view action objects for clickable links. URLs in the message body are auto-detected (up to 3 actions). For manual control, each action requires action, label, and url, with an optional clear flag. No
Auto-detection example
{ title: "Build Complete", message: "View at https://github.com/org/repo/pull/123" }
Automatically creates view actions for detected URLs.
Manual configuration example
{ title: "Pull Request Review", message: "Ready for final checks", 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 } ] }
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"示例用法
Input Output
{ "since": "6h" }
{ "success": true, "messageCount": 1, "topics": { "ntfymetest": [ { "id": "On4Jeo1ENDCB", "time": 1775859291, "event": "message", "topic": "ntfymetest", "message": "Test", "title": "Test", "priority": 3, "expires": 1775902491 } ] } }
获取参数
Parameter Description Required Details / Example
url Custom ntfy server URL No Default: NTFY_URL
topic Topic to fetch messages from No Default: NTFY_TOPIC
{ "topic": "updates", "since": "all" }
accessToken Access token for protected topics No Default: NTFY_TOKEN
since How far back to retrieve messages No
Options: '10m', '1h', '1d', timestamp, message ID, or 'all'
Example: { "since": "30m" }
messageId Find a specific message by its ID No { "messageId": "xxxxXXXXxxxx" }
messageText Find messages containing exact text content No { "messageText": "Build Complete" }
messageTitle Find messages with exact title/subject No { "messageTitle": "Build Complete", "priorities": "high", "since": "1d" }
priorities Find messages with specific priority levels No { "priorities": "high" }
tags Find messages with specific tags No { "tags": ["error", "warning"] }
发展与贡献
欢迎投稿!请看 贡献.md,其中包括一般指南、设置步骤等。
许可证
此项目根据GNU通用公共许可证v3.0获得许可-请参阅 许可证 文件以获取详细信息。
______________________________________________________________________
制作❤️ 通过 GitMotion 的
