Telegram Account MCP Connector
π Telegram Account MCP Connector for Claude
An open-source Model Context Protocol (MCP) server that connects your personal Telegram account to Claude Desktop, Claude Code, or any MCP-compatible AI client.
Give Claude superpowers to read your chats, check your Saved Messages, inspect files and media, summarize channel feeds, search history, and send messages on your behalf.
β¨ Features
π Saved Messages ("ΠΠ·Π±ΡΠ°Π½Π½ΠΎΠ΅"): Full access to read and write notes, links, and snippets into your personal Saved Messages.
π Files & Media Inspection: View file names, sizes (KB/MB), MIME types, photos, and documents across your chats.
π Account Statistics: Overview of total chats, joined channels, supergroups, private chats, bots, and unread counts.
π Global & Scoped Search: Search across all your Telegram chats or within a specific conversation.
π― Intelligent Limit Management: Prompt-guided tools ensure Claude asks you for limits rather than overwhelming your conversation context.
β‘οΈ Dual Deployment Modes:
Local
stdio: Runs seamlessly as a child process of Claude Desktop.Remote
SSE: Deployable 24/7 to Render, Railway, or Docker.
π Available MCP Tools
Tool | Parameters | Description |
| none | Returns logged-in Telegram user info (Name, Username, ID, Phone). |
| none | Account overview (channels count, groups, private chats, unread counter). |
|
| Read messages and notes from your personal Saved Messages. |
|
| Store a note or message into Saved Messages. |
|
| List recent chats filtered by category. |
|
| Read message history with rich media and document metadata. |
|
| Inspect files and media shared in a specific chat. |
|
| Send a new message or reply to a specific message. |
|
| Search messages globally or inside a specific chat. |
π Quickstart Guide
1. Clone & Install
git clone https://github.com/miuceo/telegram-account-mcp.git
cd telegram-account-mcp
pip install -r requirements.txt2. Get Telegram API Credentials
Go to my.telegram.org and log in with your phone number.
Navigate to API development tools.
Create a new application and copy your
api_idandapi_hash.
3. One-Time Login (Session Creation)
Run the interactive authentication script:
python auth_setup.pyEnter your
API_IDandAPI_HASH(saved automatically to.env).Enter your phone number (e.g.
+998880084506) and the 5-digit verification code sent to your Telegram app.This creates your secure
telegram_user.sessionfile locally.
π₯ Claude Desktop Setup (Local stdio)
Open or create %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"telegram": {
"command": "python",
"args": [
"C:\\path\\to\\telegram-mcp-connector\\server.py"
],
"env": {
"PYTHONIOENCODING": "utf-8"
}
}
}
}Restart Claude Desktop. You will see the π¨ hammer icon with all 9 Telegram tools ready!
βοΈ 24/7 Hosting on Render (Remote SSE Mode)
Because Render containers have ephemeral storage, generate a persistent TELEGRAM_STRING_SESSION first:
python generate_string_session.pyCopy the generated TELEGRAM_STRING_SESSION string.
Deploying to Render:
Push this repository to your GitHub.
Go to Render Dashboard -> New + -> Web Service.
Connect your repository.
Set:
Environment:
Python(orDocker)Build Command:
pip install -r requirements.txtStart Command:
python server.py --transport sse
Add Environment Variables:
TELEGRAM_API_ID=your_api_idTELEGRAM_API_HASH=your_api_hashTELEGRAM_STRING_SESSION=your_generated_string_session
Deploy! Render will give you a public URL (e.g.,
https://my-telegram-mcp.onrender.com).
π Security Best Practices
Never commit
.envor*.sessionfiles: They grant full access to your Telegram account. The provided.gitignoreprevents them from being tracked.Flood Limits: Telegram enforces rate limits. The tools are designed to fetch targeted batches.
Review Permissions: When using Claude to send messages, ask Claude to confirm recipient and message before sending.
π License
This project is licensed under the MIT License.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/miuceo/telegram-account-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server