
Ntfy Mcp Server
io.github.cyanheads由 GitHub 账号 cyanheads 发布v2.4.0更新于 Oct 29, 2026
Send, manage, and replay ntfy push notifications via MCP.
概览
通过 ntfy 发送、更新、清除和删除推送通知,并可轮询主题历史,让助手把提醒推送到手机或桌面。
- 可以做什么
- 在 ntfy 主题上发布或更新推送通知,支持标题、优先级、标签、点击链接、附件、延迟、邮件/电话投递和操作按钮
- 按 sequence id 清除或删除已发送的通知
- 按时间窗口、优先级、标签、ID 和标题等条件轮询一个或多个主题的缓存消息,支持分页
- 查询 ntfy 表情标签短代码,用于通知标签
- 读取主题快照资源,获取过去一小时最新的 20 条消息
- 适用场景
- 适合让助手通过 ntfy 向你或团队发送构建、任务告警、提醒或状态通知,并查看主题近期历史。公共 ntfy.sh 无需账号,便于快速试用。
- 运行要求
- 通过 npx 以 stdio 在本地运行(需 Node.js 或 Bun),也可用 Streamable HTTP 或 Docker。需要一个 ntfy 服务器上的主题,可用 NTFY_DEFAULT_TOPIC 设置默认主题。公共 ntfy.sh 无需账号;受保护或自建服务器需 NTFY_AUTH_TOKEN,或 NTFY_AUTH_USERNAME 加 NTFY_AUTH_PASSWORD,或在 NTFY_SERVERS 中按服务器配置。需要能访问 ntfy 服务器的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Ntfy Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
ntfy-mcp-server
Send, manage, and replay ntfy push notifications via MCP. STDIO or Streamable HTTP.
Overview
Push notifications to your phone or desktop through ntfy. Publish, update, and manage notifications, poll a topic's recent history, and look up emoji short codes for tags.
Tools
Resources
ntfy_fetch_messages covers the same topic data with custom windows and filters when the resource's fixed defaults aren't enough.
Skills
Plugin, npm, Docker, and MCPB installs ship it from skills/; MCP clients that support the Skills extension read it as skill://ntfy-guide/SKILL.md.
Capability reference
ntfy_publish_message tool
- Topics are created on first publish — treat the topic name as a secret; anyone who knows it can publish or subscribe
- Takes
title,priority(1–5),tags,click,attach,icon,filename,markdown,delay,email,call,cache,firebase, and up to three action buttons (view,broadcast,http,copy); body capped at 4096 bytes, empty body defaults totriggered; pass the originalsequence_idto update a sent message - Publishes with
email,call, or abroadcast/httpbutton ask the user to confirm the target before sending; declining fails withconsent_declined - A per-call
base_urlgets credentials only if it matches a registered server (NTFY_BASE_URLor anNTFY_SERVERSentry); otherwise the request is unauthenticated - Failures carry typed reasons:
payload_too_large(body, attachment,title, or combinedtagsover ntfy's limits),invalid_delay,invalid_attachment(malformedattachURL), andunverified_contact(email/callwithout a verified address or number, or without auth), alongside the shared reasons under Features
ntfy_manage_message tool
operation:clearmarks the notification read and dismisses it (subscribers seemessage_clear);deleteremoves it from the drawer (subscribers seemessage_delete)- Every call asks the user to confirm the topic,
sequence_id, and operation first; declining fails withconsent_declined - The original message stays in cache, and repeating an operation is safe; ntfy.sh accepts an unknown
sequence_id, stricter deployments returnnot_found
ntfy_fetch_messages tool
- Returns a snapshot, not a live stream; accepts comma-separated topics (e.g.
alerts,backups, each 1–64 characters) and filterssince(duration / timestamp / message ID /all/latest),priority,tags,id,title,message, plusscheduledto include delayed messages - Default window
10m, default limit 20, at most 100 per call; a larger window returns the newestlimitmessages withtotalCountand anextCursorto pass back ascursor. Bodies truncate at ~500 chars (messageTruncatedgives the dropped count); refetch withidfor the full text.upstreamTruncatedflags a replay ntfy capped - Failures carry typed reasons:
invalid_since(malformedsincevalue),cursor_not_found(the cursor's message expired, or came from a call with different topics,since, or filters), andupstream_malformed(the response wasn't an ntfy message stream), alongside the shared reasons under Features
ntfy_search_emoji_tags tool
- Case-insensitive substring match on tag names; omit
queryto list the reference in order limitdefault 25, at most 200 per call; page withoffsetusingtotalCount- Returned
tagstrings go straight intontfy_publish_message'stags - On by default; set
NTFY_ENABLE_EMOJI_TAGS=falseto remove it fromtools/list
ntfy://{topic} resource
- Fixed snapshot: latest 20 messages from the past hour plus the topic's browser URL, in the same shape as
ntfy_fetch_messages(includingupstreamTruncated) - For custom windows or filters, use
ntfy_fetch_messages
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
ntfy-specific:
- Retrying ntfy client with a per-attempt timeout, and each call capped at 50 s so it settles before an MCP client's 60 s default
- Per-server auth: credentials bind to each registered base URL (
NTFY_BASE_URLor anNTFY_SERVERSentry), with bearer-token and basic-auth modes mutually exclusive - User confirmation before a clear/delete, or a publish with
email,call, or abroadcast/httpbutton, on both stdio and Streamable HTTP - Optional SSRF guard on
base_urloverrides (NTFY_BLOCK_PRIVATE_HOSTS); registered servers are exempt - Bundled emoji-tag reference, regenerated from upstream
docs/ntfy/emojis.mdviascripts/build-emoji-tags.ts
Agent-friendly output:
- Publish and manage echo the resolved topic, ID, and timestamp; fetch also echoes the resolved
sinceand applied filters - Typed
reasoncodes let callers branch on failure mode. Shared across the tools and the resource:forbidden_topic(ntfy refused the topic with 401/403: missing or insufficient credentials),rate_limited(429 after retries),upstream_unreachable(network failure, a 5xx that outlasted retries or whoseRetry-Afterthe call can't wait out, or no complete answer within the 50 s call deadline; carriesretryAfterwhen ntfy sent one),upstream_malformed(a reply that isn't ntfy's message format or couldn't be read in full; publish and manage don't retry it, since the event may already be out).consent_declined,not_found, and the rest are listed per entry - Fetch and emoji search report
truncated,totalCount, and anoticenaming the next step (passnextCursorascursor, advanceoffset)
Getting started
Add it to Claude Code:
For other clients, add this to the MCP config file:
Public ntfy.sh works without an account. Set NTFY_DEFAULT_TOPIC so calls can omit topic; for protected topics, add NTFY_AUTH_TOKEN (generate one at https://ntfy.sh/account). With claude mcp add, pass each as -e NAME=value after the server name; in JSON, put them under env. For Docker, a source build, or Streamable HTTP, see Running the server.
Configuration
See .env.example for the full list of optional overrides.
Running the server
Local development
Requires Bun v1.4.0 or higher (or Node.js v24+) and a topic on an ntfy server. Public ntfy.sh needs no account; self-hosted instances and protected topics may need a bearer token or basic-auth credentials.
-
Clone and install:
-
Build and run:
For Streamable HTTP:
-
Run checks and tests:
Docker
The image defaults to HTTP transport, stateful session mode, and logs to /var/log/ntfy-mcp-server. To run it over stdio from an MCP client, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "-e", "NTFY_DEFAULT_TOPIC=your-topic", "ghcr.io/cyanheads/ntfy-mcp-server:latest"]. To build locally, docker build -t ntfy-mcp-server .. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
- Per-tool
errors[]contracts stay inline — repetition is intended for locality
Contributing
Issues are welcome. Run checks and tests before submitting:
License
Apache-2.0 — see LICENSE for details.
来源:README.md,提交 82ff90a
工具
0版本历史
5- v2.4.0最新Oct 29, 2026
- v2.3.7Oct 15, 2026
- v2.3.6Oct 7, 2026
- v2.3.5Sep 22, 2026
- v2.3.4Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分