@@ -84,6 +84,18 @@ uv run session_string_generator.py
8484
8585Follow the prompts. Save the generated session string securely.
8686
87+ For scripted setup or operational runbooks, choose the login method explicitly:
88+
89+ ``` bash
90+ # QR login, recommended when you already have Telegram open on another device
91+ uv run session_string_generator.py --qr
92+
93+ # Phone number + verification code login
94+ uv run session_string_generator.py --phone
95+ ```
96+
97+ Without a flag, the generator keeps the interactive method prompt.
98+
8799### 3. Configure Environment
88100
89101Copy the example file and fill in your real values:
@@ -380,10 +392,11 @@ Telegram messages, display names, chat titles, and button labels are untrusted c
380392## Troubleshooting
381393
382394- ** No Telegram session configured:** set ` TELEGRAM_SESSION_STRING ` , ` TELEGRAM_SESSION_NAME ` , or suffixed multi-account variants.
383- - ** Session is not authorized:** run ` uv run session_string_generator.py ` outside
384- the MCP server, use QR login when possible, then set ` TELEGRAM_SESSION_STRING `
385- in ` .env ` . The MCP server does not perform interactive phone-code login over
386- stdio.
395+ - ** Session is not authorized:** run ` uv run session_string_generator.py --qr ` outside
396+ the MCP server when you can scan from an existing Telegram app, or
397+ ` uv run session_string_generator.py --phone ` when you need phone-code login.
398+ Then set ` TELEGRAM_SESSION_STRING ` in ` .env ` . The MCP server does not perform
399+ interactive phone-code login over stdio.
387400- ** Invalid API credentials:** verify ` TELEGRAM_API_ID ` and ` TELEGRAM_API_HASH ` at [ my.telegram.org/apps] ( https://my.telegram.org/apps ) .
388401- ** Database is locked:** prefer string sessions, or make sure no other process is using the same file session.
389402- ** File tools are disabled:** pass allowed roots or configure MCP Roots in your client.
0 commit comments