PyPI v2.0.5 Apache-2.0 Python >= 3.10

Telegram MCP

Telegram MCP server maintained in Jiyuu. Reads and manages chats, messages, contacts, folders, and media through your Telegram user account.

Maintained by Unique Divine

Install

Needs Python >= 3.10. The commands run the latest release. This page lists the tools in version 2.0.5.

Each snippet has a <NAME> placeholder for every credential or required variable. Replace them with your own values in your client config, and drop optional ones you don't use. To get the credentials, see the Telegram MCP sign-in instructions ↗ .

Claude Code

claude mcp add telegram -e 'TELEGRAM_API_ID=<TELEGRAM_API_ID>' -e 'TELEGRAM_API_HASH=<TELEGRAM_API_HASH>' -e 'TELEGRAM_SESSION_STRING=<TELEGRAM_SESSION_STRING>' -- uvx uniquedivine-telegram-mcp@latest

Codex

Add this entry to file ~/.codex/config.toml:

        [mcp_servers.telegram]
command = "uvx"
args = ["uniquedivine-telegram-mcp@latest"]
env = { TELEGRAM_API_ID = "<TELEGRAM_API_ID>", TELEGRAM_API_HASH = "<TELEGRAM_API_HASH>", TELEGRAM_SESSION_STRING = "<TELEGRAM_SESSION_STRING>" }
      

Cursor

Add this entry to file ~/.cursor/mcp.json, or to file .cursor/mcp.json in a project:

        {
  "mcpServers": {
    "telegram": {
      "command": "uvx",
      "args": [
        "uniquedivine-telegram-mcp@latest"
      ],
      "env": {
        "TELEGRAM_API_ID": "<TELEGRAM_API_ID>",
        "TELEGRAM_API_HASH": "<TELEGRAM_API_HASH>",
        "TELEGRAM_SESSION_STRING": "<TELEGRAM_SESSION_STRING>"
      }
    }
  }
}
      

Environment Variables

Names only. Set values in your shell or your client's server entry, never in a prompt.

NameRequiredSecretNotes
TELEGRAM_API_IDYesYes
TELEGRAM_API_HASHYesYes
TELEGRAM_SESSION_STRINGNoYesSet this or TELEGRAM_SESSION_NAME. For several accounts, set TELEGRAM_SESSION_STRING_<LABEL> or TELEGRAM_SESSION_NAME_<LABEL> per account instead.
TELEGRAM_SESSION_NAMENoNoName of a local session file, used instead of TELEGRAM_SESSION_STRING. The session file itself is a credential.
TELEGRAM_EXPOSED_TOOLSNoNo
JIYUU_MCP_NO_UPDATE_CHECKNoNo

Safety

  • 50 of 117 tools only read. The other 67 can change state under your account or bot.
  • 65 tools are marked destructive. They show as destructive in the table; keep your client's approval prompt on for them.
  • To learn the version, where the server runs from, or whether an update exists, use the mcp_info tool. Never have an agent read MCP client config files for this; they hold secrets.

Tools

117 tools. Tools tagged read change nothing.

ToolAccessDescriptionParameters
list_accounts List AccountsreadList all configured Telegram accounts with profile info.None
list_contacts List ContactsreadList all contacts in your Telegram account.account
search_contacts Search ContactsreadSearch for contacts by name, username, or phone number using Telethon's SearchRequest.query*, account
get_contact_ids Get Contact IdsreadGet all contact IDs in your Telegram account.account
get_direct_chat_by_contact Get Direct Chat By ContactreadFind a direct chat with a specific contact by name, username, or phone.contact_query*, account
get_contact_chats Get Contact ChatsreadList all chats involving a specific contact.contact_id*, account
get_last_interaction Get Last InteractionreadGet the most recent message with a contact.contact_id*, account
add_contact Add ContactdestructiveAdd a new contact to your Telegram account.account, phone, first_name, last_name, username
delete_contact Delete ContactdestructiveDelete a contact by user ID.user_id*, account
block_user Block UserdestructiveBlock a user by user ID.user_id*, account
unblock_user Unblock UserdestructiveUnblock a user by user ID.user_id*, account
import_contacts Import ContactsdestructiveImport a list of contacts. Each contact should be a dict with phone, first_name, last_name.contacts*, account
export_contacts Export ContactsreadExport all contacts as a JSON string.account
get_blocked_users Get Blocked UsersreadGet a list of blocked users.account
send_contact Send ContactdestructiveSend a contact to a chat.chat_id*, phone_number*, first_name*, last_name, vcard, account
get_chats Get ChatsreadGet a paginated list of chats, including their latest message ID and date.account, page, page_size
subscribe_public_channel Subscribe Public ChanneldestructiveSubscribe (join) to a public channel or supergroup by username or ID.channel*, account
list_topics List TopicsreadRetrieve forum topics from a supergroup with the forum feature enabled.chat_id*, limit, offset_topic, search_query, account
enable_forum_topics Enable Forum TopicsdestructiveEnable Telegram forum topics for a supergroup.chat_id*, tabs, account
create_forum_topic Create Forum TopicdestructiveCreate a Telegram forum topic in a forum-enabled supergroup.chat_id*, title*, icon_color, icon_emoji_id, account
list_chats List ChatsreadList available chats with metadata.chat_type, limit, unread_only, unmuted_only, archived, with_about, account
get_chat Get ChatreadGet detailed information about a specific chat.chat_id*, account
search_public_chats Search Public ChatsreadSearch for public chats, channels, or bots by username or title.query*, limit, account
resolve_username Resolve UsernamereadResolve a username to a user or chat ID.username*, account
get_full_chat Get Full ChatreadGet full info of a channel or group including description/about text.chat_id*, account
mute_chat Mute ChatdestructiveMute notifications for a chat.chat_id*, account
unmute_chat Unmute ChatdestructiveUnmute notifications for a chat.chat_id*, account
archive_chat Archive ChatdestructiveArchive a chat.chat_id*, account
unarchive_chat Unarchive ChatdestructiveUnarchive a chat.chat_id*, account
get_common_chats Get Common ChatsreadList chats shared with a specific user.user_id*, limit, max_id, account
get_message_read_by Get Message Read ByreadList user IDs who have read a specific message.chat_id*, message_id*, account
get_messages Get MessagesreadGet paginated messages from a specific chat.chat_id*, page, page_size, account
send_message Send MessagedestructiveSend a message to a specific chat.chat_id*, message*, parse_mode, account
send_scheduled_message Send Scheduled MessagedestructiveSchedule a message to be sent at a future time.chat_id*, message*, schedule_date*, account
get_scheduled_messages Get Scheduled MessagesreadList all scheduled (pending) messages in a chat.chat_id*, account
delete_scheduled_message Delete Scheduled MessagedestructiveDelete one or more scheduled (pending) messages from a chat.chat_id*, message_ids*, account
list_inline_buttons List Inline ButtonsreadInspect inline buttons on a recent message to discover their indices/text/URLs.chat_id*, message_id, limit, account
press_inline_button Press Inline ButtondestructivePress an inline button (callback) in a chat message.chat_id*, message_id, button_text, button_index, account
list_messages List MessagesreadRetrieve messages with optional filters.chat_id*, limit, search_query, from_date, to_date, account
get_message_context Get Message ContextreadRetrieve context around a specific message.chat_id*, message_id*, context_size, account
forward_message Forward MessagedestructiveForward a message (or several) from a source chat to a destination chat.from_chat_id*, message_id*, to_chat_id*, account, expand_album
forward_messages Forward Messages (batch)destructiveForward a BATCH of messages from a source chat to a destination chat in a single atomic call.from_chat_id*, message_ids*, to_chat_id*, account
edit_message Edit MessagedestructiveEdit a message you sent.chat_id*, message_id*, new_text*, account
delete_message Delete MessagedestructiveDelete a message by ID.chat_id*, message_id*, account
delete_chat_history Delete Chat HistorydestructiveClear the full message history of a chat.chat_id*, max_id, revoke, account
delete_messages_bulk Delete Messages BulkdestructiveDelete multiple messages in a single call.chat_id*, message_ids*, revoke, account
pin_message Pin MessagedestructivePin a message in a chat.chat_id*, message_id*, account
unpin_message Unpin MessagedestructiveUnpin a message in a chat.chat_id*, message_id*, account
unpin_all_messages Unpin All MessagesdestructiveUnpin all pinned messages in a chat.chat_id*, account
mark_as_read Mark As ReaddestructiveMark all messages as read in a chat.chat_id*, account
reply_to_message Reply To MessagedestructiveReply to a specific message in a chat.chat_id*, message_id*, text*, parse_mode, account
search_messages Search MessagesreadSearch for messages in a chat by text.chat_id*, query*, limit, account
search_global Search Global MessagesreadSearch for messages across all public chats and channels by text content.query*, page, page_size, account
get_history Get HistoryreadGet full chat history (up to limit).chat_id*, limit, account
get_pinned_messages Get Pinned MessagesreadGet all pinned messages in a chat.chat_id*, account
create_poll Create PolldestructiveCreate a poll in a chat using Telegram's native poll feature.chat_id*, question*, options*, multiple_choice, quiz_mode, public_votes, close_date, account
send_reaction Send ReactionwriteSend a reaction to a message.chat_id*, message_id*, emoji*, big, account
remove_reaction Remove ReactiondestructiveRemove your reaction from a message.chat_id*, message_id*, account
get_message_reactions Get Message ReactionsreadGet the list of reactions on a message.chat_id*, message_id*, limit, account
save_draft Save DraftwriteSave a draft message to a chat or channel. The draft will appear in the Telegram app's input field when you open that chat, allowing you to review and send it manually.chat_id*, message*, reply_to_msg_id, no_webpage, account
get_drafts Get DraftsreadGet all draft messages across all chats. Returns a list of drafts with their chat info and message content.account
clear_draft Clear DraftdestructiveClear/delete a draft from a specific chat.chat_id*, account
create_group Create GroupdestructiveCreate a new group or supergroup and add users.title*, user_ids*, account
invite_to_group Invite To GroupdestructiveInvite users to a group or channel.group_id*, user_ids*, history_messages, account
leave_chat Leave ChatdestructiveLeave a group or channel by chat ID.chat_id*, account
get_participants Get ParticipantsreadList participants in a group or channel with pagination.chat_id*, page, page_size, account
create_channel Create ChanneldestructiveCreate a new channel or supergroup.title*, about, megagroup, account
edit_chat_title Edit Chat TitledestructiveEdit the title of a chat, group, or channel.chat_id*, title*, account
edit_chat_photo Edit Chat PhotodestructiveEdit the photo of a chat, group, or channel. Requires a file path to an image.chat_id*, file_path*, account
edit_chat_about Edit Chat AboutdestructiveEdit the description ("About") of a chat, group, or channel.chat_id*, about*, account
delete_chat_photo Delete Chat PhotodestructiveDelete the photo of a chat, group, or channel.chat_id*, account
promote_admin Promote AdmindestructivePromote a user to admin in a group/channel.group_id*, user_id*, rights, account
demote_admin Demote AdmindestructiveDemote a user from admin in a group/channel.group_id*, user_id*, account
ban_user Ban UserdestructiveBan a user from a group or channel.chat_id*, user_id*, account
unban_user Unban UserdestructiveUnban a user from a group or channel.chat_id*, user_id*, account
set_default_chat_permissions Set Default Chat PermissionsdestructiveSet default member permissions for a group, supergroup, or channel.chat_id*, send_messages, send_media, send_stickers, send_gifs, send_games, send_inline, embed_links, send_polls, change_info, invite_users, pin_messages, until_date, account
toggle_slow_mode Toggle Slow ModedestructiveEnable or disable slow mode for a supergroup.chat_id*, seconds, account
edit_admin_rights Edit Admin RightsdestructiveSet granular admin rights for a user in a supergroup or channel.chat_id*, user_id*, rank, change_info, post_messages, edit_messages, delete_messages, ban_users, invite_users, pin_messages, add_admins, anonymous, manage_call, manage_topics, other, account
get_admins Get AdminsreadGet all admins in a group or channel.chat_id*, account
get_banned_users Get Banned UsersreadGet all banned users in a group or channel.chat_id*, account
export_chat_invite Export Chat InvitereadExport a chat invite link.chat_id*, account
import_chat_invite Import Chat InvitedestructiveImport a chat invite by hash.hash*, account
get_recent_actions Get Recent ActionsreadGet recent admin actions (admin log) in a group or channel.chat_id*, account
send_file Send FiledestructiveSend a file to a chat.chat_id*, file_path*, caption, account
send_album Send AlbumdestructiveSend multiple photos/videos as one Telegram media group (album).chat_id*, file_paths*, caption, account
download_media Download MediadestructiveDownload media from a message in a chat.chat_id*, message_id*, file_path, account
send_voice Send VoicedestructiveSend a voice message to a chat. File must be an OGG/OPUS voice note.chat_id*, file_path*, account
upload_file Upload FiledestructiveUpload a local file to Telegram and return upload metadata.file_path*, account
get_media_info Get Media InforeadGet info about media in a message.chat_id*, message_id*, account
get_sticker_sets Get Sticker SetsreadGet all sticker sets.account
send_sticker Send StickerdestructiveSend a sticker to a chat. File must be a valid .webp sticker file.chat_id*, file_path*, account
send_gif Send GifdestructiveSend a GIF document ID from a recent get_gif_search on this account.chat_id*, gif_id*, account
get_me Get MereadGet your own user information.account
update_profile Update ProfiledestructiveUpdate your profile information (name, bio).account, first_name, last_name, about
set_profile_photo Set Profile PhotodestructiveSet a new profile photo.file_path*, account
delete_profile_photo Delete Profile PhotodestructiveDelete your current profile photo.account
get_privacy_settings Get Privacy SettingsreadGet your privacy settings for last seen status.account
set_privacy_settings Set Privacy SettingsdestructiveSet privacy settings (e.g., last seen, phone, etc.).key*, allow_users, disallow_users, account
get_full_user Get Full UserreadGet full profile info of a Telegram user including bio/about text, personal channel link, and other profile details.username*, account
get_bot_info Get Bot InforeadGet information about a bot by username.bot_username*, account
set_bot_commands Set Bot CommandsdestructiveSet bot commands for a bot you own.bot_username*, commands*, account
get_user_photos Get User PhotosreadGet profile photos of a user.user_id*, limit, account
get_user_status Get User StatusreadGet the online status of a user.user_id*, account
list_folders List FoldersreadGet all dialog folders (filters) with their IDs, names, and emoji. Returns a list of folders that can be used with other folder tools.account
get_folder Get FolderreadGet detailed information about a specific folder including all included chats.folder_id*, account
create_folder Create FolderdestructiveCreate a new dialog folder.title*, emoticon, chat_ids, contacts, non_contacts, groups, broadcasts, bots, exclude_muted, exclude_read, exclude_archived, account
add_chat_to_folder Add Chat to FolderdestructiveAdd a chat to an existing folder.folder_id*, chat_id*, pinned, account
remove_chat_from_folder Remove Chat from FolderdestructiveRemove a chat from a folder.folder_id*, chat_id*, account
delete_folder Delete FolderdestructiveDelete a folder. Chats in the folder are preserved, only the folder is removed.folder_id*, account
reorder_folders Reorder FoldersdestructiveChange the order of folders in the folder list.folder_ids*, account
wait_for_new_message Wait For New MessagereadBlock until a new incoming private message from a non-bot user arrives, then return immediately with the list of chats that currently have pending (unprocessed) incoming messages. If nothing arrives within `timeout` seconds, returns {"event": false, "reason": "timeout"}. Lets the agent react to events instead of polling. Does NOT consume the pending set — use wait_for_settled_message to consume a debounced burst.timeout
wait_for_settled_message Wait For Settled MessagereadEvent-driven, DEBOUNCED wait. Blocks until some private user chat has received one or more incoming messages AND then gone quiet for `settle_ms` — so a client who types several messages (or sends file + text) in a row is delivered as ONE settled burst instead of waking the agent on every message. Returns that chat's burst summary and removes it from the pending set, so the next call returns the next settled chat. If no chat settles within `max_wait_ms`, returns {"event": false, "reason": "timeout"} (caller should simply call again).settle_ms, max_wait_ms
mcp_info MCP InforeadReport this server's version, install provenance and update status.None

* Required parameter.

More MCP Servers by Unique Divine

All MCP servers →