Skip to main content
Glama
Telegram MCP Server

Telegram MCP Server

by Benornm

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_HOSTNoBind host for http and sse transports (default 127.0.0.1).
MCP_PORTNoBind port for http and sse transports (default 8765).
GROQ_API_KEYNoGroq API key required whenever the groq transcription engine is used.
MCP_TRANSPORTNoTransport: 'stdio' (default), 'http' (streamable HTTP) or 'sse' (legacy SSE).
TELEGRAM_API_IDYesTelegram API ID from my.telegram.org/apps.
MCP_ALLOWED_HOSTSNoComma-separated Host headers accepted by http/sse; replaces the local default list; supports a ':*' port suffix.
TELEGRAM_API_HASHYesTelegram API hash from my.telegram.org/apps.
TELEGRAM_AUDIT_LOGNoPath to the append-only JSONL deletion audit log (defaults to telegram_audit.log next to the server).
TELEGRAM_FLOODGATENoSet to 0 to disable the local flood-prevention gate (enabled by default).
TELEGRAM_LANG_CODENoLanguage code sent to Telegram (default en).
MCP_ALLOWED_ORIGINSNoComma-separated browser origins allowed to call the http/sse server; replaces the local default list.
TELEGRAM_EVENT_FEEDNoSet to 1 to auto-enable the incoming event feed (callback mode).
TELEGRAM_PROXY_HOSTNoProxy hostname.
TELEGRAM_PROXY_PORTNoProxy port.
TELEGRAM_PROXY_RDNSNoRemote DNS setting for SOCKS proxies.
TELEGRAM_PROXY_TYPENoProxy type: 'socks5', 'socks4', 'http' or 'mtproxy'.
TELEGRAM_TRANSCRIBENoVoice transcription mode: 'off', 'on-demand' (default) or 'auto'.
TELEGRAM_APP_VERSIONNoApp version shown in Telegram Settings > Devices (default 1.0).
TELEGRAM_ALIASES_FILENoOverride the path of the remembered-contact aliases file.
TELEGRAM_DEVICE_MODELNoDevice model shown in Telegram Settings > Devices (default 'Telegram MCP').
TELEGRAM_PROXY_SECRETNoMTProxy secret, required when TELEGRAM_PROXY_TYPE=mtproxy.
TELEGRAM_SESSION_LOCKNoPer-session lock mode: 'exclusive' (default) or 'shared' to let instances on the same host share one session.
TELEGRAM_SESSION_NAMENoPath to a persistent SQLite file session, e.g. /absolute/path/to/telegram_mcp_session. Alternative to TELEGRAM_SESSION_STRING.
TELEGRAM_VIDEO_MAX_MBNoVideos above this size are refused before download by view_video (default 200 MB).
TELEGRAM_ALLOWED_ROOTSNoSemicolon-, comma- or (POSIX) colon-separated file roots allowed for file-path and media tools.
TELEGRAM_CONTACT_FUZZYNoSet to 0 to disable fuzzy contact-alias suggestions (enabled by default).
TELEGRAM_EXPOSED_TOOLSNoTool surface: 'all' (default), 'read-only', or 'read-only+<tool>,<tool>', optionally followed by '-<tool>,<tool>' to hide tools.
TELEGRAM_EVENT_LOG_SIZENoSize of the in-memory per-message event log (default 2000); 0 turns it off.
TELEGRAM_MCP_HTTP_TOKENNoBearer token required by authenticated streamable HTTP transport and MCP Events webhook subscriptions.
TELEGRAM_MEDIA_BASE_URLNoPublic base URL for signed download and upload URLs when clients run on another machine, e.g. https://tg.example.com.
TELEGRAM_PROXY_PASSWORDNoOptional proxy password.
TELEGRAM_PROXY_USERNAMENoOptional proxy username.
TELEGRAM_SESSION_STRINGNoTelegram session string generated by session_string_generator.py. Multi-account setups use suffixed variants such as TELEGRAM_SESSION_STRING_WORK.
TELEGRAM_SYSTEM_VERSIONNoSystem version shown in Telegram Settings > Devices (default 1.0).
TELEGRAM_DOWNLOAD_SUBDIRNoSubdirectory under the first allowed root where downloads are saved (default downloads).
TELEGRAM_EVENT_FEED_FILENoOverride the path of the incoming event feed JSONL file.
TELEGRAM_FILE_EXTENSIONSNoPer-tool extension allowlists in 'tool:.ext,.ext' form, entries separated by ';', e.g. send_file:.pdf,.png;upload_file:.pdf.
TELEGRAM_SESSION_STRINGSNoWhitespace-, 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_IDSNoComma-separated allowlist of marked chat IDs and/or usernames; supports '<chat>:<topic id>' entries for forum topics.
TELEGRAM_BLOCKED_CHAT_IDSNoComma-separated blocklist of marked chat IDs and/or usernames excluded across all accounts.
TELEGRAM_SYSTEM_LANG_CODENoSystem language code sent to Telegram (default en).
TELEGRAM_CATCH_UP_INTERVALNoSeconds between catch-up requests for updates missed while offline (default 0, off; minimum 30).
TELEGRAM_EXPECTED_USERNAMENoRefuse to start when the session belongs to a different account. Per-account variant TELEGRAM_EXPECTED_USERNAME_<LABEL> is also supported.
TELEGRAM_SERVER_ROOTS_ONLYNoSet to 1 to use server roots directly and skip roots/list; client roots are then ignored.
TELEGRAM_TRANSCRIBE_ENGINENoDefault transcription engine: 'groq' (default), 'telegram', 'openai' or 'whisper'.
TELEGRAM_LOCK_GRACE_SECONDSNoSeconds a second instance waits for the exclusive session lock before refusing to start (default 20).
TELEGRAM_TRANSCRIBE_TIMEOUTNoSeconds allowed for a single request to the HTTP transcription engines (default 120).
TELEGRAM_TRANSCRIBE_LANGUAGENoISO-639-1 language hint passed to every transcription engine except telegram; unset means auto-detect.
TELEGRAM_TOOL_TIMEOUT_SECONDSNoServer-side ceiling for every tool call (default 55); 0 means unbounded.
TELEGRAM_TRANSCRIPT_CACHE_DIRNoDirectory for the voice-transcription SQLite cache (default data/transcripts).
TELEGRAM_FLOOD_SLEEP_THRESHOLDNoMaximum seconds Telethon sleeps silently on FloodWait (default 60); 0 disables silent sleeping.
TELEGRAM_ROOTS_TIMEOUT_SECONDSNoTimeout for roots/list (default 10 seconds).
TELEGRAM_TRANSCRIBE_MAX_VOICESNoMaximum number of voice messages 'auto' mode prefetches per listing call (default 5).
TELEGRAM_TRANSCRIBE_OPENAI_URLNoAPI base URL for the OpenAI-compatible transcription engine, e.g. https://api.openai.com/v1.
TELEGRAM_TRANSCRIBE_GROQ_MAX_MBNoLargest recording the groq transcription engine will upload (default 25 MB).
TELEGRAM_TRANSCRIBE_MAX_SECONDSNoMaximum total seconds 'auto' mode prefetches per listing call (default 300).
TELEGRAM_TRANSCRIBE_OPENAI_MODELNoModel name for the OpenAI-compatible transcription endpoint (default whisper-1).
TELEGRAM_RESOLVE_PHONE_STATE_FILENoFile used to persist the phone-lookup count across restarts.
TELEGRAM_TRANSCRIBE_OPENAI_MAX_MBNoLargest recording the openai transcription engine will send (default 25 MB).
TELEGRAM_TRANSCRIBE_WHISPER_MODELNoLocal faster-whisper model name (default 'small').
TELEGRAM_CONNECTION_CHECK_INTERVALNoSeconds between background connection checks for long-running servers (default off; values below 30 are raised to 30).
TELEGRAM_RESOLVE_PHONE_MAX_PER_DAYNoMaximum resolve_phone lookups per rolling 24 hours (0 or unset = no cap).
TELEGRAM_TRANSCRIBE_OPENAI_API_KEYNoBearer token for the OpenAI-compatible transcription endpoint (optional for keyless local servers).
TELEGRAM_TRANSCRIBE_WHISPER_DEVICENoLocal whisper device: 'auto', 'cpu' or 'cuda'.
TELEGRAM_ALLOW_SERVER_ROOTS_FALLBACKNoSet 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_DIRNoDirectory where local whisper models are downloaded.
TELEGRAM_TRANSCRIBE_WHISPER_COMPUTE_TYPENoLocal whisper compute type, e.g. 'int8' on CPU.
TELEGRAM_RESOLVE_PHONE_MIN_INTERVAL_SECONDSNoMinimum 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

NameDescription

No tools

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources