telegram-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TELEGRAM_API_ID | Yes | Your Telegram API ID from my.telegram.org | |
| TELEGRAM_SESSION | No | Path to the Telegram session file (optional, default: $HOME/.telegram-mcp/telegram.session) | |
| TELEGRAM_API_HASH | Yes | Your Telegram API hash from my.telegram.org | |
| TELEGRAM_DOWNLOAD_DIR | No | Directory for downloaded media (optional, default: $HOME/Downloads/telegram-mcp) |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_meA | Return the logged-in Telegram account (id, username, first_name, phone). Doubles as a session check — errors if no valid session exists. |
| list_chatsA | List chats (groups, channels, direct messages). Args:
query: Optional case-insensitive substring filter on the chat title.
When set, ALL dialogs are scanned so a match beyond the most-recent
Returns objects with id, title, type ('group'/'channel'/'user'), unread. Use this to find a chat's id/title before calling other tools. |
| get_messagesA | Read recent messages from one chat. Args: chat: Chat id, @username, or exact/substring title. limit: Max messages (default 30, capped at 200). before_id: Only messages older than this message id (pagination). search: Optional full-text filter within the chat. Returns message dicts (id, chat_id, date, sender_id, text, has_media, media_type). |
| search_messagesA | Search messages by text — globally or within one chat. Args: query: Non-empty search string. chat: Optional chat id/@username/title to scope the search. limit: Max results (default 30, capped at 200). Returns message dicts (id, chat_id, date, sender_id, text, has_media, media_type). |
| download_mediaA | Download media from specific messages to disk. Args: chat: Chat id/@username/title. message_ids: Message ids whose media should be downloaded. dest_dir: Target directory (default TELEGRAM_DOWNLOAD_DIR). Returns [{message_id, path}] for messages whose media downloaded successfully; non-media and undownloadable media are skipped. Paths are absolute. |
| get_recent_mediaA | Download the most recent media items from a chat. Args: chat: Chat id/@username/title. limit: How many recent messages to scan (default 20, capped at 200). kind: Optional filter — 'photo' / 'video' / 'document' / 'other'. dest_dir: Target directory (default TELEGRAM_DOWNLOAD_DIR). Returns [{message_id, kind, path}] for successfully downloaded media. This is the fast path for pulling images out of a group (e.g. the Arcanara Juni-Treffen photos). Paths are absolute. |
| send_messageA | Send a text message to a chat as the logged-in user. This is a real, irreversible send, visible to the chat's members, and cannot be recalled via this API — confirm the chat and text before calling. Args: chat: Chat id/@username/title. text: Non-empty message text. Returns {"sent": True, "message_id": }. |
| send_fileA | Send a local file (image/document) to a chat as the logged-in user. This is a real, irreversible send, visible to the chat's members, and cannot be recalled via this API — confirm the chat and file before calling. Args: chat: Chat id/@username/title. file_path: Absolute path to an existing local file. caption: Optional caption text. Returns {"sent": True, "message_id": }. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Schimmilab/telegram-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server