Telegram Notifier MCP Server

Telegram Notifier MCP Server

Enables AI agents to send notifications and media (text, photos, documents, videos) via a Telegram bot.

Category
访问服务器

README

Telegram Notifier MCP Server

npm version License: WTFPL Node.js Version TypeScript ESLint MCP Telegram Bot API pnpm npm downloads

A Model Context Protocol (MCP) server that enables AI agents to send messages via Telegram bot. Perfect for notifications, alerts, and real-time communication from your AI applications.

Features

  • 📱 Send messages to Telegram channels/chats via bot
  • 🎨 Support for multiple formatting modes (Markdown, MarkdownV2, HTML)
  • 📷 Send photos/images (local files, HTTP URLs)
  • 📁 Send documents/files with custom filenames
  • 🎬 Send videos with caption support
  • 🏷️ Caption support for all media with full formatting
  • 🛡️ Robust error handling with detailed Telegram API responses
  • 🏗️ Clean service architecture for maintainable code

Quick Start

1. Create a Telegram Bot

  1. Message @BotFather on Telegram
  2. Use /newbot command and follow instructions
  3. Save the bot token (looks like 123456789:ABCdefGHIjklMNOpqrsTUVwxyz)

2. Get Chat ID

For personal messages:

  1. Message your bot first
  2. Visit: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
  3. Find the chat.id value

For channels:

  1. Add your bot to the channel as admin
  2. Send a message to the channel
  3. Visit the same URL and find the chat.id (negative number for channels)

3. Install and Configure

# Install the package
npm install -g @harnyk/telegram-notifier-mcp

# Or clone and build locally
git clone <repository-url>
cd mcp-telegram-notifier
pnpm install
pnpm build
pnpm link

4. Add to Your MCP Client

Add to your MCP client configuration (e.g., Claude Desktop):

{
  "mcpServers": {
    "telegram-notifier": {
      "command": "telegram-notifier",
      "env": {
        "TELEGRAM_BOT_TOKEN": "your_bot_token_here",
        "TELEGRAM_CHAT_ID": "your_chat_id_here"
      }
    }
  }
}

Or using npx:

{
  "mcpServers": {
    "telegram-notifier": {
      "command": "npx",
      "args": ["-y", "@harnyk/telegram-notifier-mcp"],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your_bot_token_here", 
        "TELEGRAM_CHAT_ID": "your_chat_id_here"
      }
    }
  }
}

Available Tools

Once configured, your AI agent will have access to these MCP tools:

📝 send_markdown_message_as_telegram_bot

Send formatted text messages to Telegram

  • messageText: Text content with Markdown/HTML formatting
  • parseMode: Markdown, MarkdownV2, or HTML (default: MarkdownV2)

📷 send_telegram_photo

Send photos/images to Telegram

  • photo: Local file path or HTTP URL to image
  • caption: Optional image caption with formatting
  • parseMode: Caption formatting mode

📁 send_telegram_document

Send documents/files to Telegram

  • document: Local file path or HTTP URL to document
  • caption: Optional document caption with formatting
  • filename: Custom filename override
  • parseMode: Caption formatting mode

🎬 send_telegram_video

Send videos to Telegram

  • video: Local file path or HTTP URL to video
  • caption: Optional video caption with formatting
  • filename: Custom filename override
  • parseMode: Caption formatting mode

Use Cases

  • 📊 Monitoring: Get alerts when system metrics exceed thresholds
  • 🚀 Deployments: Notifications when CI/CD pipelines complete
  • 📈 Analytics: Daily/weekly reports with charts and data files
  • 🔍 Error Tracking: Instant notifications with error screenshots
  • 📅 Scheduling: Reminders with attached documents
  • 💬 Customer Support: Forward important messages with media

Development

# Install dependencies
pnpm install

# Run in development mode
pnpm dev

# Build for production
pnpm build

# Run linting
pnpm lint

# Run type checking  
pnpm typecheck

Configuration Examples

Claude Desktop

{
  "mcpServers": {
    "telegram-notifier": {
      "command": "telegram-notifier",
      "env": {
        "TELEGRAM_BOT_TOKEN": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
        "TELEGRAM_CHAT_ID": "-1001234567890"
      }
    }
  }
}

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if needed
  5. Run pnpm lint and pnpm typecheck
  6. Submit a pull request

License

WTFPL - Do What the Fuck You Want to Public License

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选