Skip to main content
Glama
telegram-mcp

telegram-mcp

by ZeroMemory

Telegram Organizer

Organize Telegram folders and categories through the bundled MCP server, and export your own messages from accessible groups and public spaces into searchable local reports. Scan broadcast channels for your selected reactions and resume from SQLite checkpoints.

The bundled telegram-mcp/ adapts chigwell/telegram-mcp. It provides folder/category operations, client settings, proxy support and an explicit read-only tool selection.

Install

Requires Windows and Python 3.12.

python -m venv .venv
.\.venv\Scripts\python -m pip install -r requirements-lock.txt
.\.venv\Scripts\python -m pip install --no-deps ./telegram-mcp

Related MCP server: tgread

Use with an agent

Connect the bundled server to your MCP client using the server setup. Configure your Telegram credentials and session once; the client then exposes the server's tools to the agent. For example, ask:

Show my Telegram folders and suggest a clearer grouping for them.

Use TELEGRAM_EXPOSED_TOOLS=read-only for inspection. Folder and category changes require TELEGRAM_EXPOSED_TOOLS=all, which exposes all tools and is the server default. Use the commands below for CLI exports.

Export your account

Copy export.env.example to .env. Set your API ID, API hash and authorized StringSession. Group and public exports read TELEGRAM_SESSION_STRING_SECOND. The reaction scanner reads TELEGRAM_SESSION_STRING.

.\.venv\Scripts\python audit/export_second_group_messages.py --env-file .env --output-stem audit/second-account-group-messages
.\.venv\Scripts\python audit/export_second_public_messages.py --env-file .env --output-stem audit/second-account-public-messages
.\.venv\Scripts\python audit/scan_first_account_reactions.py --env-file .env --account-id 123456789 --workers 1

Replace 123456789 with your Telegram user ID. The scanner uses an account-specific checkpoint. It can also read the account ID from an existing my-telegram-group-messages-stats.json.

To resume a reaction scan, repeat the command with the same SQLite file. Incomplete channels resume from the last offset and completed channels are skipped. Reports include channel status. JSONL preserves original text. CSV escapes spreadsheet formulas.

Transport defaults to direct. Proxy options include mtproxy, socks5, socks4 and http. To use an existing TG WS Proxy adapter, select tg-ws-proxy and set TELEGRAM_PROXY_CONFIG explicitly.

Generate HTML from your exports

.\.venv\Scripts\python audit/generate_second_group_messages_html.py --input audit/second-account-group-messages.jsonl --output groups.html
.\.venv\Scripts\python audit/generate_second_public_messages_html.py --input audit/second-account-public-messages.csv --output public.html

Each generator updates its default report in audit/. Use --output for a new destination and add --overwrite to replace an existing report.

For saved first-account exports, use audit/generate_telegram_messages_html.py with --input and --comments pointing to your CSV files. Open the reports in a browser to search messages, filter by group, space or type, and follow Telegram links. Groups with the same name remain separate by ID. Open t.me/c links with an account that belongs to the group.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to read, send, and organize Telegram messages and chats. Supports tools for listing chats, fetching messages, sending/reply, archiving, muting, and folder management.
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables reading Telegram channels, groups, and direct messages through an MCP interface, with enforced read-only access so the agent cannot write to them.
      15
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to manage Telegram chats, messages, contacts, users, groups, and channels via 50+ MCP tools, with a reactive inbox and per-topic proxy isolation for multi-agent setups.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to interact with a personal Telegram account via MCP, offering tools for reading and searching chats, summarizing unread messages, sending and editing messages, handling files and voice transcripts, and managing groups and channels, with read-only mode by default.
      Apache 2.0