# telegram [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/n24q02m/telegram  
**GitHub Stars:** 13  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/telegram-2

## Description
Telegram for AI agents -- messages, chats, media, and contacts across both bot and full user-account modes.

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

```json
"mcpServers": {
  "telegram": {
    "command": "uvx",
    "args": ["n24q02m-telegram"],
    "env": {
      "TELEGRAM_BOT_TOKEN": ""
    }
  }
}
```

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

## Documentation

## What telegram does

The telegram MCP server gives AI agents access to Telegram communication data and actions. It supports two authentication models: bot accounts through Telegram's Bot API and full user accounts through MTProto via Telethon. That makes it suitable for workflows that need either a bot's scoped access or an authenticated personal account.

Its capabilities cover messages, chats, media, and contacts. The server groups these operations into six MCP tools: `message`, `chat`, `media`, `contact`, `config`, and `help`. MCP resources under `telegram://docs/*` provide server documentation to connected clients.

## How it works

The server uses bot mode when a Telegram bot token is available and user mode when a phone number and locally authenticated Telethon session are used. Authentication is performed on the machine running the server. For user accounts, `telegram auth --phone` starts an interactive flow that accepts the Telegram OTP and, when enabled, a two-factor authentication password.

After authentication, saved credentials are read when the process starts. Restart the server after completing `telegram auth`. With no credentials available, the stdio process prints setup instructions to stderr and exits with status 1.

stdio is the default transport. HTTP mode is also available with loopback-only unauthenticated access, one bearer token, or per-user tokens. Each MCP tool declares annotations such as read-only, destructive, idempotent, and open-world hints.

## Setup and configuration

Install the `n24q02m-telegram` package with `uvx`, run the `n24q02m/telegram` Docker image, or install the Telegram plugin through the author's Claude Code plugin marketplace. The legacy `better-telegram-mcp` command remains available as an alias, while the package and registry identity use `telegram`.

For bot mode, provide `TELEGRAM_BOT_TOKEN` in the MCP client's environment or save the token with:

```bash
telegram auth --bot-token 123456:ABC-DEF
```

For user mode, authenticate interactively:

```bash
telegram auth --phone +15551234567
```

Credentials are configured on the host running the server. Environment variables take precedence over credentials saved by the authentication command. Saved local data is stored under `~/.telegram`; data from the former package location is moved there once on first start.

## Tools and capabilities

- `message` for message-related Telegram operations.
- `chat` for chat-related operations.
- `media` for working with Telegram media.
- `contact` for contact-related operations.
- `config` for server configuration operations.
- `help` for tool and usage help.
- MCP documentation resources available at `telegram://docs/*`.
- Prompt-injection boundary tags applied to Telegram content returned to agents.

## Limitations and notes

Bot and user modes use different Telegram interfaces and authentication flows. User mode requires an interactive phone, OTP, and optional 2FA sign-in before the server can use the account. The process must be restarted after credentials are saved with `telegram auth`.

HTTP deployments require an explicit authentication choice unless access is restricted to the loopback interface. The server includes protections for SSRF and path traversal and sanitizes errors before returning them to clients.

The package is licensed under Apache-2.0. Docker and stdio installation paths are available, and the server can be configured in clients that accept MCP stdio or HTTP connections.

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

