telegram — плагин для Claude Code: мост в Telegram
Подключает Telegram-бота к сессии Claude через MCP-сервер: бот отвечает, ставит реакции и правит сообщения.
/plugin install telegram@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-officialЧто делает telegram
Плагин поднимает MCP-сервер, который логинится в Telegram как бот и отдаёт ассистенту инструменты reply, react и edit_message. Вы пишете боту в личку — сообщение уходит в вашу сессию Claude, а ответ возвращается в чат. Входящие фото скачиваются в ~/.claude/channels/telegram/inbox/, путь попадает в уведомление, и ассистент читает файл.
Сервер работает на Bun, поэтому Bun нужен заранее. Токен бота берётся у @BotFather и кладётся командой /telegram:configure в ~/.claude/channels/telegram/.env; переменную можно задать и в шелле, тогда она перебивает файл. Без флага --channels при запуске сессии сервер не подключится — это частая точка, где всё молча не работает.
Доступ закрывается через /telegram:access: сначала пара по шестизначному коду, потом политика allowlist, чтобы посторонние не получали ответы с кодом. Истории сообщений и поиска в Bot API нет, бот видит только то, что приходит сейчас. Если ассистенту нужен старый контекст, он попросит вставить или пересказать.
Какие задачи решает
- отвечать на сообщения в Telegram прямо из сессии Claude
- ставить реакцию на конкретное сообщение по его ID
- править своё сообщение, показывая прогресс вместо «working…»
- ограничить доступ к боту списком разрешённых пользователей
- принимать фото из чата и читать их локально
Примеры запросов агенту
- настрой бота токеном из BotFather
- свяжи мой аккаунт кодом пары
- переключи политику доступа на allowlist
Как установить telegram
Через маркетплейс плагинов
/plugin install telegram@claude-plugins-official/plugin marketplace add anthropics/claude-plugins-officialПо шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой
Из того же набора123
Весь набор →Похожие
Рядом в каталоге
Каталог плагинов →Вопросы о telegram
Как установить telegram в Claude?
Сначала добавьте маркетплейс: /plugin marketplace add anthropics/claude-plugins-official. Затем поставьте плагин: /plugin install telegram@claude-plugins-official.
Что делает плагин telegram?
Соединяет Telegram-бота с вашей сессией Claude через MCP-сервер. Бот принимает сообщения, а ассистент отвечает, ставит реакции и редактирует отправленное.
Почему бот не отвечает после установки?
Сервер подключается только при запуске с флагом --channels plugin:telegram@claude-plugins-official. Выйдите из сессии и стартуйте заново с этим флагом.
Исходный текст
telegram · Apache-2.0
# Telegram Connect a Telegram bot to your Claude Code with an MCP server. The MCP server logs into Telegram as a bot and provides tools to Claude to reply, react, or edit messages. When you message the bot, the server forwards the message to your Claude Code session. ## Prerequisites - [Bun](https://bun.sh) — the MCP server runs on Bun. Install with `curl -fsSL https://bun.sh/install | bash`. ## Quick Setup > Default pairing flow for a single-user DM bot. See [ACCESS.md](./ACCESS.md) for groups and multi-user setups. **1. Create a bot with BotFather.** Open a chat with [@BotFather](https://t.me/BotFather) on Telegram and send `/newbot`. BotFather asks for two things: - **Name** — the display name shown in chat headers (anything, can contain spaces) - **Username** — a unique handle ending in `bot` (e.g. `my_assistant_bot`). This becomes your bot's link: `t.me/my_assistant_bot`. BotFather replies with a token that looks like `123456789:AAHfiqksKZ8...` — that's the whole token, copy it including the leading number and colon. **2. Install the plugin.** These are Claude Code commands — run `claude` to start a session first. Install the plugin: ``` /plugin install telegram@claude-plugins-official ``` **3. Give the server the token.** ``` /telegram:configure 123456789:AAHfiqksKZ8... ``` Writes `TELEGRAM_BOT_TOKEN=...` to `~/.claude/channels/telegram/.env`. You can also write that file by hand, or set the variable in your shell environment — shell takes precedence. > To run multiple bots on one machine (different tokens, separate allowlists), point `TELEGRAM_STATE_DIR` at a different directory per instance. **4. Relaunch with the channel flag.** The server won't connect without this — exit your session and start a new one: ```sh claude --channels plugin:telegram@claude-plugins-official ``` **5. Pair.** With Claude Code running from the previous step, DM your bot on Telegram — it replies with a 6-character pairing code. If the bot doesn't respond, make sure your session is running with `--channels`. In your Claude Code session: ``` /telegram:access pair <code> ``` Your next DM reaches the assistant. > Unlike Discord, there's no server invite step — Telegram bots accept DMs immediately. Pairing handles the user-ID lookup so you never touch numeric IDs. **6. Lock it down.** Pairing is for capturing IDs. Once you're in, switch to `allowlist` so strangers don't get pairing-code replies. Ask Claude to do it, or `/telegram:access policy allowlist` directly. ## Access control See **[ACCESS.md](./ACCESS.md)** for DM policies, groups, mention detection, delivery config, skill commands, and the `access.json` schema. Quick reference: IDs are **numeric user IDs** (get yours from [@userinfobot](https://t.me/userinfobot)). Default policy is `pairing`. `ackReaction` only accepts Telegram's fixed emoji whitelist. ## Tools exposed to the assistant | Tool | Purpose | | --- | --- | | `reply` | Send to a chat. Takes `chat_id` + `text`, optionally `reply_to` (message ID) for native threading and `files` (absolute paths) for attachments. Images (`.jpg`/`.png`/`.gif`/`.webp`) send as photos with inline preview; other types send as documents. Max 50MB each. Auto-chunks text; files send as separate messages after the text. Returns the sent message ID(s). | | `react` | Add an emoji reaction to a message by ID. **Only Telegram's fixed whitelist** is accepted (👍 👎 ❤ 🔥 👀 etc). | | `edit_message` | Edit a message the bot previously sent. Useful for "working…" → result progress updates. Only works on the bot's own messages. | Inbound messages trigger a typing indicator automatically — Telegram shows "botname is typing…" while the assistant works on a response. ## Photos Inbound photos are downloaded to `~/.claude/channels/telegram/inbox/` and the local path is included in the `<channel>` notification so the assistant can `Read` it. Telegram compresses photos — if you need the original file, send it as a document instead (long-press → Send as File). ## No history or search Telegram's Bot API exposes **neither** message history nor search. The bot only sees messages as they arrive — no `fetch_messages` tool exists. If the assistant needs earlier context, it will ask you to paste or summarize. This also means there's no `download_attachment` tool for historical messages — photos are downloaded eagerly on arrival since there's no way to fetch them later.
© anthropics · Apache-2.0 · anthropics/claude-plugins-official