# fast-mcp-telegram [Health: Active]

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

## Description
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API

## Tools
Capabilities this server exposes over MCP:

- **search_messages_globally** — Search across all chats
- **get_messages** — Unified message retrieval
- **send_message** — Send new message
- **edit_message** — Edit existing message
- **find_chats** — Find users/groups/channels
- **get_chat_info** — Get detailed profile info
- **send_message_to_phone** — Message phone numbers
- **invoke_mtproto** — Direct Telegram API (power user)

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

```json
"mcpServers": {
  "fast-mcp-telegram": {
    "command": "uvx",
    "args": ["--from","fast-mcp-telegram",";","PyPI"],
    "env": {
      "API_ID": "",
      "API_HASH": "",
      "BOT_API_TOKEN": "",
      "ACL_ENABLED": "",
      "PREFIX_MCP_TOOLS_WITH_ACCOUNT": ""
    }
  }
}
```

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

## Documentation

## What fast-mcp-telegram MCP server does

The fast-mcp-telegram MCP server gives MCP-compatible agents access to Telegram through the MTProto User API. It groups common operations into eight tools rather than exposing many small API wrappers. The available operations cover global message search, unified message retrieval, sending and editing messages, chat discovery, chat profile information, sending messages to phone numbers, and direct MTProto method invocation.

The server can work with a personal Telegram account or a bot token. Personal-account authentication supports QR setup through the web interface, with phone-number login available as a fallback. A remote deployment can serve multiple users, isolating each user’s Telegram session behind a Bearer token.

## How it works

Requests follow this path: an AI agent connects over MCP or HTTP, the server resolves Telegram entities and sessions, and MTProto performs the operation against Telegram. Local MCP clients use stdio. Remote deployments use HTTP, with an authenticated mode intended for production and an unauthenticated mode available for development.

Message access is consolidated in `get_messages`, which supports searching, browsing, reading by ID, and retrieving replies. Search can operate globally or within a chat and supports multiple queries with deduplication. Chat discovery handles users, groups, and channels with a common entity format, and can filter dialogs by folder.

The `invoke_mtproto` tool provides a lower-level escape hatch for direct Telegram API methods. The HTTP MTProto bridge also supports direct API requests with Bearer authentication, entity resolution, and safety controls.

## Setup and configuration

For a local installation, install the package with `pip install fast-mcp-telegram` or run it through `uvx --from fast-mcp-telegram`. Run the setup command once with an API ID, API hash, and phone number to create a Telegram session, then start the server. A bot-token configuration can be used instead of phone authentication.

For remote use, open the `/setup` page, scan its QR code from Telegram’s device settings, and copy the resulting Bearer token. The setup page can also generate an MCP configuration file. An HTTP client sends that token in an `Authorization: Bearer` header.

The fast-mcp-telegram MCP server supports per-token session files on shared hosts. S3-compatible object storage is available for sessions in ephemeral environments. Optional configuration includes MTProto proxy support, per-principal session access controls, and tool-name prefixes when one agent connects to multiple accounts.

## Tools and capabilities

- `search_messages_globally`: search across chats.
- `get_messages`: search, browse, read messages, and retrieve replies.
- `send_message`: send messages, including supported replies and attachments.
- `edit_message`: modify existing messages.
- `find_chats`: locate users, groups, and channels.
- `get_chat_info`: retrieve detailed chat or profile information.
- `send_message_to_phone`: send a message to a phone number.
- `invoke_mtproto`: call Telegram API methods directly.

Messaging features include formatting, forum-topic posting, file attachments, inline data-URI uploads, and album support. File handling includes size controls and SSRF protection.

## Limitations and notes

The fast-mcp-telegram MCP server requires Telegram API credentials for personal-account use, or a bot token for bot authentication. Remote HTTP use requires a Bearer token in the authenticated configuration. QR authentication is available through the web setup flow; phone, code, and two-factor authentication remain fallback options when applicable.

Direct MTProto access is intended for advanced use and should be governed by the server’s configured safety and access controls. Session ACL options can restrict chat lanes, enable read-only access, block peers, and control MTProto access when enabled. The README identifies Python 3.11 or newer and provides Docker support.

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

