Skip to main content
Glama
dikaglorya

telegram-mcp

by dikaglorya

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
TELEGRAM_PHONENoOptional international number. When set, login only asks for the code.
TELEGRAM_API_IDYesRequired. Numeric app id from my.telegram.org.
TELEGRAM_API_HASHYesRequired. App hash from my.telegram.org.
TELEGRAM_MCP_NODENoLauncher override for exotic Node installs.
TELEGRAM_AUDIT_LOGNoCall log file.~/.telegram-mcp/audit.log
TELEGRAM_MEDIA_DIRNoDownloads directory.~/.telegram-mcp/media
TELEGRAM_STATE_DIRNoState directory.~/.telegram-mcp
TELEGRAM_EXPORT_DIRNoHistory exports directory.~/.telegram-mcp/exports
TELEGRAM_SESSION_PATHNoSession file.~/.telegram-mcp/session.txt
TELEGRAM_ALLOWED_CHATSNoComma-separated allowlist: @name, numeric id, or exact title.
TELEGRAM_ALLOW_ALL_CHATSNoFull access to every chat the account can reach.true
TELEGRAM_MAX_DOWNLOAD_BYTESNoHard cap for one download. 0 means unlimited. A non-numeric value is refused rather than treated as unlimited.0

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
telegram_statusA

Connection + authorization status, and the logged-in account summary. Secrets are never returned.

telegram_meA

Full profile of the authorized account (id, names, username, phone, premium).

telegram_full_userA

Complete User object for one account (all non-secret fields Telegram exposes). Defaults to the authorized account; pass user to look at somebody else. Phone numbers of other people are only present when their privacy settings share them.

telegram_update_profileB

Change first/last name and/or bio of the authorized account.

telegram_user_photosA

List the profile photos of a user (or of 'me'). Returns photo ids with their sizes and a downloadable file reference; use telegram_download_media only for chat messages, not for these.

telegram_set_my_photoA

Upload a local image as your own profile photo, or remove the current one with remove=true. Telegram also keeps the previous photo in your photo list; this does not delete it.

telegram_common_chatsB

List the groups and channels this account has in common with another user.

telegram_login_startA

Begin authorization when no session exists. Sends the login code to the user's Telegram app. Pass phone in international format (+15551234567) unless TELEGRAM_PHONE is set in the environment. After calling this, ask the user to read the code Telegram just sent them and call telegram_login_code. NEVER ask the user to paste the code anywhere except this chat, and never repeat it back.

telegram_login_codeA

Finish login by submitting the code Telegram sent the user. Call telegram_login_start first. If the account has 2FA, this returns needsPassword:true and you must ask the user for their 2FA password, then call telegram_login_password. Never echo the code or password back.

telegram_login_passwordA

Complete login when the account has two-step verification enabled. Only call after telegram_login_code returned passwordRequired:true. The password is used once and never stored.

telegram_login_cancelA

Abandon an in-progress login. No code or password is retained after this.

telegram_doctorA

Read-only health check: config, installed version, state dir, session presence, session file permissions (auto-repaired to 0600), and live authorization. Returns { healthy, checks[], account }. A missing or unauthorized session is reported as a failed check, not an error — call telegram_login_start to fix it. An available update is informational and never fails the check. Never returns the api_hash or the session string.

telegram_setupA

Create or update the .env file this server loads: TELEGRAM_API_ID, TELEGRAM_API_HASH, optional TELEGRAM_PHONE, and TELEGRAM_ALLOW_ALL_CHATS. Get api_id/api_hash from https://my.telegram.org/apps. Never call this with a hash the user pasted in chat unless they asked you to; the hash is written to disk and never returned. Existing other keys in .env are preserved. The MCP server must be restarted to pick up new values.

telegram_list_chatsB

List dialogs (DMs, groups, channels). Set includeAll=false to only return allowlisted chats when a policy is configured. Default returns everything the account can see.

telegram_chat_infoB

Fetch detailed info for a chat/user/channel: title, username, id, type, member count, description.

telegram_chat_membersB

List participants of a group/channel (if permitted). Returns id, name, username, role.

telegram_join_chatA

Join a public channel/group by @username or invite link.

telegram_leave_chatA

Leave a group/channel by id or @username.

telegram_delete_chatA

Permanently delete a group or channel this account owns, including its history. This is the counterpart of telegram_create_group / telegram_create_channel, and is stronger than telegram_leave_chat: the chat stops existing for everyone, not just for this account. Only the creator can delete; Telegram refuses otherwise.

