Telegram MCP
Connects a personal Telegram account to AI agents, enabling them to list chats, read and search message history without marking it read, download photos and documents, and send messages or files only with explicit confirmation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Telegram MCPsearch my chats for any messages about the invoice"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Telegram MCP
MCP-сервер для личного Telegram. ИИ-агент — Claude Code, Codex и другие
MCP-клиенты — находит чаты, читает и ищет переписку, скачивает вложения.
Сообщения и файлы отправляет только с confirm: true, по прямой просьбе.
Отдельная сессия MTProto (GramJS), stdio, без браузера и без tdata.
Документация: https://sonicxboy.dev/products/telegram-mcp/
Установка
Нужен Node.js (проверено на 22).
git clone https://github.com/vixkosla/telegram-mcp.git
cd telegram-mcp
npm ciНа https://my.telegram.org → API development tools создайте приложение и запишите ключи в
~/.config/telegram-mcp/config.json(права0600):{"apiId": 123456, "apiHash": "32-символьный hex"}Вместо файла можно задать
TELEGRAM_API_IDиTELEGRAM_API_HASH, другой путь к файлу — черезTELEGRAM_MCP_CONFIG. Если MTProto не доходит до Telegram, добавьте"proxy": "socks5://127.0.0.1:1080".Войдите:
node server.mjs login— телефон, код из Telegram, при необходимости облачный пароль. Сессия сохранится вsession.txtрядом с сервером (права0600). Не копируйте и не публикуйте этот файл.Подключите к клиенту.
Claude Code:
claude mcp add telegram -- node /path/to/telegram-mcp/server.mjsCodex (
~/.codex/config.toml):[mcp_servers.telegram] command = "node" args = ["/path/to/telegram-mcp/server.mjs"] startup_timeout_sec = 20Cursor, Claude Desktop и другие:
{"mcpServers": {"telegram": {"command": "node", "args": ["/path/to/telegram-mcp/server.mjs"]}}}Попросите агента вызвать
status.
Related MCP server: telegram-user-mcp
Инструменты
Инструмент | Что делает |
| Есть ли вход и под каким аккаунтом |
| Последние чаты, поиск по имени и @username, архив |
| История чата постранично, без отметки о прочтении |
| Поиск по всем чатам или внутри одного |
| Фото и документы до 20 сообщений, до 50 МБ на файл, в |
| Текст до 4096 символов, |
| Локальный файл до 50 МБ по абсолютному пути, |
| Вход по коду и облачному паролю |
| Закрывает только эту сессию, |
peer — id из list_dialogs, @username или title:Название.
Безопасность
Отдельное устройство в списке сессий Telegram;
logoutне трогает другие.Отправка и выход без
confirm: trueне выполняются.Текст сообщений и содержимое файлов — чужой ввод: сервер просит агента не выполнять инструкции из них.
session.txt,pending.jsonи скачанные файлы пишутся с правами0600.Длинные токены вырезаются из ошибок, телефон показывается последними четырьмя цифрами.
send_fileотправляет любой читаемый файл по абсолютному пути. Разрешайте отправку только тех файлов, которые проверили сами.
English
MCP server that connects a personal Telegram account to AI agents (Claude
Code, Codex, any stdio MCP client): list chats, read and search history
without marking it read, download media, and send messages or files only with
confirm: true. Uses its own MTProto session via GramJS. Setup: create an app
at my.telegram.org, put apiId/apiHash in
~/.config/telegram-mcp/config.json, run node server.mjs login, then add
node /path/to/server.mjs to your MCP client.
Лицензия
MIT © SonicXBoy
This server cannot be deployed
Maintenance
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
- UxenOAuthcom.rrrfirstchat
Your Telegram, WhatsApp, Instagram, mail and calendar in Claude or ChatGPT. Never sends messages.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceConnects AI agents to Telegram via the official TDLib library, enabling tools like getting user info, listing dialogs, and searching messages.-
- AlicenseNot gradedqualityCmaintenanceIntegrates Telegram user account with MCP, exposing operations like reading and sending messages, managing chats, and more via stdio or SSE transport.Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to operate a Telegram account through the same commands as the terminal client: messaging, chat management, voice transcription, calls, stickers, and privacy settings.1MIT
- AlicenseNot gradedqualityCmaintenanceLets any MCP-compatible AI agent read, search, and send Telegram messages through your real account via MTProto.38 npm1MIT