# grokbot-telegram [Health: Active]

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

## Description
Telegram MCP servers in one command: Bot API (send as your @bot) and MTProto user account (send as you).

## Tools
Capabilities this server exposes over MCP:

- **send_message** — Send text as the **bot** (`chat_id` or public `@username`)
- **get_me** — Confirm the token; bot username
- **get_updates** — Debug recent updates
- **list_recent_chats** — Best-effort recent chats (not a full inbox)
- **save_api_credentials** — Store api_id / api_hash at 0600 so no config file is needed
- **auth_status** — Credentials + whether the session is authorized
- **start_login** — Phone + login code (+ optional 2FA password)
- **start_qr_login** — QR / Link Desktop Device (+ optional 2FA)
- **list_dialogs** — Real dialog / inbox list, `isForum` marks groups with topics
- **list_forum_topics** — Topics of a forum group, with the ids to send into
- **search_dialogs** — Filter dialogs by title, username, or id
- **get_messages** — Recent history for a chat

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

```json
"mcpServers": {
  "grokbot-telegram": {
    "command": "npx",
    "args": ["-y","grokbot-telegram"],
    "env": {
      "TELEGRAM_BOT_TOKEN": "",
      "TELEGRAM_API_ID": "",
      "TELEGRAM_API_HASH": "",
      "TELEGRAM_SESSION": "",
      "TELEGRAM_DISCLAIMER": ""
    }
  }
}
```

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

## Documentation

## What grokbot-telegram does

grokbot-telegram provides two Telegram MCP endpoints with different identities. `telegram-bot` communicates through the official Bot API and sends as a bot created with BotFather. `telegram-user` uses MTProto through a logged-in personal account, allowing it to access that account's dialogs and send messages in the user's name.

The two modes can be enabled independently. Bot mode suits notifications, CI alerts, and channel posts. User-account mode is intended for operations that require the account's real inbox or personal identity. Neither mode changes the identity used by the other.

Messages sent through either server normally receive a footer identifying them as agent-generated. `TELEGRAM_DISCLAIMER` can replace that footer or disable it with values such as `off`, `false`, `0`, `no`, `none`, or an empty value.

## How it works

The bot server uses `TELEGRAM_BOT_TOKEN`. Its message tool accepts a chat ID or public `@username`; a bot must already have an interaction with a user before it can initiate a direct conversation. `get_me` validates the token and returns the bot identity, while `get_updates` and `list_recent_chats` help inspect activity visible through the Bot API. Recent chats are derived from updates and are not a complete inbox.

The user server authenticates with Telegram `api_id` and `api_hash`, then stores an authorized session in `TELEGRAM_SESSION` or `~/.grokbot-telegram/user.session`. It supports phone-and-code login, QR or Link Desktop Device login, and optional two-factor authentication. `list_dialogs` returns the account's actual dialogs; searches can filter them by title, username, or ID. Messages can target `me`, an `@username`, a dialog ID, or a title. Ambiguous titles are rejected instead of being selected arbitrarily.

Forum groups are marked with `isForum`. Use `list_forum_topics` to find topic IDs, then pass a topic ID to message or history operations. The server checks named topics before sending and rejects closed topics.

## Setup and configuration

For bot mode, create a bot with BotFather and configure `TELEGRAM_BOT_TOKEN` in Cursor's plugin settings. Open a conversation with the bot and use `/start` before attempting a direct message. This mode does not need Telegram app credentials.

For user mode, create an application at `my.telegram.org/apps` using the same phone-linked account that will authenticate. Configure `TELEGRAM_API_ID` and `TELEGRAM_API_HASH`, then complete the initial login. Credentials can be saved with `save_api_credentials`, which writes them with mode `0600`; environment variables take precedence. Keep the resulting session as secret as a password, and never commit it, the API hash, or environment files.

The package is available as `grokbot-telegram` and is installable as a Cursor plugin. Its two MCP server names are `telegram-bot` and `telegram-user`.

## Tools and capabilities

- Bot mode: `send_message`, `get_me`, `get_updates`, and `list_recent_chats`.
- User mode: credential saving, authentication status, phone or QR login, `get_me`, dialog listing and search, forum-topic listing, recent message retrieval, and user-identity message sending.
- Both modes provide message sending and identity inspection, with tool descriptions distinguishing Bot API from user-account behavior.

## Limitations and notes

The user session grants full account access: anyone holding it may read chats and send as the account. Revoke an unwanted session in Telegram's device settings and remove the stored session. Automating a personal account may conflict with Telegram's terms; avoid spam and bulk broadcasting and keep activity human-paced.

The disclaimer counts toward Telegram's 4096-character message limit. If the combined text is too long, sending fails rather than truncating the message. When formatting is enabled, the footer is escaped for the selected parse mode. A wrong forum topic ID can otherwise route a message to General, so topic validation is performed when a topic is supplied.

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

