Repository navigation
Releases: zai-one/telegram-mcp
Release list
Telegram MCP 0.6.0
- Upgrade note:
TELEGRAM_TOOLSETS=allnow also enables the new opt-in toolsets exceptaccount_adminandadvanced_read, and an existinggroups_admin(orall) gainsremove_user,delete_forum_topicand the invite-link writes. Read-only mode and the chat ACL still apply; list toolsets explicitly if you relied on the previous set. - Optional lazy tool loading (
TELEGRAM_TOOL_LOADING=eager|lazy, defaulteager= unchanged): lazy lists a small core plustelegram_enable_toolsets(toolsets with one-line description and token cost); enabling makes the already-registered tools visible to that MCP session and sendsnotifications/tools/list_changed. Allowlists, read-only mode and approval gates still apply. Setup wizard asks eager vs lazy. Startup tokens (tools/list + instructions, ≈chars/4): eager ≈3558, lazy ≈1817. Handshake-era clients seetools.listChanged=true; hot account activation keeps not-yet-enabled tools hidden. Scope: enablement is per MCP session (FastMCP session visibility) for handshake-era clients (initialize), so one client's enabled toolsets never appear for another. Sessionless clients (2026-07-28server/discover) and the stateless HTTP transport get a new session per request, so enablement does not persist there: useeagerorTELEGRAM_TOOLSETS. README lazy section lists verifiedtools/list_changedclient support with sources. - Opt-in toolset
event_feed:telegram_poll_events— live feed of new / edited / deleted messages from TelethonNewMessage/MessageEdited/MessageDeletedhandlers, one bounded in-memory ring per account (2000 events), client-held cursor bound to the account,wait_seconds0–55,chat_ids/kindsfilters,gap=trueon restart or overflow. Chat ACL applied per event; deletions without a chat (private chats, basic groups) are hidden while an ACL is set. Event text is never persisted (ids/dates only, see below). Guidetelegram://guide/events. - Opt-in toolset
account_admin(stdio,telegram:writescope):telegram_add_account— QR login in chat (no phone/code/2FA password through the chat; 2FA → local wizard). WritesTELEGRAM_SESSION_STRING_<LABEL>atomically to the private secret file, never overwrites, grants the label inTELEGRAM_BINDINGS_FILE; hot-activated (see below), restart only when the result saysrestart_required=true. - Competitor parity without re-pinning the vendor (
zai_telegram/native.py): reads viatelegram_read—get_message_by_link,export_unread_messages,get_send_as,get_member_admin_status,transcribe_voice, plus vendorexport_contacts; writes viatelegram_write(ledger, categories, ACL) —vote_poll,remove_user,edit_forum_topic,delete_forum_topic,rename_folder, plus vendorget_invite_link/export_chat_invite(categorygroups_admin). zai-telegram-mcp-setup --add-account LABEL [--qr] [--principal P] --directory DIR: log in one more account (phone code or QR, 2FA password via hidden prompt) into the existing secret and bindings files.- Hot activation: an account added in chat joins the loaded runtime without restart (
restart_required=false; a single-account server becomes multi-account on the fly). Restart is still needed for the labeldefaultor if activation fails (only a pure addition ofTELEGRAM_SESSION_STRING_<LABEL>is accepted; any other secret change still needs a restart). Fixes the running server refusing calls after the secret file gained a new session. - Event feed survives restarts: epoch, sequence and event ids (never text) persist for 24 h in the state DB; old cursors stay valid and only the downtime is reported as
gap_window.TELEGRAM_FEED_PERSIST=0disables. - Vendor backports from chigwell/telegram-mcp after v3.2.0 (
vendor/patches/zai-backports-2026-10.patch, recorded in the manifest): serialized reconnects per client (2980601), no interactivestart()on reconnect plus 30 s reconnect timeout (dd71a12),list_messagessearch starting atto_date(312cd00), customcustom:<id>and empty reactions (7fc6b4a). - Live reload: the server watches its secret and bindings files; a pure session addition is hot-added, new grants apply on the next call, the redaction set refreshes, and when the server becomes multi-account every tool gains
accountandtelegram_list_accountsappears (MCPtools/list_changed).account_adminexposesaccountfrom the start. Invalid bindings keep the previous grants. - Event feed: downtime backfill (messages sent while the server was down become
newevents withbackfilled=true, bounded 100 dialogs / 500 messages,TELEGRAM_FEED_BACKFILL=0); quiet accounts keepalive_atfresh. - Vendor backport d5ddc8c:
get_participantspaginates without the non-existent Telethonoffsetargument (every call failed before). - Owner follow-up:
get_message_by_linknow works under a chat ACL — the chat named in the link is checked (unparsable links are denied);t.me/s/<name>/<id>links;transcribe_voice(wait_seconds 0–30)waits for the final text (updateTranscribedAudio);rename_folderalso renames imported shared folders. Native tools reconnect like vendor tools;remove_userrefuses self;vote_pollrejects closed polls and repeated options. - Critic fixes: newly saved sessions are redacted even when activation fails; abandoned QR logins are disconnected after 10 min; in-chat grants work without a bindings file path (reported as
binding_saved=false). - Review fixes: in-chat QR login keeps Telethon's wait running between
statuscalls, so a scan made beforestatusis no longer lost; the new label is saved to the bindings file even after the embedded runtime clearedTELEGRAM_*variables;telegram_add_accountis never registered on HTTP;TELEGRAM_FEED_BACKFILL=0is honoured;telegram_poll_eventsno longer blocks the event loop when the ring lost events behind the cursor, and refuses to run (chat_access_denied) whileTELEGRAM_DENIED_CHATSnames a chat by@username(feed events carry numeric ids only);delete_forum_topicrepeats until the whole topic is deleted (partially_deletedafter 50 batches). - Skeptic review fixes (Security/Fix):
telegram_add_accountnow requiresTELEGRAM_WRITE_ENABLEDand an enabled provider (checked before the QR login and again before saving) and is removed by read-only mode even when named inTELEGRAM_TOOLS; session + binding updates (in chat and--add-account) run under one cross-process file lock with the label re-checked inside it, so concurrent adders never lose a session or grant;telegram_poll_eventsis admitted like every read (provider switch, cooldown, rate limit, concurrency lease held during the wait); ring overflow during a long-poll wait is reported asgap=true; downtime backfill reportsbackfill_complete=falsewhen more than 100 dialogs changed;export_unread_messagesreturns the unread incoming messages above the read marker (later outgoing messages no longer displace them) and flagstruncated. - Router: same lines, now also routing live feed and add-account; default/all always-loaded context stays at or below 0.5.0 (enforced by
scripts/token_budget.py). Router eval: 34 cases, optional upstream-tool check.
Source: d93a70f · Changes: v0.5.0...v0.6.0
Telegram MCP 0.5.0
- License: LicenseRef-ZAI-ONE 2.0 (source-available). Free install and use for yourself and your organisation, including commercial work; issues and pull requests welcome; copying code into other projects, redistribution, embedding and competing hosted services need written permission. Earlier releases keep their LicenseRef-ZAI-ONE 1.0 terms (see NOTICE). README first screen: one-line scope, why this MCP, maintenance and update check.
- Toolsets (
TELEGRAM_TOOLSETS,TELEGRAM_TOOLS,TELEGRAM_DISABLED_TOOLS,--toolsets), read-only mode (TELEGRAM_READ_ONLY,--read-only) and write categories fortelegram_write. Unset = previous surface. - Per-chat ACL:
TELEGRAM_ALLOWED_CHATS(deny-by-default when set) andTELEGRAM_DENIED_CHATS; listings are filtered. - Compact tool descriptions and titles; router
instructionsas intent → first tool → skill/guide, with a fallback totelegram://playbook; error envelopes gainhintanddocs; new codeschat_access_denied,tool_disabled. - Resources
telegram://toolsets,telegram://playbook,telegram://guide/{topic}; promptsinbox_digest,publish_post,chat_research. - Self-contained skills (
skills/, includingtelegram-channel-reportandtelegram-watch-replies), Claude Code plugin + marketplace (.claude-plugin/),server.json,scripts/token_budget.py(CI via tests). - Compact replies:
TELEGRAM_RESPONSE_DETAIL=summary(+TELEGRAM_MAX_TEXT_CHARS) drops empty fields and truncates long texts with explicit markers; defaultfullis unchanged. - New read tools (toolset
chat_insights):telegram_list_topics,telegram_get_admins,telegram_get_chat_stats(vendor patch over Telethonget_stats→stats.getBroadcastStats/stats.getMegagroupStats). - Opt-in toolset
advanced_read: generictelegram_read(tool, arguments)over 43 reviewed read-only Telethon tools (participants, pinned, reactions, read-by, message links/context, folders, drafts, contacts, profiles, admin log...). Never part ofall. Guidetelegram://guide/advanced-read. - Multi-account with labels: list-valued bindings (
{"actor": ["default", "work"]}, first = default) add an optional per-callaccountargument to every tool andtelegram_list_accounts; rate limits, poll cursors and outbox idempotency are per account, andtelegram_outbox_statusrecords carryaccount_label. String bindings keep the previous schema byte-for-byte. telegram_wait_for_new_message(toolsetevents): bounded long-poll (1–55 s) over 1–10 chats with a local baseline, paced reads andstatus=timeout; respects the chat ACL; no read receipts.telegram_wait_for_settled_message(toolsetevents): poll-based debounce — waits until watched chats go quiet forsettle_seconds(1–30, default 6) after new messages;status=settled,partialwith pending messages, ortimeout. Same ACL and read pacing astelegram_wait_for_new_message.- One-minute install:
uvx --from git+https://github.com/zai-one/telegram-mcp@v0.5.0 zai-telegram-mcp-setup; the wizard writes auvxclient entry pinned to the installed release tag when run from uvx (ZAI_TELEGRAM_UVX_FROMoverrides the source). The Claude Code plugin and README snippets pin the same tag. - Router eval (
tests/eval/router_cases.json, 26 colloquial EN/RU requests) checks router → skill/guide → first tool, and fails if any tool, skill or guide is unreachable from the router. Token budget now also caps the always-loaded context (instructions + tools/list + skill frontmatters, ≈3.9k tokens default). - Vendor fixes: GIF search uses the @gif inline bot (Telethon has no
messages.SearchGifsRequest);import_contactsusestypes.InputPhoneContact. - Security: under
TELEGRAM_ALLOWED_CHATSthe generictelegram_writefails closed — a call must name an allowed chat (or, without a chat, an alloweduser_id/channel), and account-wide or chat-creating writes (join by link, create group/channel, profile, privacy, folders, contacts import) are denied. Under any chat ACLtelegram_readneeds a named chat/user: account-wide reads (contacts, drafts, global search, folders) and chat-listing reads (get_common_chats,get_contact_chats) are denied. - Fix:
telegram_wait_for_settled_messageno longer acknowledges already-watched chats when a new chat joins the wait, so their unread messages are returned instead of dropped; its settle loop is paced liketelegram_wait_for_new_message(~24 reads/min).
Source: 5bc45ce · Changes: v0.4.0...v0.5.0
Telegram MCP 0.4.0
- Telethon 1.44.0 → 1.45.0 (MTProto layer 227 → 229), backward-compatible:
types.User,types.Channel,types.ChatAdminRightsandtypes.ChatBannedRightsonly gained optional trailing keyword arguments. - MCP tool annotations (
readOnlyHint,destructiveHint,idempotentHint,openWorldHint) on every tool, matching thetelegram:read/telegram:writesplit. Hints only; scopes, bindings and the write allowlist still enforce access. telegram_check_update: read-only, suggest-only check of the latest GitHub release with release notes link and update command (3 s timeout, 24 h cache, offline result). A cached newer release adds a one-line startup hint; a stale cache is refreshed on a background thread. Opt out withTELEGRAM_MCP_DISABLE_UPDATE_CHECK=1.- The update check goes through the same registrar as the Telegram tools (stdio local scopes, account binding, audit, per-account quota). Only plain version tags (
v1.2.3) and this repository's release URLs are reported; failed requests back off for 30 minutes andforce=trueis honoured at most once a minute. - The clean-install gate disables the update check and blocks external DNS in its server process.
English setup · Описание по-русски
Download the wheel or source archive below and verify SHA256SUMS. The installed setup
command generates local JSON/TOML client configuration; a source checkout is optional.
Your own provider credentials and API permissions remain required.
Verified on Python 3.12, 3.13 and 3.14 on Linux and Windows: existing contracts,
synthetic functional tests, clean wheel installation and real MCP stdio checks.
Live provider accounts and production deployment were outside this release verification.
GitHub verification · Source commit 095cd179757e4ac18ea3fec244d2313488ea5e25.
ZAI.ONE is a digital agency for websites, SEO, advertising and analytics.
ZAI.ONE — интернет-агентство: сайты, SEO, реклама и аналитика.
Contact / Написать в Telegram about setup and integration.
LicenseRef-ZAI-ONE permits installation and internal use on your own or authorized
accounts; it is not an open-source license. Third-party rights remain unchanged.
Stars are welcome. Request changes through Issues.
Telegram MCP 0.3.0
- Operator-owned media folders, bounded files/albums/voice notes and exclusive bounded downloads to a separate folder; existing account, write policy and durable outbox retained.
- Explicit numeric destination checks for media and polling, with no caller-controlled roots.
- Poll selected chats after acknowledged message IDs; first poll proposes a current baseline. Durable actor/account-bound batches, atomic acknowledgment and safe replay across restart.
- Installable setup wizard and JSON/TOML client snippets that work outside the checkout.
- English and Russian agency information, integration contact and package installation guide.
English setup · Описание по-русски
Download the wheel or source archive below and verify SHA256SUMS. The installed setup
command generates local JSON/TOML client configuration; a source checkout is optional.
Your own provider credentials and API permissions remain required.
Verified on Python 3.12, 3.13 and 3.14 on Linux and Windows: existing contracts,
synthetic functional tests, clean wheel installation and real MCP stdio checks.
Live provider accounts and production deployment were outside this release verification.
GitHub verification · Source commit 00bc8b09f20f075cce01e33f84a27d690b05f7bb.
ZAI.ONE is a digital agency for websites, SEO, advertising and analytics.
ZAI.ONE — интернет-агентство: сайты, SEO, реклама и аналитика.
Contact / Написать в Telegram about setup and integration.
LicenseRef-ZAI-ONE permits installation and internal use on your own or authorized
accounts; it is not an open-source license. Third-party rights remain unchanged.
Stars are welcome. Request changes through Issues.
Telegram MCP 0.2.0
Install Telegram MCP on your own computer or server and connect an MCP client.
- Quick start and installation guide.
- Changes in 0.2.0.
- Python 3.12, 3.13 and 3.14 verified on Linux and Windows. Clean wheel installation, real stdio discovery and source-distribution builds passed using synthetic fixtures.
- Provider credentials and API access remain required. Live provider validation is an operator step.
- Proprietary LicenseRef-ZAI-ONE: install and use for your own or authorized accounts. Separately identified third-party licenses remain unchanged. Stars welcome; request improvements through Issues.
Download the wheel or source archive below; verify it against SHA256SUMS.
Exact source commit: 416a1021eb50681a0a9573b1fc80869984cb8be8. Verification run.