ntfy-mcp-server
Version:
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.
34 lines (33 loc) • 1.73 kB
TypeScript
/**
* Ntfy service for subscribing to and publishing messages to ntfy topics
*
* This module provides functionality to:
* 1. Subscribe to ntfy topics to receive notifications
* 2. Publish messages to ntfy topics
* 3. Utility functions for working with ntfy
*/
import { NtfySubscriber } from './subscriber.js';
import { NtfySubscriptionHandlers, NtfySubscriptionOptions } from './types.js';
import { publish, NtfyPublishOptions, NtfyPublishResponse } from './publisher.js';
import { buildSubscriptionUrl, buildSubscriptionUrlSync, createBasicAuthHeader, createBasicAuthHeaderSync, isValidTopic, validateTopicSync } from './utils.js';
import { DEFAULT_NTFY_BASE_URL, DEFAULT_SUBSCRIPTION_OPTIONS, DEFAULT_REQUEST_TIMEOUT } from './constants.js';
export * from './types.js';
export * from './errors.js';
export { NtfySubscriber };
export { publish, NtfyPublishOptions, NtfyPublishResponse };
export { buildSubscriptionUrl, buildSubscriptionUrlSync, createBasicAuthHeader, createBasicAuthHeaderSync, isValidTopic, validateTopicSync };
export { DEFAULT_NTFY_BASE_URL, DEFAULT_SUBSCRIPTION_OPTIONS, DEFAULT_REQUEST_TIMEOUT };
/**
* Create a new ntfy subscriber with the given handlers
* @param handlers Event handlers for the subscription
* @returns A new NtfySubscriber instance
*/
export declare function createSubscriber(handlers?: NtfySubscriptionHandlers): NtfySubscriber;
/**
* Subscribe to a ntfy topic
* @param topic Topic to subscribe to
* @param handlers Event handlers for the subscription
* @param options Subscription options
* @returns A function to unsubscribe
*/
export declare function subscribe(topic: string, handlers: NtfySubscriptionHandlers, options?: NtfySubscriptionOptions): Promise<() => void>;