telegram-bot-testing-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TG_MCP_MODE | No | `prod` or `test` (Telegram test DC, adds `?test=1`). | prod |
| TG_MCP_HEADED | No | `1` = show the browser window during operations. | off |
| TG_MCP_API_KEY | No | Bearer key for this server instance. Required for HTTP. | |
| TG_MCP_UPLOAD_DIR | No | Server-side file directory for upload tools over HTTP. | <profile-dir>-uploads |
| TG_MCP_PROFILE_DIR | No | Browser profile location. This directory is your Telegram session and should be treated like a password. | ~/.telegram-user-mcp/profile-<mode> |
| TG_MCP_ARTIFACT_DIR | No | Directory for recorded demos. | <profile-dir>-recordings |
| TG_MCP_IDLE_SECONDS | No | Close the browser after this many idle seconds. Set `0` to disable. | 90 |
| TG_MCP_TIMEOUT_SCALE | No | Multiply all network-bound timeouts (e.g. `2` on slow networks / the congested test DC). | 1 |
| TG_MCP_HTTP_ALLOWED_HOSTS | No | Additional comma-separated HTTP Host values. | localhost addresses |
| TG_MCP_HTTP_ALLOWED_ORIGINS | No | Comma-separated browser origins to allow. | none |
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 |
|---|---|
| tg_statusA | Report adapter mode, login state and profile location. |
| tg_loginB | Open a visible browser window for one-time Telegram login (QR or phone). The session persists in the profile afterwards. |
| tg_login_phoneA | Headless login step 1: submit the phone number. The code arrives on the account's other logged-in devices (or SMS); pass it to tg_login_code. |
| tg_login_codeA | Headless login step 2: submit the confirmation code. May return password_needed for 2FA accounts (then call tg_login_password). |
| tg_login_passwordB | Headless login step 3: submit the two-factor password (2FA only). |
| tg_open_chatC | Open a chat by @username or t.me link. Returns the last messages. |
| tg_send_messageB | Send a text message or /command to the currently open chat. reply_to: message id to reply to (0 = plain message). |
| tg_forward_messageA | Forward a message by id via the forward picker. Empty to_chat forwards to the current chat (typical bot-test loop). |
| tg_send_fileB | Attach and send a file to the open chat. kind: auto (by extension) | photo | document. |
| tg_send_voiceB | Record and send a voice message using a fake microphone fed from a WAV file (PCM). Relaunches the browser on first use per file. |
| tg_read_messagesB | Read the last messages of the open chat as structured JSON (id, direction, text, time, button grid, media kind). |
| tg_wait_for_messageA | Block until the bot sends something new (the core test primitive). Returns the new incoming messages. |
| tg_click_buttonB | Click an inline-keyboard button by text substring, or by 0-based row/col. Targets message_id or the last message that has buttons. |
| tg_click_reply_buttonC | Click a reply-keyboard button (the keyboard shown near the input). |
| tg_clear_chatB | Clear the open chat's history (test isolation between scenarios). |
| tg_close_browserA | Release Chromium now. The next chat operation reopens the saved profile. |
| tg_record_startB | Start recording the official Telegram Web UI before the demo steps. |
| tg_record_stopB | Finish the demo and return paths to the WebM and, by default, GIF. |
| tg_screenshotB | Screenshot the chat, a single message (scope='message' + message_id), or the whole window (scope='window'). |
| tg_miniapp_openC | Open a Mini App via a web-app button on the last message (or by text). |
| tg_miniapp_snapshotA | List interactive elements inside the open Mini App as [ref] lines usable with tg_miniapp_click / tg_miniapp_type. |
| tg_miniapp_clickB | Click an element inside the Mini App by its snapshot ref (e.g. 'e3'). |
| tg_miniapp_typeB | Type text into a Mini App input by its snapshot ref. |
| tg_miniapp_screenshotB | Screenshot the open Mini App. |
| tg_miniapp_closeB | Close the open Mini App popup. |
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 25 tools
Each tool targets a distinct action or resource, and the two potentially confusing pairs—tg_login vs the headless tg_login_phone/code/password flow and tg_click_button vs tg_click_reply_button—are clearly differentiated by their descriptions (visible vs headless, inline vs reply keyboard). The miniapp_* family and tg_screenshot vs tg_miniapp_screenshot are also clearly scoped. Only minor overlap remains, e.g. tg_login serving as both a standalone and a fallback to the phone flow.
All tools share a consistent tg_ prefix and snake_case, with a predictable verb_noun pattern for messaging/waiting/clicking and a tidy tg_miniapp_* namespace for the sub-workflow. Minor deviations exist: tg_status is a noun rather than an action, and the tg_record_start/stop pair uses a different verb form than tg_screenshot, but the convention is still uniform and readable.
25 tools is on the heavy side, but the surface spans multiple genuinely distinct subsystems—login (4 variants), messaging/media, keyboard interaction, screenshots, recording, and a full six-tool Mini App workflow—so nearly every tool earns its place. The count is justified by the breadth of the browser-automation domain rather than by redundant options.
The surface covers the full bot-test lifecycle: headless and visible login, opening chats, sending text/files/voice, reading messages, waiting for replies, inline and reply-keyboard clicks, chat clearing, screenshots, recording, and Mini App interaction. Minor gaps remain—no message edit/delete (only whole-chat clear), no reactions, and no explicit media download—but these are workaroundable and don't block core test loops.