tg-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| API_TOKEN | Yes | HTTP API token for the MCP bridge | |
| TELEGRAM_API_ID | Yes | Telegram API ID from my.telegram.org | |
| TELEGRAM_SESSION | Yes | Path to the Telegram session file (e.g., /path/to/session) | |
| TELEGRAM_API_HASH | Yes | Telegram API hash from my.telegram.org |
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
| 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 |
|---|---|
| list_chatsA | List Telegram chats known to the service. |
| chat_infoA | Details for one chat: type, title, forum flag, stored message count and date range. |
| get_messagesA | Messages from one chat in chronological order. Dates are ISO 8601 (e.g. 2026-09-01 or 2026-09-01T12:00:00Z). Use before_id/after_id (message ids) to paginate. Format: #id [date] sender (tags)\ntext. |
| message_contextC | One message with surrounding messages, the chain of messages it replies to, replies to it, and its album. |
| search_messagesA | Full-text search across all chats (or one chat). mode=fts uses stemmed Russian/English search with websearch syntax ("a b" phrase, -word exclusion, OR); mode=substring is a plain case-insensitive substring match. |
| semantic_searchA | Search by MEANING across all chats (or one): finds messages, voice transcripts, document and image text that are about the query even when the words differ. Use search_messages for exact words / names. |
| request_backfillA | Ask the service to download older history for a chat from Telegram (async job). from_date/to_date bound the range; omit both to walk back from the newest message until max_messages. |
| backfill_statusA | Status of a backfill job: queued | running | done | failed | cancelled, plus processed count. |
| fetch_mediaA | Download a message's media to local disk and derive text from it. action: auto (transcribe audio/video, extract text from pdf/docx/xlsx/txt/csv), download (file only, e.g. photos), transcribe, extract. Returns the local file path (this machine) and the transcript / document text. Voice messages in private chats and groups are transcribed automatically on arrival, so check get_messages first. Already-processed media is returned immediately; force=True redoes the work. |
| draft_messageA | Prepare a message to be sent FROM THE OWNER'S OWN ACCOUNT. Nothing is sent by this call: the owner gets a
confirmation card with buttons in their Telegram and decides there. Explain in |
| draft_editA | Propose editing one of the OWNER'S OWN messages (is_out=true). The owner confirms on a card that shows the old and the new text. Only after confirmation the message is edited in Telegram. This is the right tool when the owner dislikes a message that was already sent: one card, replaced in place. Find msg_id via outbox_list (sent_msg_id) or get_messages (lines marked [me]). |
| draft_deleteA | Propose deleting one of the OWNER'S OWN messages. Deleted for everyone after the owner confirms the card. If a replacement is wanted, also call draft_message for the new text (two cards) or prefer draft_edit (one card). |
| outbox_cancelA | Withdraw a draft that is still pending (the owner hasn't decided yet). Use it when the owner says the proposed message is wrong, then create a corrected one with draft_message. |
| outbox_listA | Recent drafts with their outcome (pending | sent | scheduled | rejected | expired | failed) and, for sent ones, the sent_msg_id you need for draft_edit / draft_delete. Use it to find 'the message I sent earlier'. |
| outbox_statusB | Status of a draft: pending | sent | rejected | expired | failed, with the sent message id when sent. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 15 tools
Most tools are clearly separated by action (chat_info vs list_chats, get_messages vs search_messages vs semantic_search), but draft_message/draft_edit/draft_delete and outbox_cancel/outbox_list/outbox_status could cause some confusion for agents, though descriptions clarify the distinctions.
The naming follows a consistent verb_noun pattern (list_chats, get_messages, search_messages, draft_message, outbox_list). Minor deviations like chat_info and message_context use noun phrases instead of verb_noun, but the pattern is mostly predictable.
15 tools is within the well-scoped range for a Telegram MCP server covering chat browsing, search, media processing, and message drafting. Each tool serves a distinct function in the workflow.
The server covers chat listing, message retrieval, search, semantic search, backfill, media fetching, and the full draft/send/edit/delete lifecycle. Minor gaps like sending direct messages without owner confirmation or managing chats are absent, but the core domain is well covered.