nt

ntfy-mcp

The MCP server that keeps you informed by sending the notification on phone using ntfy

Publisherntfy-mcp
Submitted date4/13/2025

Level Up Your LLM Workflow: Introducing ntfy-mcp for Real-Time Task Completion Notifications

Tired of constantly checking on your LLM's progress? ntfy-mcp is a Model Context Protocol (MCP) server designed to provide seamless, real-time notifications via ntfy when your AI-powered tasks are complete. Imagine a world where you can kick back, relax, and receive a notification the moment your code generation, data analysis, or creative writing is finished. ntfy-mcp makes that a reality.

MCP Server Badge

Expert Guide: Setting Up ntfy-mcp for Optimal Productivity

This guide provides a comprehensive walkthrough of setting up and configuring ntfy-mcp to maximize your workflow efficiency.

Prerequisites

  • Node.js and npm: Ensure you have Node.js and npm (Node Package Manager) installed on your system. A recent version (v18 or higher) is recommended for optimal performance and compatibility.
  • ntfy App: Download and install the ntfy app on your smartphone or preferred device. This is essential for receiving the task completion notifications.
  • ntfy Topic: Choose a unique topic name for your ntfy notifications. This will be used to subscribe to the notifications from your ntfy-mcp server.

Installation and Configuration

  1. Clone the Repository:

    git clone https://github.com/teddyzxcv/ntfy-mcp.git cd ntfy-mcp
  2. Install Dependencies:

    npm install

    This command installs all the necessary packages, including the Model Context Protocol SDK, node-fetch, dotenv, and zod.

  3. Build the Project:

    npm run build

    This command compiles the TypeScript code into JavaScript, creating the production-ready application.

  4. Configuration Options:

    You have two primary methods for starting and configuring ntfy-mcp: manual start and Cline configuration.

    • Manual Start:

      This method involves directly running the compiled JavaScript file with the necessary environment variables.

      NTFY_TOPIC=<your_ntfy_topic> npm start

      Replace <your_ntfy_topic> with the actual topic name you chose for your ntfy notifications. You can also set the NTFY_TOPIC environment variable in your shell's configuration file (e.g., .bashrc, .zshrc).

    • Cline Configuration (Recommended):

      This method integrates ntfy-mcp directly into your Cline environment, providing a more streamlined and automated experience. Add the following configuration block to your Cline configuration file:

      "ntfy-mcp": { "command": "node", "args": [ "/path/to/ntfy-mcp/build/index.js" ], "env": { "NTFY_TOPIC": "<your_ntfy_topic>" }, "autoApprove": [ "notify_user" // Highly recommended for seamless operation ] }
      • Replace /path/to/ntfy-mcp/build/index.js with the actual path to the compiled index.js file.
      • Replace <your_ntfy_topic> with your chosen ntfy topic name.
      • The autoApprove array allows you to automatically approve the notify_user function call from the LLM, eliminating the need for manual confirmation and ensuring a smooth workflow.
  5. Subscribe to Your ntfy Topic:

    Open the ntfy app on your device and subscribe to the topic you specified in the configuration.

Integrating with Your LLM Workflow

To trigger notifications, you need to instruct your LLM to use the notify_user function provided by ntfy-mcp. The key is to include a clear and explicit instruction in your prompt.

Example Prompt:

Write a Python script to calculate the Fibonacci sequence up to 1000, and notify me when the task is done.

Important Considerations:

  • Prompt Engineering: The LLM's ability to correctly invoke the notify_user function depends heavily on the clarity and precision of your prompt. Experiment with different phrasing to find what works best for your specific LLM.
  • Custom Instructions (Limitations): While custom instructions can be helpful, they may not always guarantee consistent function calls. Explicitly including the notification request in each prompt is generally more reliable.
  • Function Name: The function name is notify_user.

Advanced Configuration and Troubleshooting

  • Environment Variables: Beyond NTFY_TOPIC, you can configure other aspects of ntfy-mcp using environment variables. Refer to the project's documentation for a complete list of available options.
  • Logging: Enable detailed logging to help diagnose any issues. You can typically configure logging levels through environment variables or command-line arguments.
  • Firewall: Ensure that your firewall allows communication between your LLM environment and the ntfy-mcp server.
  • HTTPS: For enhanced security, consider configuring ntfy-mcp to use HTTPS. This requires obtaining an SSL certificate and configuring your server accordingly.

Dependencies: The Foundation of Functionality

  • @modelcontextprotocol/sdk: Provides the necessary tools and interfaces for interacting with the Model Context Protocol.
  • node-fetch: A lightweight module for making HTTP requests, used to send notifications to the ntfy server.
  • dotenv: Loads environment variables from a .env file, simplifying configuration management.
  • zod: A TypeScript-first schema validation library, ensuring data integrity and preventing unexpected errors.

By following this expert guide, you can seamlessly integrate ntfy-mcp into your LLM workflow, receiving real-time notifications and significantly boosting your productivity. Now, go forth and build amazing things!

Visit More

View All