# Telethon Plus [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/psyb0t/docker-telethon-plus  
**GitHub Stars:** 5  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/telethon-plus

## Description
Self-hosted MCP server: Telegram userbot control (Telethon) via HTTP and MCP.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "telethon-plus": {
    "url": "http://your-host:8080/mcp/"
  }
}
```

## Documentation

## What Telethon Plus does

The Telethon Plus MCP server connects Telegram user accounts to MCP-aware agents and ordinary HTTP clients. It wraps Telethon, a Telegram MTProto client, and exposes the account through two interfaces: a JSON HTTP API under `/api/...` and a Streamable HTTP MCP endpoint at `/mcp`.

Both interfaces use the same Telethon client and registered operations. This keeps authentication and runtime state in one place rather than maintaining separate Telegram connections. Requests and responses use JSON; inputs are validated with Pydantic, and validation failures return HTTP 400 responses.

## How it works

Telegram access requires an API ID, API hash, and Telethon session string. The session represents an already authenticated account, so the service can continue using the account without requesting a login code on every start. A one-time login command handles phone verification, an SMS code, and optional two-factor authentication, then produces the session string.

An MCP-capable agent sends requests to `/mcp`, while scripts and other clients can call the REST-style endpoints directly. Chat references may use usernames, phone numbers, `t.me` links, numeric IDs, supergroup or channel IDs, or `me` for Saved Messages.

## Setup and configuration

The supplied Docker image listens on port 8080 by default. A minimal deployment sets `TELETHON_API_ID`, `TELETHON_API_HASH`, and `TELETHON_SESSION`, then publishes the container port. The login helper can be run interactively before starting the service.

Optional settings control the listen address, log level, request timeout, device metadata, file-upload scratch directory, and bearer-key authentication. Set `TELETHON_AUTH_KEY` to require `Authorization: Bearer <key>` on endpoints; `/healthz` remains public.

The service also provides throttling, adaptive backoff, and an entity cache. The cache can be persisted by mounting `/cache`, and its expiry can be configured with environment variables. These controls are relevant when an agent performs repeated reads, username resolution, joins, sends, or other rate-limited operations.

## Tools and capabilities

The Telethon Plus MCP server provides the same operation set through MCP and HTTP. Documented operations include reading messages and dialogs, resolving usernames and other entities, retrieving full channel or user information, listing participants, sending files, joining chats, and creating channels or groups. Telegram responses are returned directly for successful requests rather than inside a `result` envelope.

Chat and account actions run with the permissions of the configured Telegram user. Telegram RPC failures are surfaced as HTTP 502 responses containing the Telegram error and message.

## Limitations and notes

The session string grants full access to the associated Telegram account and must be protected like a credential. Do not commit it to source control or expose it in logs or chat.

A numeric Telegram ID is not always sufficient: Telethon also needs the entity’s access hash. Numeric references work for entities already known to the session through an earlier lookup, dialog listing, or incoming message. Resolve a username or link first when necessary.

Telegram may rate-limit or ban accounts that generate excessive traffic. The included throttling and cache defaults reduce that risk, but they do not remove Telegram’s limits. The service is intended for a user account using MTProto, not a Telegram Bot API token.

_Full upstream README: https://allmcps.com/mcp/telethon-plus/readme_

