Telegram AI CLI

•

Empower AI agents to safely read and act on a personal Telegram account using MTProto with explicit plan-and-apply approval.

This tool provides a command-line interface (CLI) and Model Context Protocol (MCP) server for AI agents to interact with personal Telegram accounts via MTProto. It's designed for users who want AI agents to assist with tasks like triaging messages, drafting replies, or monitoring chats, but with a crucial safety net: any action that modifies Telegram (such as sending messages, joining chats, or promoting admins) requires explicit 'plan-and-apply' approval. This mechanism ensures controlled automation by preventing agents from making unsolicited changes, while offering a wide range of read functionalities. The project also addresses common MTProto challenges, such as unstable usernames and flood limits, providing a more robust and secure experience than raw MTProto wrappers.

Key Features

01Provide comprehensive CLI tools for reading chat history, searching messages, and managing account sessions.
02Handle MTProto specific challenges robustly, such as resolving usernames, managing flood limits, and session revocation.
030 GitHub stars
04Implement plan-and-apply approval for all write operations, ensuring human oversight for agent actions.
05Offer a local SQLite archive for offline chat searching, including powerful regular expression capabilities.
06Feature configurable safety profiles, including explicit direct message allowlisting and hard-coded denials for sensitive chats like login code notifications.

Use Cases

01Creating local, searchable archives of personal Telegram conversations for offline access and analysis.
02Enabling AI agents to triage incoming Telegram messages and draft replies for personal accounts.
03Automating the monitoring of specific Telegram chats for keywords, events, or unread messages.