Skip to main content
Glama

NTFY MCP Server

MCP server for ntfy.sh notifications, asynchronous agent messaging, and human-in-the-loop workflows.

It provides a simple way for an MCP client to publish messages to an ntfy topic, maintain a live subscription, and wait for replies without building a custom messaging layer.

What It Does

This server is useful when you need:

  • push notifications from an MCP-connected agent

  • asynchronous message exchange between a user and an agent

  • a lightweight human approval or reply loop over ntfy

  • a simple notification channel for long-running workflows

Typical flow:

  1. A user or external system publishes a message to an ntfy topic.

  2. The MCP client reads it through wait-and-read-inbox or ntfy://inbox.

  3. The agent responds through send-ntfy.

  4. The user receives the response as an ntfy push notification.

Related MCP server: Chat Human MCP Server

Features

  • publish messages with optional title, priority, tags, and attachments

  • maintain a persistent subscription for near real-time delivery

  • switch topics without restarting the server

  • keep recent messages in memory and on disk

  • support bearer-token and basic-auth protected topics

  • work with public ntfy.sh out of the box

Installation

Install globally:

npm install -g nfty-mcp-server

Or run through npx:

npx -y --yes nfty-mcp-server

Quick Start

1. Choose a topic

Create or reuse a topic on ntfy.sh. Public topics are easy to set up, so pick a unique name.

2. Configure your MCP client

For Cursor or VS Code, add this to your MCP settings:

{
  "mcpServers": {
    "nfty": {
      "command": "npx",
      "args": ["-y", "--yes", "nfty-mcp-server"],
      "env": {
        "NTFY_TOPIC": "your-topic-name",
        "NTFY_BASE_URL": "https://ntfy.sh"
      }
    }
  }
}

For Claude Desktop, add the same server entry to claude_desktop_config.json.

Notes:

  • NTFY_TOPIC is required

  • --yes keeps npx installs in its own cache instead of polluting a project directory

3. Restart the client

Restart Cursor, VS Code, or Claude Desktop so the MCP server is loaded.

Tools

send-ntfy

Publishes a message to the configured topic.

Parameters:

  • message required

  • title optional

  • priority optional, 1 through 5

  • tags optional

  • attachUrl optional

Example:

{
  "message": "Task completed successfully.",
  "title": "Task Status",
  "priority": 4
}

set-ntfy-topic

Switches the active topic for the current session.

Parameters:

  • topic required

  • baseUrl optional

wait-and-read-inbox

Waits for new messages on the configured topic and returns when at least one arrives.

Parameters:

  • since optional

  • sinceTime optional

  • sinceNow optional, default true

Important:

  • many MCP clients impose an approximately 60-second timeout

  • if you are waiting on human input, the client or calling agent should retry on timeout

Recommended prompt behavior for agent chat flows:

If wait-and-read-inbox times out while waiting for a user response, retry until a new message arrives.

Resources

ntfy://inbox

Returns recent messages for the configured topic as JSON.

Example shape:

{
  "topic": "your-topic",
  "baseUrl": "https://ntfy.sh",
  "messages": [
    {
      "id": "message-id",
      "time": 1234567890,
      "title": "Message Title",
      "message": "Message body",
      "priority": 3,
      "tags": ["tag1"],
      "topic": "your-topic"
    }
  ]
}

Configuration

Data Storage

The server stores logs, cache files, and lock files in a dedicated data directory so it does not clutter the current project.

Default location:

  • macOS / Linux: ~/.nfty-mcp-server/

  • Windows: C:\Users\<user>\.nfty-mcp-server\

Files written there include:

  • nfty-messages.json

  • nfty-debug.log

  • nfty-process.log

  • nfty.lock

Environment Variables

Variable

Description

Default

NTFY_TOPIC

Topic to send/receive messages

required

NTFY_BASE_URL

ntfy server URL

https://ntfy.sh

NTFY_AUTH_TOKEN

