An MCP (Model Context Protocol) server designed to interact with the ntfy push notification service. It enables LLMs and AI agents to send notifications to your devices with extensive customization options.
This server implements the Model Context Protocol (MCP), enabling standardized communication between LLMs and external systems. Specifically, it provides an interface to the ntfy push notification service.
┌───────────┐ ┌───────────┐ ┌───────────┐ ┌─────────┐
│ LLM Agent │ ────▶│ Ntfy MCP │ ────▶│ Ntfy │ ────▶│ Your │
│ (Claude) │ │ Server │ │ Service │ │ Devices │
└───────────┘ └───────────┘ └───────────┘ └─────────┘
@modelcontextprotocol/sdk
for seamless integration with LLM agents.send_ntfy
) to send notifications with support for:winston
and winston-daily-rotate-file
for detailed and rotatable logs.dotenv
for easy environment-based configuration.sanitize-html
), and security filters (xss-filters
).# Option 2: Clone repository and build
git clone https://github.com/cyanheads/ntfy-mcp-server.git
cd ntfy-mcp-server
npm install
npm run build
# Create .env file (optional but recommended)
cp .env.example .env
# Edit .env to set NTFY_DEFAULT_TOPIC
# Start the server
npm start
``
3. **Add to MCP Client Settings:** Add the server to your MCP client settings file (see [Configuration](#configuration)).
4. **Use the tool:** Once connected, you can use the
send_ntfy` tool to send notifications.
shell
npm install -g ntfy-mcp-server
shell
npm install ntfy-mcp-server
shell
git clone https://github.com/cyanheads/ntfy-mcp-server.git
cd ntfy-mcp-server
shell
npm install
shell
npm run build
Create a .env
file in the project root based on .env.example
:
# Ntfy Configuration
NTFY_BASE_URL=https://ntfy.sh # Optional: Base URL of your ntfy instance
NTFY_DEFAULT_TOPIC=your_default_topic # Optional: Default topic if none specified in requests
# Application Configuration
LOG_LEVEL=info # Optional: Logging level (debug, info, warn, error)
NODE_ENV=development # Optional: Environment (development, production)
Add the following configuration to your Cline MCP settings file:
{
"mcpServers": {
"ntfy": {
"command": "ntfy-mcp-server",
"env": {
"NTFY_BASE_URL": "https://ntfy.sh",
"NTFY_DEFAULT_TOPIC": "your_default_topic",
"LOG_LEVEL": "info",
"NODE_ENV": "production"
}
}
}
}
Add the following configuration to your Claude Desktop config file:
{
"mcpServers": {
"ntfy": {
"command": "ntfy-mcp-server",
"env": {
"NTFY_BASE_URL": "https://ntfy.sh",
"NTFY_DEFAULT_TOPIC": "your_default_topic",
"LOG_LEVEL": "info",
"NODE_ENV": "production"
}
}
}
}
.
├── .env.example # Example environment variables
├── .gitignore # Git ignore patterns
├── LICENSE # Project license (Apache-2.0)
├── package.json # Project metadata and dependencies
├── tsconfig.json # TypeScript compiler configuration
├── docs/
│ └── tree.md # Auto-generated directory structure
├── logs/ # Runtime logs (created automatically)
├── scripts/ # Utility scripts
│ ├── clean.ts # Cleans build artifacts and logs
│ └── tree.ts # Generates the docs/tree.md file
└── src/ # Source code
├── index.ts # Main server entry point
├── config/ # Configuration loading
├── mcp-server/ # MCP server logic, tools, and resources
│ ├── resources/ # MCP resource implementations
│ ├── tools/ # MCP tool implementations
│ └── utils/ # MCP-specific utilities
├── services/ # External service integrations (ntfy)
├── types-global/ # Global type definitions
└── utils/ # General utility functions
send_ntfy
Sends a notification message via the ntfy service.
Parameter | Type | Required | Description |
---|---|---|---|
topic |
string | Yes | The ntfy topic to publish to. |
message |
string | Yes | The main content of the notification (max 4096 bytes). |
title |
string | No | Notification title (max 250 bytes). |
tags |
string[] | No | Emojis or keywords for categorization (e.g., ["warning", "robot"] ). Max 5. |
priority |
integer | No | Message priority: 1=min, 2=low, 3=default, 4=high, 5=max. |
click |
string | No | URL to open when the notification is clicked. |
actions |
array | No | Action buttons (view, http, broadcast). Max 3. |
attachment |
object | No | URL and name of an attachment. |
email |
string | No | Email address to forward the notification to. |
delay |
string | No | Delay delivery (e.g., 30m , 1h , tomorrow ). |
cache |
string | No | Cache duration (e.g., 10m , 1h , 1d ). |
firebase |
string | No | Firebase Cloud Messaging (FCM) topic to forward to. |
id |
string | No | Unique ID for the message. |
expires |
string | No | Message expiration (e.g., 10m , 1h , 1d ). |
markdown |
boolean | No | Set to true to enable markdown formatting in the message. |
baseUrl |
string | No | Override the default ntfy server URL for this request. |
// Basic notification
{
"topic": "alerts",
"message": "The task has completed successfully."
}
// Advanced notification
{
"topic": "alerts",
"title": "System Alert",
"message": "CPU usage has exceeded 90% for 5 minutes.",
"tags": ["warning", "computer"],
"priority": 4,
"click": "https://server-dashboard.example.com",
"actions": [
{
"id": "view",
"label": "View Details",
"action": "view",
"url": "https://server-dashboard.example.com/cpu"
},
{
"id": "restart",
"label": "Restart Service",
"action": "http",
"url": "https://api.example.com/restart-service",
"method": "POST",
"headers": {
"Authorization": "Bearer token123"
}
}
],
"markdown": true
}
{
"success": true,
"id": "5ZFY362156Sa",
"topic": "ATLAS",
"time": 1743064235,
"expires": 1743496235,
"message": "This is a test message from the README verification process",
"title": "README Testing"
}
ntfy://default
NTFY_DEFAULT_TOPIC
).json
{
"defaultTopic": "ATLAS",
"timestamp": "2025-03-27T08:30:25.619Z",
"requestUri": "ntfy://default",
"requestId": "0da963d0-30e0-4dbc-bb77-4bf2dee14484"
}
ntfy://{topic}
topic
- The name of the ntfy topic.json
{
"topic": "ATLAS",
"timestamp": "2025-03-27T08:30:30.038Z",
"requestUri": "ntfy://ATLAS",
"requestId": "31baf1df-278f-4fdb-860d-019f156a72b0"
}
<use_mcp_tool>
<server_name>ntfy-mcp-server</server_name>
<tool_name>send_ntfy</tool_name>
<arguments>
{
"topic": "updates",
"title": "Task Completed",
"message": "Your requested data analysis has finished",
"tags": ["check"]
}
</arguments>
</use_mcp_tool>
<use_mcp_tool>
<server_name>ntfy-mcp-server</server_name>
<tool_name>send_ntfy</tool_name>
<arguments>
{
"topic": "alerts",
"title": "Critical Error Detected",
"message": "The application has encountered a critical error.\n\n**Error Code**: E123\n\n**Details**: Database connection failed",
"tags": ["warning", "skull"],
"priority": 5,
"actions": [
{
"id": "view",
"label": "View Logs",
"action": "view",
"url": "https://logs.example.com"
},
{
"id": "restart",
"label": "Restart Service",
"action": "http",
"url": "https://api.example.com/restart",
"method": "POST"
}
],
"markdown": true
}
</arguments>
</use_mcp_tool>
npm run build
: Compiles the TypeScript source code to JavaScript in the dist/
directory.npm run clean
: Removes the dist/
directory and cleans the contents of the logs/
directory.npm run rebuild
: Runs clean
and then build
.npm run tree
: Generates a directory tree representation in docs/tree.md
.npm start
: Runs the compiled server from the dist/
directory using Node.js.npm run watch
: Tails the combined log file (logs/combined.log
) for real-time monitoring.Contributions are welcome! Please feel free to submit pull requests or open issues to improve the project.
git checkout -b feature/your-feature
).git commit -m 'Add some feature'
).git push origin feature/your-feature
).This project is licensed under the Apache-2.0 License. See the LICENSE file for details.