Ntfy Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v2.4.0更新於 Oct 29, 2026

Send, manage, and replay ntfy push notifications via MCP.

已驗證STDIO僅桌面效率與工作流溝通與協作

概覽

AI 產生的概覽

透過 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 伺服器的網路。
安裝前請注意
發布會向訂閱者送出真實通知,清除與刪除會改變接收者看到的內容;伺服器會在清除/刪除以及使用電子郵件、電話或 broadcast/http 按鈕發布時要求確認。主題名稱應視為機密,知道它的人都能發布或訂閱。NTFY_AUTH_TOKEN、NTFY_AUTH_PASSWORD 與 MCP_REQUEST_STATE_KEY 屬於機密。單次呼叫傳入的 base_url 只有符合已註冊伺服器時才會帶上憑證;呼叫端不可信時應啟用 NTFY_BLOCK_PRIVATE_HOSTS。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ntfy Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ntfy-mcp-server

Send, manage, and replay ntfy push notifications via MCP. STDIO or Streamable HTTP.

4 Tools • 1 Resource • 1 Skill


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

ToolDescription
ntfy_publish_messageSend or update a push notification on an ntfy topic.
ntfy_manage_messageClear or delete a previously-sent notification by sequence_id.
ntfy_fetch_messagesPoll cached messages from one or more topics with optional filters.
ntfy_search_emoji_tagsLook up ntfy emoji tag short codes for use in tags.

Resources

ResourceDescription
ntfy://{topic}Snapshot of a topic — latest 20 messages from the past hour, plus the topic's browser URL.

ntfy_fetch_messages covers the same topic data with custom windows and filters when the resource's fixed defaults aren't enough.

Skills

