Skip to main content
MCP server CX Codex

Better Telegram MCP — Claude Code MCP server for Telegram

Hooks your agent up to Telegram: messages, chats, media and contacts. Works either as a bot or as a regular account.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env TELEGRAM_BOT_TOKEN=<TELEGRAM_BOT_TOKEN> --env TELEGRAM_API_ID=<TELEGRAM_API_ID> --env TELEGRAM_API_HASH=<TELEGRAM_API_HASH> --transport stdio better-telegram-mcp -- uvx better-telegram-mcp
Open on GitHub

What Better Telegram MCP does

Two modes share one server. A bot token routes calls through the Bot API over httpx. Swap in account API credentials and it switches to MTProto via Telethon, which opens up a normal user account instead of a bot identity.

Seven tools dispatch by action: message, chat, media, contact, config, help and config__open_relay. Some carry read-only annotations, others are flagged destructive, so the agent has something to reason about before it acts. Docs also arrive as MCP resources under telegram://docs/*.

Signing in as a user goes through the browser. The HTTP relay form takes the phone number, the OTP and the 2FA password; on a single machine the auth CLI does the same job, and login sticks around as a deprecated alias. Skip both a bot token and the API ID/hash pair and the server has no identity to act under. Run locally, the executable starts on stdio by default; HTTP needs --http, MCP_TRANSPORT=http or TRANSPORT_MODE=http.

What it helps with

  • Send a chat message without leaving the agent session
  • Pull media out of a thread and hand it to the project
  • Look up a contact and open the conversation
  • Turn incoming messages into tasks
  • Drive a bot and a personal account from one interface

Example prompts for the agent

  • Post to the dev-team chat that the build failed
  • Find Ivan in contacts and show our latest messages
  • Grab the newest photo from the release chat

How to install Better Telegram MCP

Platform CLI

claude mcp add --env TELEGRAM_BOT_TOKEN=<TELEGRAM_BOT_TOKEN> --env TELEGRAM_API_ID=<TELEGRAM_API_ID> --env TELEGRAM_API_HASH=<TELEGRAM_API_HASH> --transport stdio better-telegram-mcp -- uvx better-telegram-mcp

Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from better-telegram-mcp <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Better Telegram MCP

How do I install Better Telegram MCP in Claude Code?

Run claude mcp add better-telegram-mcp -e TELEGRAM_BOT_TOKEN=<TELEGRAM_BOT_TOKEN> -e TELEGRAM_API_HASH=<TELEGRAM_API_HASH> -- uvx better-telegram-mcp. The user-account variant adds TELEGRAM_API_ID and --transport stdio.

What does Better Telegram MCP do?

It gives the agent Telegram: sending messages, reading chats, media and contacts. Which mode runs depends on whether you supply a bot token or account credentials.

What do I need for user-account mode?

TELEGRAM_API_ID, TELEGRAM_API_HASH and a phone login. In HTTP mode the confirmation code and 2FA password go into a browser form.

Similar MCP servers

MCP servers catalog →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor