Skip to main content
Glama
Telegram MCP Server

Telegram MCP Server

by jkotasjkotas

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_HOSTNoHost to bind for http/sse transports. Default is 127.0.0.1.
MCP_PORTNoPort to bind for http/sse transports. Default is 8765.
GROQ_API_KEYNoGroq API key required when using the groq transcription engine.
MCP_TRANSPORTNoMCP transport: 'stdio' (default), 'http', or 'sse'.
TELEGRAM_API_IDYesTelegram API ID from my.telegram.org/apps.
MCP_ALLOWED_HOSTSNoComma-separated Host headers accepted for http/sse, e.g. mcp.example.com. Supports a :* suffix for any port.
TELEGRAM_API_HASHYesTelegram API hash from my.telegram.org/apps.
TELEGRAM_AUDIT_LOGNoPath for the append-only deletion audit log. Default is telegram_audit.log next to the server.
TELEGRAM_FLOODGATENoSet to 0 to disable the local flood-prevention gate. Enabled by default.
TELEGRAM_LANG_CODENoTelegram client language code.
MCP_ALLOWED_ORIGINSNoComma-separated browser origins allowed to call the http/sse server. Supports a :* suffix for any port.
TELEGRAM_EVENT_FEEDNoSet to 1 to auto-enable the incoming event feed.
TELEGRAM_PROXY_HOSTNoProxy hostname. Per-account overrides use TELEGRAM_PROXY_HOST_<LABEL>.
TELEGRAM_PROXY_PORTNoProxy port. Per-account overrides use TELEGRAM_PROXY_PORT_<LABEL>.
TELEGRAM_PROXY_RDNSNoWhether to use remote DNS for SOCKS proxies, e.g. true.
TELEGRAM_PROXY_TYPENoProxy type: 'socks5', 'socks4', 'http', or 'mtproxy'. Per-account overrides use TELEGRAM_PROXY_TYPE_<LABEL>.
TELEGRAM_TRANSCRIBENoVoice transcription mode: 'off', 'on-demand' (default), or 'auto'.
TELEGRAM_APP_VERSIONNoApp version shown in Telegram active sessions.
TELEGRAM_ALIASES_FILENoOverride the path for the contact aliases store.
TELEGRAM_DEVICE_MODELNoDevice model shown in Telegram active sessions.
TELEGRAM_PROXY_SECRETNoMTProxy secret when TELEGRAM_PROXY_TYPE=mtproxy. Per-account overrides use TELEGRAM_PROXY_SECRET_<LABEL>.
TELEGRAM_SESSION_LOCKNoSession lock mode. Set to 'shared' to allow multiple instances on one host to share the same session.
TELEGRAM_SESSION_NAMENoPath/name for a persistent SQLite Telegram session file. For multi-account setups, use a suffixed variable such as TELEGRAM_SESSION_NAME_<LABEL>.
TELEGRAM_ALLOWED_ROOTSNoSemicolon-, comma-, or colon-separated allowed filesystem roots for file/media tools.
TELEGRAM_CONTACT_FUZZYNoSet to 0 to disable fuzzy contact-name suggestions.
TELEGRAM_EXPOSED_TOOLSNoTool-surface restriction: 'all' (default), 'read-only', or 'read-only+<tool>,<tool>', optionally followed by '-<tool>,<tool>'.
TELEGRAM_EVENT_LOG_SIZENoMaximum number of per-message events kept in memory. Default is 2000; 0 disables the log.
TELEGRAM_MEDIA_BASE_URLNoBase URL clients reach for signed media download/upload URLs, e.g. https://tg.example.com.
TELEGRAM_PROXY_PASSWORDNoOptional proxy password. Per-account overrides use TELEGRAM_PROXY_PASSWORD_<LABEL>.
TELEGRAM_PROXY_USERNAMENoOptional proxy username. Per-account overrides use TELEGRAM_PROXY_USERNAME_<LABEL>.
TELEGRAM_SESSION_STRINGNoTelegram session string. For multi-account setups, use a suffixed variable such as TELEGRAM_SESSION_STRING_<LABEL>.
TELEGRAM_SYSTEM_VERSIONNoSystem version shown in Telegram active sessions.
TELEGRAM_DOWNLOAD_SUBDIRNoSubdirectory under the first allowed root for downloaded media. Default is downloads.
TELEGRAM_EVENT_FEED_FILENoOverride the incoming event feed JSONL path.
TELEGRAM_FILE_EXTENSIONSNoSemicolon-separated tool allowlists in the form tool:.ext,.ext, e.g. send_file:.pdf,.png;upload_file:.pdf,.png.
TELEGRAM_SESSION_STRINGSNoWhitespace-, comma-, or semicolon-separated list of interchangeable session strings for a per-account session pool.
TELEGRAM_ALLOWED_CHAT_IDSNoComma-separated allowed chat IDs or usernames. Forum topics can be restricted with <chat>:<topic id>.
TELEGRAM_BLOCKED_CHAT_IDSNoComma-separated marked chat IDs or usernames to block across all accounts.
TELEGRAM_SYSTEM_LANG_CODENoTelegram system language code.
TELEGRAM_CATCH_UP_INTERVALNoSeconds between catch-up requests for missed updates. Minimum is 30; default 0 means off.
TELEGRAM_EXPECTED_USERNAMENoExpected Telegram username for the account. Per-account checks use TELEGRAM_EXPECTED_USERNAME_<LABEL>.
TELEGRAM_SERVER_ROOTS_ONLYNoSet to 1 to use configured server roots directly and skip roots/list.
TELEGRAM_TRANSCRIBE_ENGINENoDefault transcription engine: 'groq' (default), 'telegram', 'openai', or 'whisper'.
TELEGRAM_LOCK_GRACE_SECONDSNoSeconds a second process waits for an existing session lock before refusing to start. Default is 20.
TELEGRAM_TRANSCRIBE_TIMEOUTNoTimeout in seconds for a single HTTP transcription request. Default is 120.
TELEGRAM_TRANSCRIBE_LANGUAGENoISO-639-1 language hint passed to groq, openai, and whisper transcription engines.
TELEGRAM_TOOL_TIMEOUT_SECONDSNoServer-side ceiling in seconds for every tool call. Default is 55; 0 disables the ceiling.
TELEGRAM_TRANSCRIPT_CACHE_DIRNoDirectory for the local SQLite transcript cache. Default is data/transcripts.
TELEGRAM_FLOOD_SLEEP_THRESHOLDNoMaximum seconds Telethon sleeps silently on FloodWait. Default is 60; 0 disables silent sleeping.
TELEGRAM_ROOTS_TIMEOUT_SECONDSNoTimeout in seconds for roots/list. Default is 10.
TELEGRAM_TRANSCRIBE_MAX_VOICESNoMaximum number of missing voice transcripts prefetched per listing call in auto mode. Default is 5.
TELEGRAM_TRANSCRIBE_OPENAI_URLNoAPI base URL for an OpenAI-compatible /audio/transcriptions endpoint. Required for the openai transcription engine.
TELEGRAM_TRANSCRIBE_GROQ_MAX_MBNoMaximum recording size in MB for the groq transcription engine. Default is 25.
TELEGRAM_TRANSCRIBE_MAX_SECONDSNoMaximum total seconds of audio prefetched per listing call in auto mode. Default is 300.
TELEGRAM_TRANSCRIBE_OPENAI_MODELNoModel name for the OpenAI-compatible transcription endpoint. Default is whisper-1.
TELEGRAM_RESOLVE_PHONE_STATE_FILENoPath to a file that keeps phone-lookup counts across restarts.
TELEGRAM_TRANSCRIBE_OPENAI_MAX_MBNoMaximum recording size in MB for the openai transcription engine. Default is 25.
TELEGRAM_TRANSCRIBE_WHISPER_MODELNoLocal faster-whisper model name. Default is small.
TELEGRAM_RESOLVE_PHONE_MAX_PER_DAYNoMaximum phone lookups per rolling 24 hours. 0 or unset means no cap.
TELEGRAM_TRANSCRIBE_OPENAI_API_KEYNoBearer token for the OpenAI-compatible transcription endpoint. Optional for keyless local servers.
TELEGRAM_TRANSCRIBE_WHISPER_DEVICENoDevice for the whisper engine: 'auto', 'cpu', or 'cuda'.
TELEGRAM_ALLOW_SERVER_ROOTS_FALLBACKNoSet to 1 to fall back to server CLI roots when client MCP Roots are empty or fail.
TELEGRAM_TRANSCRIBE_WHISPER_MODEL_DIRNoDirectory where whisper models are downloaded.
TELEGRAM_TRANSCRIBE_WHISPER_COMPUTE_TYPENoCompute type for the whisper engine, e.g. int8 on CPU.
TELEGRAM_RESOLVE_PHONE_MIN_INTERVAL_SECONDSNoMinimum gap in seconds between phone lookups. 0 or unset means 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