tgu-mcp
Provides tools for interacting with an authenticated Telegram account via tgu: listing and reading chats/messages, searching, retrieving profiles and account status, inspecting mini-apps/web views, and performing actions such as sending, replying, deleting, reacting, forwarding, marking read, and downloading media.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tgu-mcp list my unread Telegram chats"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tgu-mcp — MCP-сервер для Telegram-аккаунта через tgu
Один процесс, протокол MCP (stdio), 20 инструментов поверх tgu CLI: чтение чатов и сообщений,
поиск, профили, разведка, миниаппы и web view — всё через уже авторизованный аккаунт.
Инструменты изменения (send, reply, delete, react, …) помечены как destructive —
агент обязан спросить разрешение пользователя.
Установка
Unix / macOS / Termux:
curl -fsSL https://github.com/rival-afk/tgu-mcp/raw/refs/heads/main/install.sh | shWindows (PowerShell):
irm https://github.com/rival-afk/tgu-mcp/raw/refs/heads/main/install.ps1 | iexОба варианта ставят пакет (через pipx, если есть, иначе pip), а при наличии opencode
сами регистрируют MCP-сервер глобально (потом нужно перезапустить OpenCode).
Ручная установка:
pip install git+https://github.com/rival-afk/tgu-mcp.git
# или из исходников: pip install .Нужен установленный и авторизованный tgu (tgu login), Python ≥ 3.11 и пакет mcp ≥ 2.
Related MCP server: Telegram MCP Server
Подключение к OpenCode (V2)
opencode mcp add tgu --global -- tgu-mcp
# или с явным путём:
opencode mcp add tgu --global -- python3 ~/.local/bin/tgu-mcp
opencode mcp list # ✓ tgu connectedДля других MCP-клиентов запускай tgu-mcp как локальный stdio-сервер
(команда python3 tgu_mcp.py из репозитория — тоже работает).
Настройка через окружение:
Переменная | Назначение | По умолчанию |
| путь к бинарнику |
|
| доп. аргументы CLI (например | пусто |
| таймаут одной команды, сек | 120 |
Инструменты
Read-only (можно вызывать свободно):
Инструмент | Args | Что делает |
|
| список чатов JSON, фильтр по имени |
|
| последние сообщения JSON |
|
| только id сообщений |
|
| профиль пользователя/канала/группы |
| — | свой профиль |
| — | авторизация/seccия |
|
| поиск по чатам |
|
| похожие юзеры/боты/каналы |
|
| сводка (id, оценка регистрации, флаги, общие чаты) |
|
| примерная дата регистрации по user_id |
|
| инфа о миниаппе бота |
|
| URL web view с токеном + IP хоста |
|
| t.me-ссылка на чат/сообщение |
Изменяющие состояние (только по явной просьбе пользователя):
Инструмент | Args | Что делает |
|
| отправить сообщение |
|
| ответить на сообщение |
|
| удалить сообщения |
|
| реакция ( |
|
| отметить прочитанным |
|
| переслать сообщения |
|
| скачать медиа (по умолчанию сухой прогон) |
Безопасность
Сервер — тонкий мост к твоему tgu: он не хранит токены и сессии, а запускаетCLI от твоего имени.
tgu webview печатает URL со встроенным tgWebAppData — это временный авторизационный токен
миниаппа; не публикуй его. tgu logout удаляет сессию и на сервере.
Связанные проекты
MIT © rival-afk
Available Tools
20 toolsappBRead-onlyIdempotent
Инфа о миниаппе/вебаппе бота: меню-кнопка, команды, ссылки, app settings.
Inputs: bot (required). Returns: result
chatsBRead-onlyIdempotent
Список чатов: имя, id, тип, непрочитанные, превью последнего сообщения. JSON-массив; name — фильтр по подстроке.
Inputs: name, type, limit, unread_only. Returns: result
deleteBDestructive
Удалить сообщения (у всех по умолчанию; recover=True — только у себя). ids — список id. Действие меняет состояние!
Inputs: ids (required), chat (required), yes, recover. Returns: result
estdateARead-onlyIdempotent
Примерная дата регистрации по user_id (оценка по публичным якорям).
Inputs: user (required). Returns: result
forwardCDestructive
Переслать сообщения в другой чат. to — чат назначения. Действие меняет состояние!
Inputs: to (required), ids (required), chat (required). Returns: result
intelBRead-onlyIdempotent
Сводка по пользователю: id, оценка регистрации, общие чаты, флаги, статус.
Inputs: who (required). Returns: result
linkCRead-onlyIdempotent
t.me-ссылка на чат и/или сообщение.
Inputs: chat (required), id. Returns: result
mark_readBDestructive
Отметить чат прочитанным. up_to — id до которого читать (0 — всё). Действие меняет состояние!
Inputs: chat (required), up_to. Returns: result
meARead-onlyIdempotent
Инфа о себе (аккаунт пользователя).
Inputs: no named parameters. Returns: result
pullBDestructive
Скачать медиа из чата в указанную папку. Только по явной просьбе пользователя.
Inputs: chat (required), dest, last, type, +1 more. Returns: result
reactBDestructive
Поставить/убрать реакцию у сообщения. emoji: эмодзи (по умолчанию 👍); 'clear' — убрать. Действие меняет состояние!
Inputs: id (required), chat (required), big, emoji. Returns: result
readBRead-onlyIdempotent
Прочитать последние сообщения чата. chat: часть имени/@юзер/id/'me'. JSON-массив сообщений.
Inputs: chat (required), last. Returns: result
read_idsBRead-onlyIdempotent
Список id последних сообщений чата (через пробел).
Inputs: chat (required), last. Returns: result
replyBDestructive
Быстрый ответ на сообщение. chat, id — id сообщения, text — ответ. Действие меняет состояние!
Inputs: id (required), chat (required), text (required). Returns: result
searchARead-onlyIdempotent
Поиск сообщений: query — запрос; chat — ограничить чат (иначе глобальный по последним чатам). JSON-массив.
Inputs: query (required), chat, limit. Returns: result
sendCDestructive
Отправить сообщение в чат. chat: имя/@юзер/id/'me'. button: 'Текст|URL' или 'Текст' (список). Действие меняет состояние!
Inputs: chat (required), text (required), plain, button, +2 more. Returns: result
similarBRead-onlyIdempotent
Похожие юзеры/боты/каналы по подстроке имени или юзернейма.
Inputs: query (required), limit. Returns: result
statusCRead-onlyIdempotent
Статус авторизации tgu.
Inputs: no named parameters. Returns: result
userBRead-onlyIdempotent
Инфа о пользователе/канале/группе по имени, @юзеру, id или ссылке t.me.
Inputs: who (required). Returns: result
webviewCRead-onlyIdempotent
Открыть web view бота: полный URL с токеном, хост и его IP (A/AAAA). platform: android|ios|web.
Inputs: bot (required), compact, platform, fullscreen, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools have recognizable distinct purposes, but several clusters overlap: read vs read_ids, and user/me/similar/intel/estdate all revolve around user lookup with fuzzy boundaries. Descriptions help, but an agent could still misselect within those clusters.
Most names are single lowercase words, but the set mixes nouns (chats, user, app) with verbs (send, reply, delete) and includes inconsistent snake_case/concatenated forms (read_ids, mark_read, estdate). It remains readable but lacks a predictable pattern.
At 20 tools this is on the heavy side for a Telegram client surface. Core actions earn their place, but niche extras like estdate, intel, app, and webview add bulk and increase selection burden.
Core messaging flows are covered (list/read/search/send/reply/delete/forward/react/mark_read), plus auth and media pulling. However, obvious gaps remain: no message editing, no sending media/files, and limited chat lifecycle operations such as join/leave/create or member management.
Maintenance
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Hosted Telegram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceDrives a personal Telegram account from the terminal or via MCP, enabling AI assistants to list chats, send/edit messages, fetch history, manage groups, and more with tiered read/write/destructive permissions.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to drive a real Telegram account, exposing chats, messages, media, secret chats, admin rights, invite links, Mini Apps, and multi-account routing as callable tools.32GPL 3.0
- AlicenseBqualityAmaintenanceConnects an agent to your personal Telegram account over MTProto, exposing 69 tools to read, send, search and manage messages, chats, media, contacts and admin actions without a bot token. Runs locally on stdio with in-chat login and no inbound port or cloud relay.690MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible clients such as Claude and Cursor to access and manage Telegram accounts, chats, messages, contacts, media, folders, and admin operations through exposed tools.Apache 2.0