Telegram on your own account: read, search, send and press bot buttons. Writes need your approval.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.
An unofficial, agent-friendly command-line client for Telegram that runs on your own account
(MTProto via teleproto, TL layer 229). The command is
telegram: about 60 commands for reading, searching, writing, bots, groups and exports, built so
that AI agents (Claude Code, Codex, …) can drive it cheaply and safely.
[!WARNING] Your account, your risk. This is an unofficial client that logs in as you. Telegram may limit or freeze accounts that behave like bots. The risk is highest for new accounts, bulk messaging, mass joins or invites, and anything that looks like spam. Use it the way you would use Telegram yourself, keep writes off unless you need them, and read SECURITY.md before letting an agent write. The authors are not responsible for restricted accounts.
Contents: Why this fork · Install · Log in · Usage · MCP server · FAQ · Development · Privacy · License
A fork of skillhq/telegram, reworked for agents:
(no text). You can press bot buttons (click) and walk bot menus.--max-text trims long posts. telegram help-all -g <word> prints every flag, generated from the code.--since/--until, --unread, threads and channel
comments, forum topics, get by ID, search filters by type, sender or date, and me / Избранное
for Saved Messages.write-access on [--for 1h]
and confirms it in a terminal prompt or a macOS dialog, so an agent cannot switch it on itself.
Every write is logged to ~/.config/tg/audit.jsonl. Secrets live in the macOS Keychain, the
Linux Secret Service or 1Password.telegram update upgrades an existing install, whichever of these you used. On a terminal the CLI
checks for new versions once a day. Agents and pipes never see that notice, and
TG_NO_UPDATE_CHECK=1 turns it off.
Downloading a binary from Releases by hand on macOS? It is not notarized, so remove the
quarantine flag once: xattr -d com.apple.quarantine ./telegram. Homebrew handles this for you.
Do not install @skillhq/telegram. It is the old upstream build on GramJS (layer 198).
Every channel ships the same version from one release:
| Where | What you get | Install |
|---|---|---|
| Homebrew | standalone binary | brew install thevilfer/tap/better-tg-cli |
| npm | CLI and MCP server (Node 20+) | npm install -g better-tg-cli |
| GitHub Releases | binaries and SHA256SUMS | download by hand |
| Claude Code plugin | skill and MCP server | see below |
| Claude Desktop extension | MCP server, runs on Claude's built-in Node | download .mcpb and open it |
| Grok Build plugin | skill and MCP server | see below |
| Gemini CLI extension | skill and MCP server | gemini extensions install https://github.com/TheVilfer/better-tg-cli |
| Cursor, VS Code | MCP server | one-click buttons |
| Grok Bot | MCP server over HTTP from your Mac | see below |
| The CLI itself | agent skill for Claude Code, Codex, Cursor, Gemini CLI and 7 more | telegram skill install |
| skills.sh | agent skill for any shell agent | npx skills add TheVilfer/better-tg-cli |
| MCP Registry | MCP server entry io.github.TheVilfer/better-tg-cli | through your MCP client |
The skill and the MCP server together, in one install:
It runs the MCP server through npx, so Node 20+ is enough. Log in once with telegram auth --qr
(or npx better-tg-cli auth --qr) in a terminal.
Grok Build installs the same plugin, skill and MCP server together:
The skill (skills/better-tg-cli) teaches any agent with a shell
(Claude Code, Codex, Cursor, Gemini CLI, OpenCode and others) to use the CLI safely. It checks the
setup, never logs in on its own, keeps writes behind your approval, and avoids ban-prone patterns.
The CLI carries the skill and installs it itself, so it always matches your version:
It knows Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Grok Build, OpenCode, Goose,
Droid, Windsurf and Pi (telegram skill status lists the folders). Run it again after
telegram update to refresh the skill. A skill folder that is a symlink is left alone unless you
pass --force. For other agents, use the skills CLI:
Through your agent (easiest): ask it to set up Telegram, or run telegram onboard yourself. It
opens a page on 127.0.0.1 where you get an invite from better-tg-cli.com
(it comes back to the page by itself) or enter your own keys, scan a QR code and type your 2FA
password. The agent only starts the command and waits: it never sees the invite, the QR code or the
password. The page answers only on a random secret path and closes when you're done.
With your own API keys (the default):
api_id and api_hash.telegram auth --qr and enter them. Then, on your phone, go to Settings → Devices → Link
Desktop Device and scan the QR code. Enter your 2FA password if you have one. Plain
telegram auth asks for your phone number and a login code instead. If the QR won't scan on a
light terminal theme, run with TG_QR_INVERT=1.No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/better-tg-cli-telegram)<a href="https://allmcps.com/mcp/better-tg-cli-telegram"><img src="https://allmcps.com/api/badge/better-tg-cli-telegram?style=directory" alt="Better Tg Cli (Telegram) on AllMCPs" /></a>