Write the Telegram credentials file
telegram_setupCreate or update the .env file for telegram-mcp with Telegram API ID, API hash, optional phone, and full-chat access settings; restart the server to apply changes.
Instructions
Create or update the .env file this server loads: TELEGRAM_API_ID, TELEGRAM_API_HASH, optional TELEGRAM_PHONE, and TELEGRAM_ALLOW_ALL_CHATS. Get api_id/api_hash from https://my.telegram.org/apps. Never call this with a hash the user pasted in chat unless they asked you to; the hash is written to disk and never returned. Existing other keys in .env are preserved. The MCP server must be restarted to pick up new values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiId | No | Numeric App api_id from my.telegram.org/apps, e.g. "1234567". | |
| force | No | Rewrite an already-configured .env. Only when the user asks. | |
| phone | No | International phone number with leading +, e.g. +15551234567. | |
| apiHash | No | App api_hash from my.telegram.org/apps (32 hex chars). | |
| allowAllChats | No | Full access to every chat the account can reach. true unless the user wants a restriction. |