telegram_mute_chatA

Mute a chat for N days (0 = unmute). Uses default mute behaviour when days>0.

telegram_edit_chatA

Change a group/channel title and/or description. Needs admin rights; Telegram refuses otherwise. Omit a field to leave it untouched. Titles are 1-128 chars, about is up to 255.

telegram_export_invite_linkA

Get a chat's invite link, or revoke it (which kills the old link). Needs admin rights. revoke=true returns the newly issued link, so the chat stays joinable.

telegram_pin_chatA

Pin or unpin a chat in your own dialog list (not a message — use telegram_pin_message for that). Local to the account: nothing changes for other members.

telegram_archive_chatB

Move a chat into the Archived folder or back to the main list. Local to the account. Folder id 0 means 'not archived'; 1 is the default archive folder.

telegram_clear_historyB

Delete messages from a chat. Defaults to your own copy only (revoke=false). revoke=true also removes them for everyone, which needs the rights to do so. Returns the message count Telegram reports as affected when it says.

telegram_get_historyA

Read recent messages from a chat. chat = @username, numeric id, or 'me'. Newest-first, max 100. The answer carries hasMore and nextOffsetId: pass that id back as offsetId to page further back. A page shorter than limit with hasMore:false means the history is exhausted.

telegram_search_messagesA

Full-text search within a chat. Returns matching messages newest-first (max 100 per page). The answer carries hasMore and nextOffsetId for paging deeper into the matches.

telegram_get_messageC

Fetch one message by id from a chat.

telegram_send_messageB

Send a text message to a chat. Supports replyTo and topicId. Returns the new message id and sent:true. Full access: sends immediately.

telegram_edit_messageB

Edit one of your own messages in a chat by message id.

telegram_delete_messagesA

Delete one or more messages in a chat by id. revoke=true deletes for everyone (your messages).

telegram_forward_messagesB

Forward messages by id from one chat to another.

telegram_reactA

Send a reaction (emoji) to a specific message. Pass emoji 'none' or '' to clear reactions.

telegram_pin_messageC

Pin or unpin a message in a chat.

telegram_mark_readC

Mark all messages in a chat as read.

telegram_typingA

Show 'typing…' in a chat for a few seconds, or clear it. Telegram expires the indicator on its own; pass action 'cancel' to remove it immediately. Nothing is sent to the chat history.

telegram_unpin_allB

Remove all pinned messages from a chat in one call.

telegram_export_historyB

Dump a chat's message history to a JSON file in the export directory and return the path. Useful for archiving or handing a full conversation to another tool. Newest-first, max 1000.

telegram_message_linkA

Build the t.me link for one message, or for a whole chat when messageId is omitted. Works for public and private chats — a private chat yields the /c/ form, which needs no username.

telegram_send_pollA

Send a poll. 2-10 answers. multipleChoice lets voters pick several; quiz makes it a quiz (a correct answer index is required, 0-based). anonymous=false shows who voted.

telegram_send_contactA

Send a phone contact (vCard) into a chat. Nothing is saved to your contacts list.

telegram_pinned_messagesB

Read the messages currently pinned in a chat, with sender and text.

telegram_search_globalA

Full-text search over all chats at once (not one chat). Returns matches with the chat they belong to, newest first. Optional minDate/maxDate (unix seconds) narrow the window. Note: Telegram's own cursor can repeat rows between pages; that overlap is removed for you and reported as skippedRepeat.

telegram_download_mediaB

Download the attachment of a message to the local media directory. Returns local path + size. Set TELEGRAM_MAX_DOWNLOAD_BYTES in env for a cap (0 = unlimited).

telegram_delete_downloadA

Remove one record from the local downloads index by its id, optionally deleting the file it points at. This is local bookkeeping only — nothing is deleted on Telegram. Use it to prune records whose file is already gone (telegram_list_downloads reports exists:false for those).

telegram_send_fileB

Send a local file as a document (forceDocument) or auto-detected media. Supports caption. Sends immediately.

telegram_send_photoC

Send a local image as a photo (inline preview). Sends immediately.

telegram_list_downloadsB

List files downloaded by this server (paths, sizes, source message).

telegram_send_locationB

Send a geographic point to a chat. lat/long are decimal degrees; optional accuracy in metres. Sends immediately.

telegram_search_usersB

Global search for users/chats by name or @username. Returns ids, usernames, types.

telegram_get_contactsC

List saved contacts (id, name, username, phone).

telegram_add_contactC

Save a Telegram user as a contact by @username or user id.

telegram_delete_contactsA

Remove saved contacts by @username, user id, or numeric id. This is the inverse of telegram_add_contact and may remove several at once. The account stays subscribed to nothing new — it only forgets the saved contact entry.

telegram_create_groupB

Create a new group chat with the given users (by @username or id) and a title.

telegram_create_channelC

Create a broadcast channel with the given title and optional description.

telegram_block_userA

Block or unblock a user. A blocked user cannot message you or see your profile. Pass unblock=true to reverse it.

telegram_list_blockedA

List the users this account has blocked (id, name, username, blocked-at).

telegram_audit_logA

Read this server's own call log, newest first. Every tool call is appended with timestamp, tool name, sanitized args and outcome; secrets are redacted at write time. Optional filters: tool name and outcome ('ok' | 'error'). Purely local — nothing is read from Telegram.

telegram_audit_summaryA

Counts per tool and per outcome from the local audit log, plus the first and last recorded call. Use it to see what an agent has actually done to the account, without paging through entries.

telegram_list_sessionsA

List every device currently logged into this account, marking the one running this server with current:true. Each entry carries the hash that telegram_logout_session needs.

telegram_logout_sessionA

Revoke one session by the hash reported by telegram_list_sessions. Pass all=true to revoke every session except this one. Refuses to revoke the session running this server.

telegram_invite_membersA

Invite one or more users into a group/channel this account administers. Users are resolved from @username or id. Returns the ids Telegram reports as invited, plus the ones it refused.

telegram_promote_adminB

Grant or revoke admin rights for a member. preset: 'moderator' (default, can delete and ban), 'full' (everything except anonymous), 'none' (demote). Optional custom title (rank).

telegram_kick_memberB

Remove a member from a group or channel. kick=true bans them (default), unban=true lifts the ban so they may rejoin. Nothing is deleted from the chat history.

telegram_set_chat_photoA

Upload a local image as the group/channel photo, or remove the photo with remove=true. Needs admin rights. The file is read from disk, never from a URL.

telegram_chat_adminsA

List the admins of a group or channel with the rights each one holds and their custom rank. Uses the dedicated admin filter, so it does not page through every member.

telegram_scheduled_messagesA

List the messages queued to be sent later in a chat, with their planned send time. Scheduling is done by the client; this reads back what is already queued.

telegram_foldersA

List the account's chat folders, with the peers each one includes and excludes. A folder with no explicit peers is rule-based (e.g. all non-contacts).

telegram_translateA

Translate text using Telegram's own translation service. Pass chat+messageId to translate an existing message, or text to translate a literal string. targetLang is an ISO code such as 'id' or 'en'.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.3/5.0

Scored across 69 tools

Disambiguation4/5

Most tools target a clearly distinct resource+action, and the descriptions do real disambiguation work (pin_chat vs pin_message, leave_chat vs delete_chat, search_messages vs search_global, get_history vs export_history). A few boundaries stay fuzzy: telegram_me vs telegram_full_user vs telegram_status overlap as account summaries, and telegram_delete_messages vs telegram_clear_history both remove messages (by id vs whole chat).

Naming Consistency4/5

Nearly everything is telegram_ + snake_case verb_noun (send_message, get_history, create_group, kick_member), which is highly predictable. Minor deviation: listing tools mix list_ prefix (telegram_list_chats, telegram_list_blocked, telegram_list_downloads) with bare nouns (telegram_folders, telegram_chat_members, telegram_scheduled_messages, telegram_chat_admins).

Tool Count2/5

69 tools is far beyond what an agent can reliably choose among, and the surface is heavy relative even to Telegram's broad domain. Many tools are niche (audit_summary, delete_download, message_link, typing) and could be folded or grouped. This is a large, sprawling set rather than a well-scoped one.

Completeness4/5

Coverage is unusually thorough: auth lifecycle, profile, chats/groups/channels, messaging, media, contacts, admin rights, sessions, polls, locations, folders, and audit logging are all present. Minor gaps remain — telegram_scheduled_messages only reads queued messages (no way to schedule one), and folders are list-only with no create/update, but these are edge cases agents can work around.

Maintenance

ActivityMaintained
ResponsivenessResponsive