SkillDescription
ntfy-guideUsing the ntfy_* tools: choosing the topic, carrying one sequence id through a notification's updates, clear, and delete, scheduling and cancelling reminders, and reading fetched history without miscounting

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 to triggered; pass the original sequence_id to update a sent message
  • Publishes with email, call, or a broadcast/http button ask the user to confirm the target before sending; declining fails with consent_declined
  • A per-call base_url gets credentials only if it matches a registered server (NTFY_BASE_URL or an NTFY_SERVERS entry); otherwise the request is unauthenticated
  • Failures carry typed reasons: payload_too_large (body, attachment, title, or combined tags over ntfy's limits), invalid_delay, invalid_attachment (malformed attach URL), and unverified_contact (email/call without a verified address or number, or without auth), alongside the shared reasons under Features

ntfy_manage_message tool

  • operation: clear marks the notification read and dismisses it (subscribers see message_clear); delete removes it from the drawer (subscribers see message_delete)
  • Every call asks the user to confirm the topic, sequence_id, and operation first; declining fails with consent_declined
  • The original message stays in cache, and repeating an operation is safe; ntfy.sh accepts an unknown sequence_id, stricter deployments return not_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 filters since (duration / timestamp / message ID / all / latest), priority, tags, id, title, message, plus scheduled to include delayed messages
  • Default window 10m, default limit 20, at most 100 per call; a larger window returns the newest limit messages with totalCount and a nextCursor to pass back as cursor. Bodies truncate at ~500 chars (messageTruncated gives the dropped count); refetch with id for the full text. upstreamTruncated flags a replay ntfy capped
  • Failures carry typed reasons: invalid_since (malformed since value), cursor_not_found (the cursor's message expired, or came from a call with different topics, since, or filters), and upstream_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 query to list the reference in order
  • limit default 25, at most 200 per call; page with offset using totalCount
  • Returned tag strings go straight into ntfy_publish_message's tags
  • On by default; set NTFY_ENABLE_EMOJI_TAGS=false to remove it from tools/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 (including upstreamTruncated)
  • 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_URL or an NTFY_SERVERS entry), with bearer-token and basic-auth modes mutually exclusive
  • User confirmation before a clear/delete, or a publish with email, call, or a broadcast/http button, on both stdio and Streamable HTTP
  • Optional SSRF guard on base_url overrides (NTFY_BLOCK_PRIVATE_HOSTS); registered servers are exempt
  • Bundled emoji-tag reference, regenerated from upstream docs/ntfy/emojis.md via scripts/build-emoji-tags.ts

Agent-friendly output:

  • Publish and manage echo the resolved topic, ID, and timestamp; fetch also echoes the resolved since and applied filters
  • Typed reason codes 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 whose Retry-After the call can't wait out, or no complete answer within the 50 s call deadline; carries retryAfter when 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 a notice naming the next step (pass nextCursor as cursor, advance offset)

Getting started

Add it to Claude Code:

sh
claude mcp add ntfy-mcp-server -- npx -y ntfy-mcp-server

For other clients, add this to the MCP config file:

json
{  "mcpServers": {    "ntfy-mcp-server": {      "command": "npx",      "args": ["-y", "ntfy-mcp-server"]    }  }}

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

VariableDescriptionDefault
NTFY_SERVERSJSON array of { baseUrl, authToken? | authUsername?+authPassword? } entries, one per ntfy server; the first is the default. Takes precedence over the single-server vars below.—
NTFY_BASE_URLSingle-server shorthand — base URL of the ntfy server (no trailing slash). Used when NTFY_SERVERS is unset.https://ntfy.sh
NTFY_DEFAULT_TOPICTopic used when a tool call omits topic.—
NTFY_AUTH_TOKENBearer access token (tk_…) for the single-server shorthand. Mutually exclusive with NTFY_AUTH_USERNAME / NTFY_AUTH_PASSWORD.—
NTFY_AUTH_USERNAMEBasic-auth username for the single-server shorthand — required together with NTFY_AUTH_PASSWORD.—
NTFY_AUTH_PASSWORDBasic-auth password for the single-server shorthand — required together with NTFY_AUTH_USERNAME.—
NTFY_REQUEST_TIMEOUT_MSPer-attempt HTTP timeout in milliseconds. Each call is also capped at 50 s across all attempts.15000
NTFY_MAX_RETRIESMax retry attempts for transient upstream failures (5xx, network, 429).3
NTFY_BLOCK_PRIVATE_HOSTSWhen true, a per-call base_url override must resolve to a public address and redirects are not followed. Registered servers are exempt. Turn it on where callers you don't control can reach the server.false
NTFY_ENABLE_EMOJI_TAGSSet to false to disable ntfy_search_emoji_tags. An unrecognized value fails startup.true
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_SESSION_MODEHTTP session model: auto, stateful, or stateless. Over HTTP this server requires stateful (auto resolves to it); stateless is refused at start. Ignored on stdio.stateful
MCP_HTTP_HOSTHTTP host.127.0.0.1
MCP_HTTP_PORTHTTP port.3010
MCP_HTTP_ENDPOINT_PATHHTTP endpoint path./mcp
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_REQUEST_STATE_KEYRecommended for HTTP. Key (≥ 32 bytes, e.g. openssl rand -base64 32, the same on every instance) that seals the consent requestState for 900 s; an invalid or expired state is rejected with -32602 invalid_request_state.—
STORAGE_PROVIDER_TYPEWhere consent records live (600 s TTL). Multi-instance HTTP needs shared storage: filesystem (shared volume), supabase, or cloudflare-d1, not cloudflare-kv.in-memory
MCP_LOG_LEVELLog level (RFC 5424).info
LOGS_DIRDirectory for file-based logs (Node only; ignored on Workers)../logs
LOG_TOOL_FAILURE_PAYLOADSLog each failed tool call's arguments and result, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). A secret inside a free-form value is not redacted.false
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false

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:

    sh
    git clone https://github.com/cyanheads/ntfy-mcp-server.gitcd ntfy-mcp-server && bun installcp .env.example .env   # set NTFY_DEFAULT_TOPIC (and auth, if needed)
  • Build and run:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http

    For Streamable HTTP:

    sh
    MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 NTFY_DEFAULT_TOPIC=your-topic bun run start:http# Server listens at http://127.0.0.1:3010/mcp
  • Run checks and tests:

    sh
    bun run devcheck     # Lint, format, typecheck, security, changelog syncbun run test         # Vitest test suitebun run lint:mcp     # Validate MCP definitions against spec

Docker

sh
docker run --rm -e NTFY_DEFAULT_TOPIC=your-topic -p 3010:3010 ghcr.io/cyanheads/ntfy-mcp-server:latest

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

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools and resources, initializes services.
src/configServer-specific environment variable parsing (NTFY_*) with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts).
src/mcp-server/resourcesResource definitions (*.resource.ts).
src/services/ntfyntfy HTTP client, types, and error classifier.
src/services/emoji-tagsBundled emoji short-code reference and lookup service.
skills/Agent Skills the server publishes (ntfy-guide), served over MCP via createApp({ skills: 'skills' }).
docs/ntfyMirrored upstream ntfy API docs (pinned commit in SOURCES.md).
tests/Unit and integration tests mirroring src/.

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for 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:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

來源:README.md,提交 82ff90a

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

5
  1. v2.4.0最新Oct 29, 2026
  2. v2.3.7Oct 15, 2026
  3. v2.3.6Oct 7, 2026
  4. v2.3.5Sep 22, 2026
  5. v2.3.4Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分