ntfy-notify

ntfy-notify

Lets you send push notifications to your phone via ntfy, enabling alerts from scheduled tasks or direct messages.

Category
Visit Server

README

ntfy-notify

CI License: MIT Python 3.10+

A tiny Model Context Protocol (MCP) server that lets Claude / Cowork push notifications to your phone via ntfy. Point a scheduled task at it and the results land on your lock screen instead of waiting in a log somewhere.

Why I built this: I run a scheduled daily job-search inbox sweep, and I wanted the summary on my phone the moment it finishes instead of having to go check on it. ntfy is a dead-simple pub/sub-over-HTTP service, so the whole thing is one HTTP POST behind an MCP tool.

What it does

Exposes two MCP tools over stdio:

Tool Purpose
send_notification(message, title="", priority="default", tags="", click_url="") Send any push notification to your configured ntfy topic.
send_job_alert(summary) Convenience wrapper: title "Job sweep", high priority, briefcase tag.

priority accepts min / low / default / high / urgent (or "1".."5"). tags is a comma-separated list of emoji shortcodes, e.g. tada,computer. click_url opens when you tap the notification.

How ntfy works (30-second version)

ntfy is pub/sub over HTTP. You pick a topic — any string — and subscribe to it in the phone app. Anyone who knows the topic name can publish to it with a single HTTP POST, and it shows up on every subscribed device. There's no account or auth for public topics, which means the topic name is the only secret, so make it long and random.

How it works

There's no daemon and no always-on process. A stdio MCP server is launched by the client (Claude/Cowork) as a child process when a session starts, speaks JSON-RPC over stdin/stdout, stays idle until a tool is called, and is shut down when the session ends.

Claude / Cowork session
        │  (launches as subprocess, JSON-RPC over stdio)
        ▼
   server.py  ──►  @mcp.tool() functions
        │              send_notification / send_job_alert
        │  builds one HTTP POST:
        │    body    = message text
        │    headers = Title / Priority / Tags / Click / Authorization
        ▼
   https://ntfy.sh/<NTFY_TOPIC>
        │  (pub/sub fan-out)
        ▼
   ntfy app on your phone

Key design points:

  • The topic is read from the environment, never hardcoded (_config()). Since the topic name is the only secret in ntfy, this is what makes the repo safe to be public — and it fails loudly with a clear error if NTFY_TOPIC is unset.
  • @mcp.tool() turns a plain function into a tool. The function name, type hints, and docstring become the schema and description that Claude reads to decide when and how to call it.
  • ntfy has no JSON payload. The message is the raw request body; everything else (title, priority, tags, click URL, auth token) rides along as HTTP headers.
  • Every call returns an OK: / FAILED: status string so the model knows whether the push actually went out. Network errors and non-2xx responses are caught and reported rather than raised.

Development

Run the test suite (pure logic + header construction, no network calls):

pip install -e ".[dev]"
pytest

1. Install the ntfy app and pick a topic

  1. Install ntfy on your phone:
  2. Generate a long, random topic name so nobody else can guess it:
    openssl rand -hex 16
    
  3. In the app, tap + and subscribe to that exact string.

2. Install the server

Requires Python 3.10+.

git clone https://github.com/Gardner-Programs/ntfy-notify.git
cd ntfy-notify
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

3. Configure environment variables

Copy the example and fill it in:

cp .env.example .env
Variable Required Default Notes
NTFY_TOPIC yes Your long, random topic. Never hardcoded.
NTFY_BASE_URL no https://ntfy.sh Set to your own host if self-hosting.
NTFY_TOKEN no Bearer token for protected / self-hosted topics.

The server reads these from the process environment. The MCP config below sets them directly, so a .env file is only needed for the curl test / manual runs.

4. Register the server with Cowork / Claude

Add an entry to your MCP client config. For Claude Desktop (claude_desktop_config.json) or Cowork, point it at the cloned repo:

{
  "mcpServers": {
    "ntfy-notify": {
      "command": "python",
      "args": ["/absolute/path/to/ntfy-notify/server.py"],
      "env": {
        "NTFY_TOPIC": "your-long-random-topic",
        "NTFY_BASE_URL": "https://ntfy.sh",
        "NTFY_TOKEN": ""
      }
    }
  }
}

For Claude Code, the equivalent one-liner:

claude mcp add ntfy-notify \
  --env NTFY_TOPIC=your-long-random-topic \
  -- python /absolute/path/to/ntfy-notify/server.py

If you installed into a virtualenv, use that interpreter's absolute path (e.g. /absolute/path/to/ntfy-notify/.venv/bin/python) as the command.

Restart the client and the send_notification / send_job_alert tools will appear.

5. Verify with curl

You don't need this server to test ntfy itself — confirm your topic works first:

curl \
  -H "Title: Hello from ntfy" \
  -H "Priority: high" \
  -H "Tags: tada" \
  -d "It works!" \
  https://ntfy.sh/your-long-random-topic

With a token (protected / self-hosted):

curl \
  -H "Authorization: Bearer tk_yourtoken" \
  -d "It works!" \
  https://ntfy.example.com/your-long-random-topic

You should get a push on your phone within a second or two.

Integration: daily job-inbox-sweep

Once the server is registered, update the scheduled daily-job-inbox-sweep task so its final step calls the tool with the run's summary, e.g.:

At the end of the run, call send_job_alert with a one-paragraph summary of what was found (new postings, replies, anything needing action).

send_job_alert already sets a sensible title and high priority, so a single call with the summary text is all the task needs.

License

MIT — see LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured