BETTER-TG-CLI.

Telegram CLI and MCP server for AI agents

Better-TG-CLI is an open-source Telegram client for your own account, for Claude Code, Codex, Cursor and the command line. Your agent reads and searches your chats, and asks you before every send.

npm install -g better-tg-cli
Log in without API keysGitHub ↗

Free. One email, one login key for up to 3 computers.

Built for agents, safe for your account

You approve every send

After login the agent shows you the exact action and runs it only after your yes. Writing without asking needs your own confirmation in a terminal or a system dialog, for as long as you choose. Every write goes to an audit log.

60+ commands

Read, search, send, bots, groups, folders and exports.

0 runtime dependencies

One small file. Nothing else to install or audit.

Cheap on tokens

One compact line per item with the ID first, and single-line JSON with empty fields dropped.

Talks to bots

The current Telegram layer: real text in bot replies, menus you can walk and buttons you can press.

Works with your agent

A skill and an MCP server for Claude Code, Codex, Cursor, Claude Desktop and Gemini CLI.

Claude CodeCodexCursorClaude DesktopGemini CLI

About security

This tool logs in as you, so here is exactly what it can and cannot do.

What to keep in mind

The details: Security · Privacy

How login works

Telegram asks every client for app keys. A login key lends you ours, so there is nothing to create on my.telegram.org.

  1. Confirm your email

    We send a six-digit code. The address is kept only for important notices.

  2. Get a login key

    One email, one key. Asking again replaces it with a fresh one.

  3. Log in on up to 3 computers

    Scan a QR code in Telegram on each. Messages and sessions stay on your machines.

Have your own keys from my.telegram.org? Then you do not need a login key: run telegram auth.

Log in without API keys