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

Tgcli

MCP server by kfastov Verified · npm:@kfastov

Runs tgcli, a Telegram command-line tool with background sync and an optional MCP server for a personal Telegram account. It suits people who want to search, read and send Telegram messages from a terminal or an AI assistant.

  • Score 75
  • 46 stars
  • 46 a week
  • MIT
  • Updated

Install Tgcli

Built from the published package, never by AI.

claude mcp add tgcli -- npx -y @kfastov/tgcli

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

Step-by-step: install Tgcli 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 tgcli block.

About

tgcli is a command-line tool for Telegram. It works with a personal account through MTProto rather than the Bot API. After you authenticate with your Telegram api_id and api_hash, it can run archive backfill and realtime sync in the background. You can list and search messages and channels, send text or files, download media, and manage topics, contacts and groups. Add --json to any command for machine-readable output.

The MCP server is optional and off by default. You turn it on with tgcli config set mcp.enabled true. It binds to http://127.0.0.1:8080/mcp unless you change the host or port, and you point your MCP client at that address. The project is aimed at people who want their own Telegram data available from the terminal or from AI tools. Developers can run it from a clone with Node 22.

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

What you need

  • A Telegram account with a phone number
  • Telegram API credentials (api_id and api_hash) from my.telegram.org
  • npm or Homebrew to install the tool

Try asking

  • Search my Telegram chat with @channel for the word course
  • Send a hello message to @username on Telegram
  • Show the last 20 messages from a Telegram chat

Good to know

  • Uses a personal Telegram account through MTProto, not the Bot API.
  • The MCP server stays off until mcp.enabled is set to true.
  • A server you started by hand keeps running old code after an upgrade until you restart it.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

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

What you can do with it

  • Search Telegram chat history
  • Send Telegram messages from the terminal
  • Sync Telegram chats to a local archive

Alternatives to Tgcli

All alternatives →

Compare with Jitsu, Vexa or Linkedin MCP server

Tgcli: common questions

Does tgcli use the Telegram Bot API?

No. The source says tgcli uses MTProto for a personal account, not the Bot API.

Where does tgcli store its data?

The store lives in the OS app-data directory and holds config.json, sessions and messages.db. Set TGCLI_STORE to change the location.

Can I turn off the update check?

Yes. Set the environment variable TGCLI_NO_UPDATE_CHECK=1 to turn off the daily check for a newer release.

How do I install Tgcli?

In Claude Code run claude mcp add tgcli -- npx -y @kfastov/tgcli. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is Tgcli the official server?

Tgcli is published by npm:@kfastov from its verified domain in the official MCP Registry.

Is Tgcli free?

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

Is Tgcli safe to use?

It scores 75 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to Tgcli?

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

Does Tgcli 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.

Add to stack

Loading.