tg-mcp
Provides tools for reading allowed Telegram chats without marking messages as read, including time filtering, search, and pagination, and for sending text messages to allowed chats with hourly rate limits and audit logging.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
tg-mcp
MCP-сервер для Telegram (особистий акаунт, Telethon) із жорстким allowlist чатів. Працює в Docker на домашньому сервері; Claude Desktop на інших машинах підключається до нього через SSH, без відкритих портів.
Claude Desktop (Windows / macOS)
└─ ssh <host> docker exec -i tg-mcp python -m tg_mcp (stdio)
└─ tg-mcp container ── Telethon ── TelegramЩо вміє
list_allowed— список дозволених чатів (аліаси зconfig.toml)read_chat— читання дозволеного чату; повідомлення не позначаються прочитаними; фільтр за годинами, пошук, пагінаціяsend_message— текст лише в дозволені чати; ліміт на годину; кожна відправка пишеться вdata/sent.jsonl
Інструментів для видалення, редагування, пересилання чи адміністрування немає.
Related MCP server: Telegram MCP Server
Безпека
data/session.txtдає повний доступ до акаунта. Не комітьте його й не кладіть у бекапи, яким не довіряєте. Відкликати: Telegram → Налаштування → Пристрої.Сервер не слухає мережу: доступ тільки через
docker execпо SSH з ключем.Усі підключення до Telegram ідуть з однієї машини, тож немає
AUTH_KEY_DUPLICATED.Telegram може обмежити акаунт за автоматизацію; при невеликому обсязі ризик низький, але не нульовий.
Встановлення на сервері
Потрібні Docker і обліковий запис API з https://my.telegram.org/apps.
macOS (zsh):
git clone https://github.com/decadance/tg-mcp.git && cd tg-mcp
./setup.shsetup.sh питає TG_API_ID / TG_API_HASH (хеш приховано), збирає контейнер, запускає вхід у Telegram, зберігає список чатів у data/dialogs.txt і додає сервер у Claude Desktop на цій машині.
Вручну:
cp .env.example .env # TG_API_ID, TG_API_HASH
cp config.example.toml config.toml
mkdir -p data && chmod 700 data
docker compose up -d --build
docker compose exec tg-mcp python -m tg_mcp.login # телефон у форматі +380..., код, 2FA
docker compose exec tg-mcp python -m tg_mcp.dialogs # id чатів для config.tomlЗаповніть config.toml і виконайте docker compose restart tg-mcp.
Підключення з інших машин
Налаштуйте SSH-вхід за ключем:
macOS:
zsh client/setup-ssh-macos.shWindows:
powershell -ExecutionPolicy Bypass -File client\setup-ssh-windows.ps1
Зберіть розширення:
npx @anthropic-ai/mcpb pack client/mcpb tg-mcp.mcpbClaude Desktop → Settings → Extensions → встановіть
tg-mcp.mcpb, вкажіть SSH host (аліас із кроку 1).
Тести
uv run --extra test pytest -qMIT License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Your Telegram, WhatsApp, Instagram, mail and calendar in Claude or ChatGPT. Never sends messages.
Your own WhatsApp in Claude and ChatGPT: read chats, draft replies, send messages you approve.
Hosted Telegram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude Code to send and receive messages via Telegram for remote interaction and approval of sensitive operations.8266 npm8MIT
- FlicenseNot gradedqualityFmaintenanceEnables Claude to interact with your Telegram account, including reading messages, searching conversations, and sending messages.-
- FlicenseNot gradedqualityDmaintenanceEnables Claude to interact with Telegram, including listing chats, reading messages, sending messages, searching, and managing contacts.1-
- AlicenseNot gradedqualityDmaintenanceEnables Claude to send messages, media, and manage Telegram chat messages through a Telegram bot, including sending photos, documents, and editing or deleting messages.MIT