telegram-mcp
Provides tools to control a Telegram account: read chats and messages, send/edit/delete messages, publish to channels, create channels/groups, join by invite links, press inline buttons, send/download files, and create bots via @BotFather. Also includes a GUI mode that drives Telegram Desktop via screenshots and clicks.
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., "@telegram-mcp read my last messages from Alice"
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.
telegram-mcp
MCP server that lets Claude Code drive your own Telegram account: read chats, send and edit messages, publish posts to channels, create channels/groups, join by invite links, press inline buttons, send/download files, and create bots through @BotFather.
Two servers ship in this repo:
Server | How it works | Needs |
| Telegram API (MTProto via Telethon) — fast, precise, 23 tools |
|
| Screenshots + pyautogui clicks in Telegram Desktop — Claude looks at the screen and clicks | Telegram Desktop logged in, macOS permissions |
Requirements
uv (it installs Python 3.13 automatically)
Claude Code (or any MCP client)
A Telegram account
Related MCP server: Telegram MCP Server
Setup
Clone the repo:
git clone https://github.com/resccrew/telegram-mcp.git ~/telegram-mcpGet
api_idandapi_hashat https://my.telegram.org → API development tools.Log in once (asks for the credentials, then phone number, the code Telegram sends, and your 2FA password):
cd ~/telegram-mcp && uv run telegram-mcp-loginCredentials go to
~/.telegram-mcp/config.env, the session to~/.telegram-mcp/session.txt(bothchmod 600, outside the repo). The session string is full access to your account — never share it.Register the server with Claude Code (user scope, available in every project):
claude mcp add telegram -s user -- uv --directory ~/telegram-mcp run telegram-mcp
Restart Claude Code and ask things like "read my last messages from Alice", "create a bot called Weather Helper with username weather_helper_xyz_bot", "write a post about X to my channel @mychannel".
Tools
Area | Tools |
Account & chats |
|
Messages |
|
UI automation |
|
Files |
|
Groups & channels |
|
Bots |
|
chat arguments accept @username, a t.me link, phone, numeric id, me (Saved Messages) or a chat title.
Safety notes
Run one server per session at a time; the same session connected in parallel from many places can make Telegram revoke it (
AuthKeyDuplicatedError→ just run the login again).send_filerefuses credential files (~/.telegram-mcp,~/.ssh, dotfiles,*.env,*.session, keys).Claude acts as you: keep Claude Code permission prompts on for
delete_messages,leave_chat, etc.
Configuration
Variable | Default |
| read from |
|
|
|
|
GUI mode (no API keys): telegram-gui-mcp
A second server, telegram-gui, drives the Telegram desktop app like a person: it sends Claude a
screenshot, Claude answers with where to click/what to type, and pyautogui does it. No api_id,
no login, no session file — it just uses the app that is already logged in. macOS only.
Tool | What it does |
| Full-screen screenshot (downscaled to ≤1280 px) |
| Click at |
| Type into the focused field via the clipboard (Cyrillic, emoji), |
|
|
| Positive = up, negative = down, optionally over |
| Launch / bring Telegram to the front |
Every action returns a fresh screenshot (screenshot_after=false to skip). Coordinates always refer
to the last screenshot; Retina scaling is handled by the server.
Permissions. In System Settings → Privacy & Security, grant the app that runs Claude Code (Terminal, iTerm, Ghostty, VS Code, …) both Screen Recording (screenshots) and Accessibility (clicks and keys), then restart that app. Without them the tools return an error saying which one is missing.
Register:
claude mcp add --scope user telegram-gui -- uv --directory /path/to/telegram-mcp run telegram-gui-mcpSafety: moving the mouse into a screen corner aborts automation (pyautogui failsafe). The server controls your real mouse and keyboard, so don't use the computer while Claude is working. Screenshots cover the whole main display (other windows included) and are sent to Claude; text on screen (incoming messages) is untrusted input, so Claude asks before sending or deleting.
Typical flow: open_telegram → click the search field → type_text("Saved Messages") →
click the result → click the message field → type_text("Hi", press_enter=true).
Limits: main display only; the clipboard is briefly used for typing and then restored (text only).
Other MCP clients
Any stdio MCP client works. Example config (Claude Desktop, Cursor, ...):
{
"mcpServers": {
"telegram": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/telegram-mcp", "run", "telegram-mcp"]
}
}
}Development
uv run pytest -qLicense
MIT — see LICENSE. Use responsibly and follow the Telegram API Terms of Service: no spam or mass messaging.
Available Tools
23 toolsbot_apiC
Call any Telegram Bot API method as a bot, e.g. method='setMyCommands' or 'sendMessage'.
Inputs: token (required), method (required), params. Returns: object
chat_infoC
Get details about a user, bot, group or channel.
Inputs: chat (required). Returns: object
click_buttonC
Press a keyboard button under a message, by (part of) its text or by row/column (0-based).
Inputs: chat (required), message_id (required), row, text, +1 more. Returns: object
create_botA
Create a new bot via @BotFather. username must end with 'bot'. Returns the bot token.
Inputs: name (required), username (required). Returns: object
create_channelB
Create a channel (megagroup=True creates a supergroup). Optional public @username.
Inputs: title (required), about, username, megagroup. Returns: object
create_groupB
Create a basic group with the given users.
Inputs: title (required), users (required). Returns: object
delete_messagesB
Delete messages (revoke=True deletes for everyone).
Inputs: chat (required), message_ids (required), revoke. Returns: object
download_mediaC
Download the media attached to a message; returns the saved file path.
Inputs: chat (required), message_id (required), directory. Returns: object
edit_messageC
Edit one of your messages.
Inputs: chat (required), text (required), message_id (required), parse_mode. Returns: object
forward_messagesB
Forward messages from one chat to another.
Inputs: to_chat (required), from_chat (required), message_ids (required). Returns: object
get_meA
Return the logged-in Telegram account.
Inputs: no named parameters. Returns: object
get_participantsB
List members of a group or channel (admin rights may be needed for channels).
Inputs: chat (required), limit, search. Returns: object
invite_usersC
Add users to a group or channel.
Inputs: chat (required), users (required). Returns: object
join_chatB
Join a public group/channel (@username or link) or a private one (t.me/+invite).
Inputs: target (required). Returns: object
leave_chatC
Leave a group/channel or delete a private dialog.
Inputs: chat (required). Returns: object
list_chatsB
List dialogs (private chats, groups, channels, bots), newest first. Filter by title with query.
Inputs: limit, query, archived, unread_only. Returns: object
mark_readC
Mark all messages in a chat as read.
Inputs: chat (required). Returns: object
pin_messageB
Pin a message in a chat or channel.
Inputs: chat (required), message_id (required), notify. Returns: object
read_messagesA
Read messages from a chat, newest first.
offset_id: return messages older than this id (paging back). min_id: return only messages newer than this id (polling for new ones). search: only messages containing this text.
Inputs: chat (required), limit, min_id, search, +1 more. Returns: object
search_messagesC
Search messages across all chats.
Inputs: query (required), limit. Returns: object
send_fileC
Send a local file (photo, video, document, voice) with an optional caption.
Inputs: chat (required), path (required), caption, force_document. Returns: object
send_messageB
Send a text message (also used to publish a post to a channel).
parse_mode: 'md' (bold, italic, code, link), 'html', or null for plain text.
Inputs: chat (required), text (required), silent, reply_to, +2 more. Returns: object
talk_to_botA
Send a message to a bot (e.g. @BotFather) and return its replies, including their buttons.
Inputs: bot (required), text (required), timeout. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Each tool maps to a distinct resource and action: account, chats, participants, messages, media, groups/channels, and bots. Even the generic bot_api is clearly positioned as a raw API escape hatch rather than a duplicative operation.
Most tools follow a clear verb_noun pattern such as send_message, create_channel, and delete_messages. Minor deviations like chat_info and bot_api break the pattern, but they are still readable and predictable.
With 23 tools, the server sits in the heavy borderline range where coherence can suffer. However, the count is justified by the broad Telegram feature surface and each tool has a distinct purpose.
The tool set covers the primary lifecycle well: chats, messages, media, groups/channels, participants, and bot management. Minor gaps exist, such as updating chat metadata or profile settings, but they are not critical for core Telegram workflows.
Maintenance
Related MCP Connectors
Your Telegram, WhatsApp, Instagram, mail and calendar in Claude or ChatGPT. Never sends messages.
Hosted Telegram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Let AI assistants post to your Telegram chats, groups and channels. Not affiliated with Telegram.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceEnables Claude to interact with your Telegram account, including reading messages, searching conversations, and sending messages.-
- AlicenseAqualityDmaintenanceEnables reading and searching Telegram channel/group/DM messages from Claude Code using MTProto for full message history access.539 npmMIT
- AlicenseNot gradedqualityDmaintenanceConnect Claude to your personal Telegram account via MTProto to read messages, search chats, send replies, forward files, and more using your real account.15 npm3MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude to send messages, media, and manage Telegram chat messages through a Telegram bot, including sending photos, documents, and editing or deleting messages.MIT