mcp-telegram-poc

mcp-telegram-poc

0

This project is a Python-based application that implements both a Model Context Protocol client and server to facilitate seamless interactions between LLMs and Telegram. It allows for sending notifications via Telegram and checking for user replies, focusing on modularity and integration with various LLM applications.

MCP Integration example with Telegram

A Python-based Model Context Protocol (MCP) client and server enabling LLMs to send notifications via Telegram and receive user responses.

Features

  • Send text alerts to a Telegram chat with customizable urgency levels
  • Check for user replies with configurable timeouts
  • Flexible template for integration with MCP-compatible LLM applications

MCP vs Function Calls or Agent tools

  • MCP Protocol: Separates the LLM’s reasoning from the execution of external actions, allowing for safer and more controlled execution.
  • LLM Function Call or Agent: Direct function calls or agent-based methods mix decision-making and execution logic, making maintenance harder.

Prerequisites

  • Python 3.11+
  • A Telegram bot token
  • Your Telegram chat ID

Installation

  1. Clone the repository
  2. Install dependencies
  3. Create the virtual environment
  4. Configure your environment with Telegram credentials

Usage

  • Run standalone
  • Programmatic usage for alerts
  • Agent integration with autogen framework
  • Local testing

Available Tools

  • send_alert: Sends a Telegram alert and waits for a reply.
  • check_reply: Polls for replies to a specific message.