telegram-mcp connects Telegram to Claude and Cursor via Model Context Protocol
Open-source Python server exposes 80+ Telegram operations — chats, messages, contacts, media — as MCP tools for AI assistants.
The telegram-mcp repository publishes a Model Context Protocol server that lets MCP-compatible clients such as Claude and Cursor operate a real Telegram account through Telethon. The project, maintained under the Apache-2.0 license, has gathered 2,042 stars and 511 forks on GitHub as of its last update on 2026-11-14.
What telegram-mcp exposes to MCP clients
The server surfaces more than 80 tools grouped into four domains. Account tools list configured accounts and route calls by label. Chat and group tools cover listing chats, inspecting metadata, creating groups and channels, upgrading basic groups to supergroups, joining or leaving chats, inviting or removing users, managing admins, bans, default permissions, slow mode, forum topics and their allowed icons, invite links, common chats, read receipts, and message links. Message tools handle sending, scheduling, editing, deleting, forwarding, pinning, marking read, replying, searching, inspecting context, creating polls, managing reactions, inspecting inline buttons, pressing inline callbacks, and exporting complete chat history or unread messages to structured JSON. Contact tools provide listing, searching, adding, deleting, blocking, unblocking, importing, exporting, looking up a phone number without adding a contact, inspecting direct chats, finding recent contact interactions, and remembering contacts by the names you actually use.
Rich formatting and Premium requirements
send_message, reply_to_message, and edit_message support classic formatting (parse_mode='md' or 'html') and server-side rich formatting (parse_mode='rich', 'rich_markdown', 'rich_html') which enables full Markdown or HTML with tables, headings, formulas, and collapsible sections. Rich modes require Telegram Premium on the account; the server re-checks Premium on every call and returns a structured telegram_premium_required result when it is absent so the agent can reformat with classic modes and retry. The same tools accept format_date to render a date as a tappable chip. edit_message reports an edit that changes nothing as not modified instead of an error. edit_message_media replaces the attachment for a single message ID; for an album it edits only that item and Telegram enforces media-type restrictions. Omitting caption preserves the existing caption and formatting; an empty caption clears it.
Phone lookups with local rate limits
resolve_phone(phone) finds the Telegram user behind an E.164 number without adding them to contacts. The number must include a leading + and country code (7–15 digits total); spaces, dashes, dots, and parentheses are ignored. Local forms such as 8 999 000-11-22 are rejected before Telegram is called. Telegram only answers when the owner's privacy settings allow lookup by number. With several accounts configured, the account parameter is required because each lookup spends that account's quota. On a FloodWait the tool returns the wait and does not retry; Telethon's per-request sleep threshold is set to 0 for the duration of the lookup.
Optional environment variables cap lookups locally: TELEGRAM_RESOLVE_PHONE_MAX_PER_DAY (rolling 24-hour limit), TELEGRAM_RESOLVE_PHONE_MIN_INTERVAL_SECONDS (minimum gap between lookups), and TELEGRAM_RESOLVE_PHONE_STATE_FILE (persist timestamps across restarts). Without a state file the count lives in memory and resets on restart. The state file holds only timestamps, is written atomically, and a neighbouring .lock file serialises access across server processes.
Remembered contacts and fuzzy matching
set_contact_alias teaches the server what you call someone; every tool that takes a chat_id then understands that wording — send_message("андрей бекендер", ...) just works. A contact can carry any number of aliases, which is how tags work: save both андрей бекендер and бекендер for the same person and either resolves. Only an exact saved wording ever sends. Similar wording is matched to suggest: the tool sends nothing and asks you to confirm the contact by name. Confirming saves that wording as its own alias, so each new phrasing costs one yes/no the first time and nothing ever after. Set TELEGRAM_CONTACT_FUZZY=0 to disable suggestions entirely.
Running the server with Docker or locally
The repository provides a Docker image and Compose validation via GitHub Actions. Local development requires Python and the dependencies listed in the project; the Quick Start section in the README walks through creating a Telegram API ID and hash, configuring accounts, and launching the server. Multi-account setup is supported with per-account routing. Proxy support, device identity configuration, expected-account checks, and file-path security controls are documented. Chat access privacy is enforced through an allowlist so the server only operates on chats you explicitly permit.
Ready-to-use workflows live in the Skills Documentation with step-by-step guides for summarizing unread messages safely, drafting replies without sending, triaging action items, and searching chat history with context expansion.
Sources
Related news
Model Context ProtocolGoogle Releases MCP Toolbox: Open-Source MCP Server Connects AI Agents to Enterprise DatabasesThe googleapis/mcp-toolbox repository provides a Model Context Protocol server that lets AI agents and IDEs query databases directly through prebuilt tools or custom configurations, with SDKs for Java·same source: github.com
- Model Context Protocolmcp-searxng: Private Web Search for AI Assistants via SearXNGTypeScript MCP server connects Claude, Cursor, and any MCP client to a self-hosted or trusted SearXNG instance — no vendor API key required.·same source: github.com
ClaudeClaude Cowork adds custom skill recording from screen captureAnthropic's desktop app now lets users teach Claude new skills by recording and narrating a task, which the model then converts into an autonomous reusable skill.·by shared tag
- Prompt EngineeringPrompting Claude as a senior web developerA short prompt that frames Claude as a 20-year veteran changes how the model approaches code tasks.·by shared tag
Comments
Weekly digest
The best of vibe coding, AI agents and open source — once a week, no spam.