Telegram MCP Server
by Benornm
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Bind host for http and sse transports (default 127.0.0.1). | |
| MCP_PORT | No | Bind port for http and sse transports (default 8765). | |
| GROQ_API_KEY | No | Groq API key required whenever the groq transcription engine is used. | |
| MCP_TRANSPORT | No | Transport: 'stdio' (default), 'http' (streamable HTTP) or 'sse' (legacy SSE). | |
| TELEGRAM_API_ID | Yes | Telegram API ID from my.telegram.org/apps. | |
| MCP_ALLOWED_HOSTS | No | Comma-separated Host headers accepted by http/sse; replaces the local default list; supports a ':*' port suffix. | |
| TELEGRAM_API_HASH | Yes | Telegram API hash from my.telegram.org/apps. | |
| TELEGRAM_AUDIT_LOG | No | Path to the append-only JSONL deletion audit log (defaults to telegram_audit.log next to the server). | |
| TELEGRAM_FLOODGATE | No | Set to 0 to disable the local flood-prevention gate (enabled by default). | |
| TELEGRAM_LANG_CODE | No | Language code sent to Telegram (default en). | |
| MCP_ALLOWED_ORIGINS | No | Comma-separated browser origins allowed to call the http/sse server; replaces the local default list. | |
| TELEGRAM_EVENT_FEED | No | Set to 1 to auto-enable the incoming event feed (callback mode). | |
| TELEGRAM_PROXY_HOST | No | Proxy hostname. | |
| TELEGRAM_PROXY_PORT | No | Proxy port. | |
| TELEGRAM_PROXY_RDNS | No | Remote DNS setting for SOCKS proxies. | |
| TELEGRAM_PROXY_TYPE | No | Proxy type: 'socks5', 'socks4', 'http' or 'mtproxy'. | |
| TELEGRAM_TRANSCRIBE | No | Voice transcription mode: 'off', 'on-demand' (default) or 'auto'. | |
| TELEGRAM_APP_VERSION | No | App version shown in Telegram Settings > Devices (default 1.0). | |
| TELEGRAM_ALIASES_FILE | No | Override the path of the remembered-contact aliases file. | |
| TELEGRAM_DEVICE_MODEL | No | Device model shown in Telegram Settings > Devices (default 'Telegram MCP'). | |
| TELEGRAM_PROXY_SECRET | No | MTProxy secret, required when TELEGRAM_PROXY_TYPE=mtproxy. | |
| TELEGRAM_SESSION_LOCK | No | Per-session lock mode: 'exclusive' (default) or 'shared' to let instances on the same host share one session. | |
| TELEGRAM_SESSION_NAME | No | Path to a persistent SQLite file session, e.g. /absolute/path/to/telegram_mcp_session. Alternative to TELEGRAM_SESSION_STRING. | |
| TELEGRAM_VIDEO_MAX_MB | No | Videos above this size are refused before download by view_video (default 200 MB). | |
| TELEGRAM_ALLOWED_ROOTS | No | Semicolon-, comma- or (POSIX) colon-separated file roots allowed for file-path and media tools. | |
| TELEGRAM_CONTACT_FUZZY | No | Set to 0 to disable fuzzy contact-alias suggestions (enabled by default). | |
| TELEGRAM_EXPOSED_TOOLS | No | Tool surface: 'all' (default), 'read-only', or 'read-only+<tool>,<tool>', optionally followed by '-<tool>,<tool>' to hide tools. | |
| TELEGRAM_EVENT_LOG_SIZE | No | Size of the in-memory per-message event log (default 2000); 0 turns it off. | |
| TELEGRAM_MCP_HTTP_TOKEN | No | Bearer token required by authenticated streamable HTTP transport and MCP Events webhook subscriptions. | |
| TELEGRAM_MEDIA_BASE_URL | No | Public base URL for signed download and upload URLs when clients run on another machine, e.g. https://tg.example.com. | |
| TELEGRAM_PROXY_PASSWORD | No | Optional proxy password. | |
| TELEGRAM_PROXY_USERNAME | No | Optional proxy username. | |
| TELEGRAM_SESSION_STRING | No | Telegram session string generated by session_string_generator.py. Multi-account setups use suffixed variants such as TELEGRAM_SESSION_STRING_WORK. | |
| TELEGRAM_SYSTEM_VERSION | No | System version shown in Telegram Settings > Devices (default 1.0). | |
| TELEGRAM_DOWNLOAD_SUBDIR | No | Subdirectory under the first allowed root where downloads are saved (default downloads). | |
| TELEGRAM_EVENT_FEED_FILE | No | Override the path of the incoming event feed JSONL file. | |
| TELEGRAM_FILE_EXTENSIONS | No | Per-tool extension allowlists in 'tool:.ext,.ext' form, entries separated by ';', e.g. send_file:.pdf,.png;upload_file:.pdf. | |
| TELEGRAM_SESSION_STRINGS | No | Whitespace-, comma- or semicolon-separated list of session strings forming a session pool for concurrent clients using the same account. Takes precedence over TELEGRAM_SESSION_STRING for the default account. | |
| TELEGRAM_ALLOWED_CHAT_IDS | No | Comma-separated allowlist of marked chat IDs and/or usernames; supports '<chat>:<topic id>' entries for forum topics. | |
| TELEGRAM_BLOCKED_CHAT_IDS | No | Comma-separated blocklist of marked chat IDs and/or usernames excluded across all accounts. | |
| TELEGRAM_SYSTEM_LANG_CODE | No | System language code sent to Telegram (default en). | |
| TELEGRAM_CATCH_UP_INTERVAL | No | Seconds between catch-up requests for updates missed while offline (default 0, off; minimum 30). | |
| TELEGRAM_EXPECTED_USERNAME | No | Refuse to start when the session belongs to a different account. Per-account variant TELEGRAM_EXPECTED_USERNAME_<LABEL> is also supported. | |
| TELEGRAM_SERVER_ROOTS_ONLY | No | Set to 1 to use server roots directly and skip roots/list; client roots are then ignored. | |
| TELEGRAM_TRANSCRIBE_ENGINE | No | Default transcription engine: 'groq' (default), 'telegram', 'openai' or 'whisper'. | |
| TELEGRAM_LOCK_GRACE_SECONDS | No | Seconds a second instance waits for the exclusive session lock before refusing to start (default 20). | |
| TELEGRAM_TRANSCRIBE_TIMEOUT | No | Seconds allowed for a single request to the HTTP transcription engines (default 120). | |
| TELEGRAM_TRANSCRIBE_LANGUAGE | No | ISO-639-1 language hint passed to every transcription engine except telegram; unset means auto-detect. | |
| TELEGRAM_TOOL_TIMEOUT_SECONDS | No | Server-side ceiling for every tool call (default 55); 0 means unbounded. | |
| TELEGRAM_TRANSCRIPT_CACHE_DIR | No | Directory for the voice-transcription SQLite cache (default data/transcripts). | |
| TELEGRAM_FLOOD_SLEEP_THRESHOLD | No | Maximum seconds Telethon sleeps silently on FloodWait (default 60); 0 disables silent sleeping. | |
| TELEGRAM_ROOTS_TIMEOUT_SECONDS | No | Timeout for roots/list (default 10 seconds). | |
| TELEGRAM_TRANSCRIBE_MAX_VOICES | No | Maximum number of voice messages 'auto' mode prefetches per listing call (default 5). | |
| TELEGRAM_TRANSCRIBE_OPENAI_URL | No | API base URL for the OpenAI-compatible transcription engine, e.g. https://api.openai.com/v1. | |
| TELEGRAM_TRANSCRIBE_GROQ_MAX_MB | No | Largest recording the groq transcription engine will upload (default 25 MB). | |
| TELEGRAM_TRANSCRIBE_MAX_SECONDS | No | Maximum total seconds 'auto' mode prefetches per listing call (default 300). | |
| TELEGRAM_TRANSCRIBE_OPENAI_MODEL | No | Model name for the OpenAI-compatible transcription endpoint (default whisper-1). | |
| TELEGRAM_RESOLVE_PHONE_STATE_FILE | No | File used to persist the phone-lookup count across restarts. | |
| TELEGRAM_TRANSCRIBE_OPENAI_MAX_MB | No | Largest recording the openai transcription engine will send (default 25 MB). | |
| TELEGRAM_TRANSCRIBE_WHISPER_MODEL | No | Local faster-whisper model name (default 'small'). | |
| TELEGRAM_CONNECTION_CHECK_INTERVAL | No | Seconds between background connection checks for long-running servers (default off; values below 30 are raised to 30). | |
| TELEGRAM_RESOLVE_PHONE_MAX_PER_DAY | No | Maximum resolve_phone lookups per rolling 24 hours (0 or unset = no cap). | |
| TELEGRAM_TRANSCRIBE_OPENAI_API_KEY | No | Bearer token for the OpenAI-compatible transcription endpoint (optional for keyless local servers). | |
| TELEGRAM_TRANSCRIBE_WHISPER_DEVICE | No | Local whisper device: 'auto', 'cpu' or 'cuda'. | |
| TELEGRAM_ALLOW_SERVER_ROOTS_FALLBACK | No | Set to 1 to fall back to server CLI roots when client roots are empty or list_roots fails (default deny-all). | |
| TELEGRAM_TRANSCRIBE_WHISPER_MODEL_DIR | No | Directory where local whisper models are downloaded. | |
| TELEGRAM_TRANSCRIBE_WHISPER_COMPUTE_TYPE | No | Local whisper compute type, e.g. 'int8' on CPU. | |
| TELEGRAM_RESOLVE_PHONE_MIN_INTERVAL_SECONDS | No | Minimum gap between resolve_phone lookups (0 or unset = 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
Server capabilities have not been inspected yet.
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
No tools | |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues