From a6eda4c7d69bfada82e377cfc81ec5d2b957e2d2 Mon Sep 17 00:00:00 2001 From: Oleg Proskurin Date: Tue, 2 Jun 2026 11:26:47 +0700 Subject: [PATCH] docs: add telegram --- docs/telegram-integration.md | 135 +++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 docs/telegram-integration.md diff --git a/docs/telegram-integration.md b/docs/telegram-integration.md new file mode 100644 index 0000000..125ab0d --- /dev/null +++ b/docs/telegram-integration.md @@ -0,0 +1,135 @@ +# 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 `_