notify-mcp

notify-mcp

Enables AI to send push notifications to your phone via a configurable gateway. It is a thin wrapper that posts to an Apprise push gateway.

Category
访问服务器

README

messagers — MCP push-notification tool

English | 简体中文

An MCP server that gives any MCP client (Claude Code, etc.) a send_notification tool. The AI calls it to proactively push a short message to your phone — no need to read any doc or remember a curl/token. It is a thin wrapper: the tool just POSTs to the Apprise push gateway; all chat credentials / proxy / channels live in the gateway.

Claude / MCP client ── send_notification(message, title?, tag?) ──► notify_mcp.py
                                                                        │ HTTP POST (+bearer)
                                                                        ▼
                                                  apprise gateway ──► Telegram / Feishu / ...

Point the wrapper at your gateway with NOTIFY_GATEWAY_URL (see Configure). The gateway itself (server + how to deploy it) is documented in docs/NOTIFY_GATEWAY.md; that file describes one example deployment (Linux + systemd) — host, port and proxy will differ per machine.

The tool

send_notification(message: str, title: str = "", tag: str = "default") -> str — pushes message (with optional bold title) to the recipient group tag. Returns "ok" or an error string.

Install

Dependencies are managed with uv (Python 3.12, pinned in .python-version; lockfile uv.lock is committed):

uv sync                    # wrapper deps (mcp) + dev tools (pytest, pre-commit)
uv sync --extra gateway    # also install apprise, for running the gateway locally

Scripts

Script What it does
scripts/install_mcp.sh Register this MCP with whichever clients are installed (Claude Code user scope + Codex CLI global). Idempotent.
scripts/start_gateway.sh Run the Apprise push gateway (server.py) in the foreground, with sensible HOST/PORT defaults.
./scripts/install_mcp.sh      # add the MCP to Claude Code + Codex CLI
./scripts/start_gateway.sh    # start the gateway (needs ./token and ./targets.json)

A real deployment usually runs the gateway under a service manager (e.g. systemd) — see docs/NOTIFY_GATEWAY.md. start_gateway.sh is for local/manual runs.

Configure

Config is via environment variables (the tool reads them at runtime):

Env Default Meaning
NOTIFY_GATEWAY_URL http://localhost:27319/notify gateway endpoint — set this to your gateway's host:port
NOTIFY_GATEWAY_TOKEN bearer token (overrides the file)
NOTIFY_TOKEN_FILE ./.token next to the script file holding the bearer token

The default assumes the gateway runs on the same host. On any other machine, set NOTIFY_GATEWAY_URL to where the gateway actually listens (e.g. when registering, ./scripts/install_mcp.sh bakes in NOTIFY_GATEWAY_URL if you export it first).

Put the gateway bearer token in a gitignored .token file (recommended — keeps the secret out of both git and the MCP client config):

printf '%s' '<BEARER_TOKEN>' > .token && chmod 600 .token

Register with Claude Code / Codex CLI

Easiest — from the repo directory, run the install script (it auto-detects the repo path and registers with both clients using a uv run launch command, so the server uses this repo's locked deps):

# optionally point at your gateway first; it gets baked into the registration:
export NOTIFY_GATEWAY_URL=http://<gateway-host>:<port>/notify
./scripts/install_mcp.sh

Or register manually (replace <repo> with this repo's absolute path):

# Claude Code, user scope (available in every project):
claude mcp add notify -s user -- uv run --directory <repo> python notify_mcp.py

# Codex CLI (writes to ~/.codex/config.toml; verify with `codex mcp list`):
codex mcp add notify -- uv run --directory <repo> python notify_mcp.py

Restart / reconnect the client so it picks up the new server. The send_notification tool then appears automatically — the AI reads the tool description, not this README.

To point at a gateway, add -e NOTIFY_GATEWAY_URL=http://<gateway-host>:<port>/notify (Claude) / --env ... (Codex).

Windows: the .sh scripts need Git Bash / WSL. Without them, register manually as above (use where uv to confirm uv is on PATH) and use a native path for <repo>.

Test (without an MCP client)

uv run python -c "from notify_mcp import _post; print(_post('test from notify-mcp', title='hello'))"
# -> (True, '{"ok": true, ...}')  and a chat message arrives

Unit tests

uv run pytest -q    # 28 tests, no network needed

tests/ covers the wrapper (test_notify_mcp.py), the gateway with a stubbed apprise (test_server.py), and the MCP introspection contract (test_introspection.py). None of them touch the real network or gateway.

Lint / format (pre-commit)

Formatting and linting are enforced with ruff via pre-commit; uv-lock keeps uv.lock in sync with pyproject.toml.

uv run pre-commit install        # once per clone — runs the hooks on every commit
uv run pre-commit run --all-files

Docs

All under docs/:

  • docs/NOTIFY_GATEWAY.md — example gateway deployment (systemd, proxy, Telegram/Feishu).
  • docs/MCP_INTROSPECTION.md — how a client discovers this server's identity and tool (the tool description IS the send_notification docstring; there is no URL path).
  • docs/ABOUT.txt — short, human-friendly intro (中文).

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选