telegram-mcp-light
Provides read-only access to Telegram via MTProto, including listing unread chats, folders, and forum topics; reading messages; searching chat/topic history; generating unread digests; marking chats or topics as read; and exporting message history to JSON, CSV, or TXT.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
telegram-mcp-light
Lightweight, read-only Telegram MCP server via MTProto. Designed for Claude Desktop.
A focused alternative to existing Telegram MCP servers — better forum topic support, unread digests, history export, and fast response times.
Features
Read-only + mark-as-read — no sending, editing, or deleting messages
Forum topic support — list topics, read messages per topic, topic-scoped search
Unread digest — aggregated unread messages across chats, topics, and folders
History export — export to JSON, CSV, or TXT for any date range
8 tools — minimal footprint, one request = one result
Related MCP server: Telegram MCP Server
Tools
Tool | Description |
| List chats with unread messages, filter by type/folder/muted |
| List Telegram folders with their chats and unread counts |
| List topics in a forum supergroup with unread counts |
| Read messages from a chat or specific forum topic |
| Mark a chat or topic as read |
| Full-text search in a chat or topic (supports topic-scoped search) |
| Aggregated unread digest across multiple sources |
| Export message history to JSON, CSV, or TXT |
Prerequisites
Python 3.10+
Telegram API credentials (
API_IDandAPI_HASHfrom my.telegram.org)
Installation
From PyPI:
pip install telegram-mcp-lightVia uvx (no install):
uvx telegram-mcp-lightFrom source:
git clone https://github.com/numados/telegram-mcp-light.git
cd telegram-mcp-light
pip install .Setup
1. Get Telegram API Credentials
Go to my.telegram.org/apps
Log in with your phone number (international format, e.g.
+1234567890)Under API development tools, create a new application:
App title and Short name — anything you like, these don't matter
Platform — can be left as default
After creation, copy your api_id (a number) and api_hash (a hex string)
2. Generate a Session
The server needs a Telethon session to authenticate with Telegram. Two options are available:
Option A: Session String (recommended)
A session string is a single base64-encoded token you can pass via environment variable — no files needed.
export API_ID=your_api_id
export API_HASH=your_api_hash
python auth.pyThe script will:
Ask for your phone number (international format, e.g.
+1234567890)Send a verification code to your Telegram app
Ask you to enter the code
Print
SESSION_STRING=...— copy and save it securely
Set the string in your environment:
export SESSION_STRING=your_session_string_hereOption B: File-based Session
export API_ID=your_api_id
export API_HASH=your_api_hash
python auth.py --fileThis saves the session to ~/.config/telegram-mcp-light/session.session. You can override the path with the SESSION_FILE environment variable.
Do NOT copy an existing
.sessionfile from another Telegram client. Copying duplicates the auth key and causesAuthKeyDuplicatedErrorwhen both clients run concurrently. Always generate a fresh session.
Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"telegram": {
"command": "uvx",
"args": ["telegram-mcp-light"],
"env": {
"API_ID": "your_api_id",
"API_HASH": "your_api_hash",
"SESSION_STRING": "your_session_string"
}
}
}
}Or if installed from source:
{
"mcpServers": {
"telegram": {
"command": "python",
"args": ["/path/to/telegram-mcp-light/server.py"],
"env": {
"API_ID": "your_api_id",
"API_HASH": "your_api_hash",
"SESSION_STRING": "your_session_string"
}
}
}
}Known Limitations
General topic (id=1): The General topic in forum groups cannot be isolated via
topic_id=1. It falls back to whole-chat scope.Word-based search: Telegram's server-side search matches whole words, not substrings. Searching "error" won't match "ValueError".
No media: This server handles text messages only — no file/photo downloads.
Export directory: Exports are restricted to
~/telegram-mcp-exports/for security.
Troubleshooting
AuthKeyDuplicatedError
You copied a .session file instead of creating a fresh one. Delete the copied file and run python auth.py again.
Session not authorized
The session file doesn't exist or expired. Run python auth.py to create/refresh it.
RuntimeError: API_ID not set
Set API_ID and API_HASH environment variables, or create a .env file (copy from .env.example).
Rate limiting (FloodWaitError)
Telegram rate-limits API calls. The server handles short waits automatically. For long waits (>60s), the tool returns an error — wait and retry.
Chat is not a forum group
list_topics only works on supergroups with forum mode enabled. Use get_messages for regular groups.
License
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Your Telegram, WhatsApp, Instagram, mail and calendar in Claude or ChatGPT. Never sends messages.
Your own WhatsApp in Claude and ChatGPT: read chats, draft replies, send messages you approve.
Search, read and reply to your Telegram Business chats, transcribed voice included.
Read-only access to your own crypto portfolio across 11+ exchanges and 20+ chains: holdings, full history, FIFO cost basis and P&L, fees and income. Ask Claude or ChatGPT about your portfolio; the connector can never trade, move funds or act as a login.
Related MCP Servers
- AlicenseAqualityBmaintenanceRead-only Telegram access for Claude and other MCP hosts. Provides tools to list chats, read recent messages, and download media from your own Telegram account without needing an api_id/api_hash.558 npmMIT
- FlicenseAqualityDmaintenanceEnables reading and searching Telegram channel/group/DM messages from Claude Code using MTProto for full message history access.5-
- AlicenseNot gradedqualityCmaintenanceEnables Claude to access a personal Telegram account via MTProto, supporting chat and channel history, message search, media downloads, participant lists, and bot interactions.3MIT
- AlicenseNot gradedqualityCmaintenanceLets Claude Desktop inspect selected chats and forum topics, retrieve recent messages, and search message history from a personal Telegram account while preventing sending or modification.MIT