Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

Better-TG-CLI (Telegram)

MCP server by TheVilfer Community

Better-TG-CLI is a Telegram CLI and MCP server that lets AI agents read, search and send messages on your own account. You approve every send, edit or delete in the chat before it happens.

  • Score 82
  • 14 stars
  • 1.1k a week
  • MIT
  • Updated

Install Better-TG-CLI (Telegram)

Built from the published package, never by AI.

claude mcp add better-tg-cli-telegram -- npx -y better-tg-cli

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install Better-TG-CLI (Telegram) in Claude Code

MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the better-tg-cli-telegram block.

About

Better-TG-CLI is a Telegram CLI and MCP server for AI agents such as Claude Code, Codex, Cursor and Claude Desktop. It works on your own Telegram account, so agents can read, search and send messages and press bot buttons. The command is `telegram`, with about 60 commands for reading, searching, writing, bots, groups and exports.

After login, the agent asks you in the chat before each send, edit or delete and shows the exact text. Writes are logged to a local audit file, and secrets are kept in the macOS Keychain, the Linux Secret Service or 1Password. It is an unofficial, open-source client built on teleproto, and it suits people who want an AI agent to work in their own Telegram account.

Written from the project's README and checked against it.

Tools it gives your assistant

  • inboxLists unread chats and recent activity on your Telegram account (CLI command).
  • readReads messages from a chat, with JSON output for agents (CLI command).
  • searchSearches messages with filters for type, sender or date (CLI command).
  • sendSends messages only after you approve the exact text in the chat (CLI command).
  • clickPresses bot buttons and walks through bot menus (CLI command).
  • getFetches a single message by its ID (CLI command).
  • mcpRuns the CLI as an MCP server with the `telegram mcp` command.
  • skill installInstalls the agent skill for supported agents found on the machine.

What you need

  • A Telegram account
  • Telegram API keys from my.telegram.org, or a login key from better-tg-cli.com
  • Node.js 20 or later for the npm install, or Homebrew for the standalone binary
  • macOS, Linux, or Windows (experimental)
SettingNeededWhat it is
TG_PROFILEEnvironment variableOptionalOptional profile name, to keep this client on a separate Telegram session

From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.

Try asking

  • Show me my unread Telegram chats and the latest messages in each
  • Search my Telegram for messages from Alice about the meeting last week
  • Draft a reply to Bob in Telegram and ask me before you send it

Good to know

  • Unofficial client: Telegram may limit or freeze accounts that behave like bots.
  • Writes need your approval, and turning on unattended writes needs your own confirmation.
  • Windows support is marked experimental.
  • Without a working Linux Secret Service, the write mode is kept in a plain file and guards against mistakes only.

Security check

C
  • Asks for administrator rights (sudo)In README.md: `sudo

Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to Better-TG-CLI (Telegram)

All alternatives →

Compare with Jitsu, Vexa or Linkedin MCP server

Better-TG-CLI (Telegram): common questions

Is Better-TG-CLI an official Telegram client?

No. The project describes itself as an unofficial, open-source client that uses MTProto through the teleproto library.

Can the agent send messages without asking first?

By default the agent asks you in the chat before each send, edit or delete. Writing without asking requires `write-access on`, which you confirm in a terminal or a macOS dialog.

Does using it put my Telegram account at risk?

The README warns that Telegram may limit or freeze accounts that behave like bots. The risk is highest for new accounts, bulk messaging, mass joins or invites, and spam-like activity.

How do I install Better-TG-CLI (Telegram)?

In Claude Code run claude mcp add better-tg-cli-telegram -- npx -y better-tg-cli. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is Better-TG-CLI (Telegram) the official server?

Better-TG-CLI (Telegram) is a community project by TheVilfer, not verified by a company domain.

Is Better-TG-CLI (Telegram) free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is Better-TG-CLI (Telegram) safe to use?

It scores 82 of 100. Grades: maintenance A, licence A, quality C. Security check: grade C (asks for administrator rights (sudo)). Review the code before you install. How grades work.

What are alternatives to Better-TG-CLI (Telegram)?

Similar MCP servers: Jitsu, Vexa, Linkedin MCP server, Netsapiens MCP.

Does Better-TG-CLI (Telegram) work with ChatGPT?

Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.

Better-TG-CLI (Telegram) Install

Add to stack

Loading.