Bearer token

optional

NTFY_USERNAME

Basic-auth username

optional

NTFY_PASSWORD

Basic-auth password

optional

NTFY_SINCE

Initial backlog cursor

1h

NTFY_FETCH_TIMEOUT_MS

Fetch timeout in milliseconds

10000

NTFY_CLEAN_ON_STARTUP

Clear logs/cache on startup

true

NTFY_KILL_EXISTING

Kill existing server instances

true

NTFY_DATA_DIR

Data directory override

default platform path

NTFY_CACHE_FILE

Cache file override

{NTFY_DATA_DIR}/nfty-messages.json

CLI Arguments

You can also configure the server directly:

npx nfty-mcp-server --topic my-topic --base-url https://ntfy.sh --auth-token your-token

Supported arguments:

  • --topic

  • --base-url or --server

  • --auth-token

  • --username

  • --password

  • --since

  • --log-incoming

How It Works

  1. The server opens a persistent HTTP subscription to the configured topic.

  2. Incoming messages are received through that live connection.

  3. Recent messages are cached in memory and persisted to disk.

  4. MCP tools expose send, topic-switching, and wait/read behavior on top of that subscription.

Use Cases

  • asynchronous user-agent messaging

  • push notifications for long-running tasks

  • human approval loops

  • lightweight operator alerts

  • agent-to-agent coordination through a shared topic

Development

git clone https://github.com/harshwasan/NFTY-MCP.git
cd NFTY-MCP
npm install
npm test
npm run dev

Project layout:

NFTY-MCP/
  src/server.js
  tests/server.test.js
  package.json

Troubleshooting

Messages not arriving:

  • verify NTFY_TOPIC

  • confirm the topic exists and is reachable

  • inspect the debug log in the configured data directory

Connection problems:

  • verify network access to the configured NTFY_BASE_URL

  • verify authentication settings if the topic is protected

License

MIT

Available Tools

3 tools
send-ntfySend ntfy messageA

Publish a message to the configured ntfy topic (set in mcp.json). Supports optional title, priority (1-5), tags, and attachUrl. After sending, use wait-and-read-inbox to wait for responses.

Inputs: message (required), tags, title, priority, +1 more. Returns: id, time, topic, status, +1 more

set-ntfy-topicSet ntfy topicB

Change the ntfy topic for this MCP server session (no restart needed).

Inputs: topic (required), baseUrl. Returns: topic, baseUrl

wait-and-read-inboxWait for new messagesA

Waits for new messages on the configured topic (set in mcp.json) and returns when a new message arrives. Does not return until at least one new message is received. Uses the existing subscription. Note: The MCP protocol has a ~60s client-side timeout that cannot be controlled from the server, but this tool will wait as long as possible within that limit.

Inputs: since, sinceNow, sinceTime. Returns: messages, newCount, lastCursor

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool serves a distinct purpose: sending messages, changing topic, and waiting for incoming messages. No overlap, clear boundaries.

    Naming Consistency3/5

    Tool names mix patterns: 'send-ntfy' and 'set-ntfy-topic' use verb-ntfy, but 'wait-and-read-inbox' uses a different structure with 'and'. Inconsistent naming conventions.

    Tool Count5/5

    Three tools is appropriate for a focused notification server: send, configure topic, and receive. Each tool is necessary and none are redundant.

    Completeness4/5

    Core publish/subscribe functionality is covered with send and wait. The set-topic tool adds flexibility. A minor gap is lack of explicit unsubscribe or message history, but not essential for core use.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      A streamlined MCP server that enables AI assistants to send real-time notifications to your devices through the ntfy service, allowing you to receive alerts when tasks complete or important events occur.
      2
      190 npm
      77
      GPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to communicate with humans using notify and ask semantics, supporting session management and blocking or non-blocking messages.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Send push notifications to mobile devices via ntfy.sh from AI assistants.
      MIT