# @bstuff/telegram-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/bstuff/telegram-mcp  
**GitHub Stars:** 4  
**npm Downloads (last month):** 147  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/bstuff-telegram-mcp

## Description
MCP server for a personal Telegram account: read chats, send messages, run polls

## Tools
Capabilities this server exposes over MCP:

- **whoami** — which account the server is signed in as
- **list_chats** — dialogs, filtered by name, type, unread state or archive
- **get_chat** — one chat in detail: type, description, members, pinned message, unread count
- **list_members** — participants of a group or channel, optionally admins only
- **find_public_chat** — global search for public users, groups and channels
- **get_history** — chat history over a period; filters by sender, text, media kind, id range
- **search_messages** — full-text search in one chat or across all of them
- **get_message** — messages by id with reactions, replies, forwards and links
- **get_replies** — the comment thread under a post
- **get_unread** — everything unread across chats, without marking anything read
- **chat_digest** — stats for a period: who talked how much, activity per day and hour, links, media, most-reacted messages
- **list_media** — recent media with ids, ready for `download_media
- **get_draft** — unsent drafts across chats
- **list_scheduled** — messages scheduled for later
- **send_message** — text, replies, comments on channel posts, silent delivery, scheduling
- **edit_message** — edit and delete (deletion cannot be undone)
- **forward_messages** — forward, optionally without the "forwarded from" header
- **react** — add or remove an emoji reaction
- **pin_message** — pin, unpin, or unpin everything
- **mark_read** — clear the unread badge
- **set_mute** — mute for N minutes or indefinitely, unmute
- **cancel_scheduled** — drop a scheduled message
- **send_file** — send a local file or URL; download an attachment, including a forwarded story
- **create_poll** — multiple choice, non-anonymous, quiz mode with a correct answer and explanation, auto-close after N seconds
- **poll_results** — votes, percentages, and for public polls who voted for what
- **vote_poll** — cast your own vote
- **close_poll** — stop a poll and return the final tally
- **send_dice** — 🎲 🎯 🏀 ⚽ 🎳 🎰 — the value is decided by Telegram's server, so it works as a fair draw
- **random_member** — pick a random member: today's duty person, a reviewer, a raffle winner
- **set_typing** — show a typing indicator

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "telegram-mcp": {
    "command": "npx",
    "args": ["-y","@bstuff/telegram-mcp"],
    "env": {
      "TELEGRAM_API_ID": "",
      "TELEGRAM_API_HASH": ""
    }
  }
}
```

**Requires environment variables:** `TELEGRAM_API_ID`, `TELEGRAM_API_HASH` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What @bstuff/telegram-mcp does

@bstuff/telegram-mcp exposes a personal Telegram account to an MCP client through Telegram’s MTProto interface. It is intended for regular user accounts, not bot accounts, and supports much of the day-to-day activity available in a Telegram client.

The server covers both observation and account actions. An assistant can identify the signed-in account, inspect dialogs and participants, read history, search messages, review replies and reactions, summarize chat activity, retrieve drafts and scheduled messages, and inspect unread content without marking it read. It can also send, edit, delete, forward, schedule, react to, pin, mute, and mark messages as read.

Poll management includes creating multiple-choice and quiz polls, setting automatic closure, checking results, voting, and closing polls. Other account actions include sending files, downloading media, showing typing status, sending Telegram dice, and selecting a random group member.

## How it works

The server runs as a TypeScript program under Node.js 22.18 or newer and communicates with the MCP client over the configured command-based connection. Telegram credentials are established with the `login` command, which signs in by phone number and stores the session at `~/.telegram-mcp/session` with restrictive permissions. The `check` command verifies that the saved session still works.

Each tool accepts a `chat` reference in several forms: a numeric Telegram ID, an `@username`, a `https://t.me/username` link, `me` for Saved Messages, or part of a dialog title. Title fragments are resolved from the most recent cached dialogs; ambiguous fragments return candidates instead of selecting one. Date and scheduling parameters support values such as `7d`, `36h`, `today`, ISO-like dates, and Unix timestamps.

A separate `watch` CLI waits for a matching message and exits when one arrives. It can filter by chat, sender, text, regular expression, mentions, replies, count, timeout, or JSON output. It is designed to be run as a background process rather than exposed as an MCP tool.

## Setup and configuration

Install and authenticate from npm with:

```bash
npx @bstuff/telegram-mcp login
npx @bstuff/telegram-mcp check
```

The account requires a Telegram application ID and hash. Set `TELEGRAM_API_ID` and `TELEGRAM_API_HASH` in a checkout’s `.env`, in `~/.telegram-mcp/.env` for an npm installation, or provide them when prompted by the login command. These values come from Telegram’s API development tools at `my.telegram.org`; the hash should be treated as a secret.

A standard MCP configuration launches the package with `npx -y @bstuff/telegram-mcp`. Claude Code can add this command with `claude mcp add`, and Claude Desktop can use the same command in its `mcpServers` configuration. Claude Desktop also supports packaging a thin launcher as a `.mcpb` extension, with settings for read-only mode and timezone.

## Tools and capabilities

The tools are grouped around several workflows:

- Discover chats, account identity, members, administrators, public users, groups, and channels.
- Retrieve history, unread messages, drafts, scheduled messages, media, replies, reactions, links, and forwarded content.
- Produce chat-period statistics covering participants, activity timing, links, media, and highly reacted messages.
- Send text, replies, channel comments, files, forwarded messages, reactions, pins, typing indicators, and scheduled messages.
- Edit or delete messages, clear unread state, mute chats, cancel scheduled messages, and download attachments.
- Create, inspect, answer, and close polls, including quizzes with correct answers and explanations.

## Limitations and notes

Deleting messages cannot be undone. The server uses the permissions and access available to the signed-in Telegram account. The dialog-title lookup only considers the configured recent-dialog cache, which defaults to 400 dialogs. Claude Desktop should use either the direct MCP configuration or the extension, not both, to avoid duplicate tools.

_Full upstream README: https://allmcps.com/mcp/bstuff-telegram-mcp/readme_

