# Telegram MCP — setup on a new machine Reproduces the working integration this project uses: read Oleg's Telegram channels/DMs as a user (MTProto, not a bot) through the `chigwell/telegram-mcp` server, registered in Claude Code + Claude Desktop. Time: ~10 minutes. Most of it is one-time Telegram credentials. --- ## 0. Prereqs - `git`, `curl`, `jq`, `node` (for `npx`) - A clone of this repo (`cv-2026`) — it holds the `.env` shape and the CLAUDE.md safety policy that govern this integration. --- ## 1. Get Telegram API credentials (one-time per Telegram account) Open https://my.telegram.org/apps and create a new application: - **App title:** anything (e.g. `telegram-mcp`) - **Short name:** 5–32 alphanumeric, e.g. `tgmcp` - **URL:** *must not be empty* — put `https://t.me` (form says optional but errors otherwise) - **Platform:** Desktop - **Description:** optional You'll get `api_id` (number) and `api_hash` (32-char hex). Treat them like a password. If you see a generic `ERROR` popup, fill in the URL field — that's the most common cause. Save both into the project `.env`: ``` TELEGRAM_API_ID= TELEGRAM_API_HASH= TELEGRAM_SESSION_STRING= ``` Confirm `.env` is in `.gitignore`. --- ## 2. Install the server (Python, isolated via `uv`) The server is `chigwell/telegram-mcp` — a Telethon-based MCP server. Python lives inside its own `uv`-managed venv, nothing leaks into the project. ```bash # install uv if missing (goes into ~/.local/bin, no sudo) curl -LsSf https://astral.sh/uv/install.sh | sh # clone + sync (creates .venv with locked deps) mkdir -p /projects/my-utils && cd /projects/my-utils git clone https://github.com/chigwell/telegram-mcp.git telegram cd telegram ~/.local/bin/uv sync ``` Two binaries appear at `/projects/my-utils/telegram/.venv/bin/`: - `telegram-mcp` — the MCP server - `telegram-mcp-generate-session` — one-shot session-string generator --- ## 3. Generate the session string (one-time, interactive) From the cv-2026 project root (where `.env` lives): ```bash set -a && source .env && set +a && \ /projects/my-utils/telegram/.venv/bin/telegram-mcp-generate-session ``` At the prompts: - **Account label:** *leave empty* (Enter). A label adds a `_