tgcli: Telegram CLI with optional MCP server

tgcli: Telegram CLI with optional MCP server

telegram-mcp-server•bykfastov

A Telegram CLI with background sync that can run an optional MCP server for a personal account using MTProto, not the bot API.

License: Not specified•Runtime: Awaiting documentation review•Category: communication social

WHAT IT DOES

  • •Offers an optional MCP server for a personal Telegram account.
  • •Includes background synchronization for Telegram data, including archive backfill and realtime sync.
  • •Provides CLI operations for listing and searching channels and messages.
  • •Can send text or files and download media.

BEST FOR

  • •Connecting an MCP client to a personal Telegram account for Telegram message and channel listing or search.
  • •Archiving Telegram chats with backfill and realtime sync.
  • •Sending Telegram text messages or files from the command line.

ABOUT TELEGRAM-MCP-SERVER

tgcli: Telegram CLI with optional MCP server is cataloged as an MCP server attributed to kfastov. A Telegram CLI with background sync that can run an optional MCP server for a personal account using MTProto, not the bot API. It is categorized under communication social. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for tgcli: Telegram CLI with optional MCP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does tgcli use the Telegram bot API?

No. It is for a personal account and uses MTProto, not the bot API.

Is the MCP server optional?

Yes. The MCP server is optional and is enabled through configuration.

What account does the MCP server serve?

It serves a personal Telegram account, and clients are pointed at the configured server address.

Upstream README

View this exact version on GitHub

README.md · 754f1b4f7fcc · Fetched 2026-11-13 06:24:30 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

tgcli

Telegram CLI with background sync and an optional MCP server for your personal account (MTProto, not bot API).

Installation

npm install -g @kfastov/tgcli
brew install kfastov/tap/tgcli

Authentication

Get Telegram API credentials:

  1. Go to https://my.telegram.org/apps
  2. Log in with your phone number
  3. Create a new application
  4. Copy api_id and api_hash

Then authenticate:

tgcli auth

Quick start

tgcli auth
tgcli sync --follow
tgcli messages list --chat @username --limit 20
tgcli messages search "course" --chat @channel --source archive
tgcli send text --to @username --message "hello"
tgcli server

Commands

tgcli auth           Authentication and session setup
tgcli config         View and edit config
tgcli sync           Archive backfill and realtime sync
tgcli server         Run background sync service (MCP optional); stop, restart, logs
tgcli service        Install/start/stop/status/logs for background service
tgcli channels       List/search channels
tgcli messages       List/search messages
tgcli send           Send text or files
tgcli media          Download media
tgcli topics         Forum topics
tgcli tags           Channel tags
tgcli metadata       Channel metadata cache
tgcli contacts       Contacts and people
tgcli groups         Group management
tgcli doctor         Diagnostics and sanity checks

Commands run through tgcli server, which the CLI starts on demand. After an upgrade, the next command of any kind replaces a server the CLI started itself, as soon as its backfill queue is empty. A server you started yourself with tgcli server or tgcli service keeps running the old code until you restart it; the CLI warns about this on stderr. tgcli server restart restarts the server on the CLI's version, tgcli server stop stops it, and tgcli server logs --follow shows its log.

Use tgcli [command] --help for details. Add --json for machine-readable output.

Once a day tgcli checks npm for a newer release in the background and, at a terminal, prints one line on stderr with the upgrade command (brew update && brew upgrade tgcli or npm i -g @kfastov/tgcli). Set TGCLI_NO_UPDATE_CHECK=1 to turn it off; see docs/cli.md.

MCP (optional)

Enable it via config:

tgcli config set mcp.enabled true

By default the server binds to http://127.0.0.1:8080/mcp. To change it:

tgcli config set mcp.host 127.0.0.1
tgcli config set mcp.port 8080

Then run tgcli server and point your client at the configured address.

Configuration & Store

The tgcli store lives in the OS app-data directory and contains config.json, sessions, and messages.db. Override the location with TGCLI_STORE.

Legacy version: see MIGRATION.md.

Development

Run it from a clone with Node 22: npm ci, then node cli.js. See docs/development.md for tests and for trying a change on your own account.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for tgcli: Telegram CLI with optional MCP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/telegram-mcp-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related communication social MCP Servers

Alternative and complementary servers in the same category

View all in communication social →

An AI receptionist platform with an MCP server for accessing business calls, contacts and appointments from AI assistants.

52
Communication

Pidgeon provides an MCP server and an email inbox API that gives AI agents their own addresses for sending, awaiting, and replying to email.

Repository stats unavailable
Communication