Telegram MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Telegram MCP ServerSend 'hello' to my Saved Messages"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Telegram MCP Server
An MCP server that lets Claude (or any MCP client) control your personal Telegram account via the MTProto API (Telethon) β not a bot.
Send/read messages, media, search, reactions, scheduled messages, and full group/channel administration β all from your AI assistant, with built-in safety guards.
πΊπΏ O'zbekcha qo'llanma: README.uz.md
β οΈ Security & responsible use
This server has full access to your account. Your
.sessionfile andapi_hashact like a login β never share them or commit them to git (.gitignorealready excludes them).Telegram limits automation. Bulk/spam messages can get your account limited or banned. Use responsibly, on your own account.
Each user runs this with their own API credentials. There is no shared hosted service.
Built-in safety guards
Env var | Effect |
| Disables every write/modify tool β read-only mode |
| Messages can only be sent to these peers |
| Auto-wait up to N seconds on Telegram FloodWait, then retry |
Destructive tools (delete_message, remove_participant, leave_chat)
require an explicit confirm=true argument. FloodWait errors are caught and
retried automatically.
Related MCP server: Telegram MCP Server
Features (26 tools)
Messaging: send_message, read_messages, search_messages,
reply_message, edit_message, forward_message, delete_message,
pin_message, unpin_message, react, schedule_message, mark_read
Media: send_file (photo/document/video/voice), download_media
Discovery: get_me, list_dialogs, list_contacts, resolve_entity
Groups & channels: send_to_channel, create_group, get_participants,
add_participants, remove_participant, promote_admin, join_chat,
leave_chat
peer accepts an @username, phone number, chat ID, or "me" (Saved Messages).
Setup
1. Get API credentials
Go to my.telegram.org β API development tools β
create an app. You'll get an api_id (number) and api_hash (string).
2. Install
git clone https://github.com/Muhammadyunusxon/telegram-mcp.git
cd telegram-mcp
pip3 install -r requirements.txt3. Configure
cp .env.example .envEdit .env and fill in TELEGRAM_API_ID and TELEGRAM_API_HASH.
4. Log in (once)
python3 login.pyEnter your phone (international format, e.g. +1555...), the code Telegram
sends, and your 2FA password if enabled. This creates a telegram_mcp.session
file so you won't need to log in again.
5. Connect to Claude Desktop
Edit your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"telegram": {
"command": "python3",
"args": ["/absolute/path/to/telegram-mcp/server.py"]
}
}
}The server reads credentials from .env automatically. Fully quit and reopen
Claude Desktop, then look for the telegram tools.
Try it
"Send 'hello' to my Saved Messages"
"Send the file ~/report.pdf to @someone with caption 'draft'"
"React π₯ to message 1234 in @mychat"
"Schedule 'Good morning' to @friend at 2026-07-21T06:00"
Knowledge base (answer from your own Q&A)
Store your own answers and let Claude reply from them instead of guessing.
Answers live in knowledge.json (seeded from knowledge.example.json):
{ "entries": [ { "id": 1, "q": "What are your hours?", "a": "MonβFri 9β18.", "tags": ["hours"] } ] }Three tools power it, using hybrid search (keyword + fuzzy, with optional semantic embeddings):
answer_from_kb(question)β returns the best-matching entries; Claude writes the final reply from them (and won't fabricate if nothing matches).kb_add(question, answer, tags)β grow the base straight from chat.kb_list()β show everything stored.
Enable smarter semantic matching by installing fastembed and setting
TELEGRAM_KB_SEMANTIC=1. Your knowledge.json is git-ignored so private
answers never get pushed.
Realtime auto-responder (optional)
autoresponder.py is a long-running script that watches incoming Telegram
messages and auto-replies from your knowledge base β phrased naturally by
the Claude API. It runs independently of the MCP server.
Safety is built in: it only replies in allowlisted chats, only when the KB has a confident match (otherwise it stays silent), never replies to bots or itself, and rate-limits per chat.
pip install anthropic # for AI phrasing (optional)
# Dry-run (no Telegram/API needed) β just checks KB gating:
python3 autoresponder.py --test "can I pay with card?"
# Live:
AUTORESPONDER_CHATS="@my_customers,123456789" \
ANTHROPIC_API_KEY="sk-ant-..." \
python3 autoresponder.pyEnvironment: AUTORESPONDER_CHATS (required allowlist), ANTHROPIC_API_KEY
(optional β without it, the raw KB answer is sent verbatim),
AUTORESPONDER_MODEL, AUTORESPONDER_MIN_SCORE (default 0.35),
AUTORESPONDER_COOLDOWN. Keep it running 24/7 with nohup, screen, tmux,
or a launchd/systemd service.
Install as a Claude Desktop Extension (.mcpb)
This repo ships a Desktop Extension bundle so it can be installed in one click and submitted to the Anthropic Connectors Directory.
manifest.jsonβ MCPB manifest (all tools annotated withreadOnlyHint/destructiveHint;api_id/api_hashcollected as sensitive user config).Download the
.mcpbfrom Releases and open it with Claude Desktop, or build it yourself:
pip install -r requirements.txt --target lib # vendor deps into the bundle
npx @anthropic-ai/mcpb pack . telegram-mcp.mcpbOne-time login: because this uses your Telegram account (MTProto), you must create the session once by running
python login.pylocally before the extension can connect. See PRIVACY.md for how your data is handled.
Development
pip install pytest
pytest -qCI runs on Python 3.10β3.12 via GitHub Actions. A Dockerfile, pyproject.toml
(build with python -m build), server.json (MCP registry), and
smithery.yaml are included.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI assistants to interact with the Telegram Bot API, allowing them to send messages, forward messages, get bot information, and receive updates.273MIT
- AlicenseBqualityDmaintenanceEnables full access to your personal Telegram account via MCP, allowing reading, sending, and searching messages, managing chats, and retrieving user information through natural language commands.18162MIT
- Alicense-qualityCmaintenanceConnects AI tools to Telegram via MCP, enabling reading chats, sending messages, managing groups, and more using your own account.5MIT
- Alicense-qualityCmaintenanceEnables AI assistants to interact with Telegram accounts, chats, messages, media, and more via MCP, using Telethon.Apache 2.0
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents β HTTP+stdio, 8 tools, MTProto User API
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Connect AI agents to bank accounts, transactions, balances, and investments.
Appeared in Searches
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/Muhammadyunusxon/telegram-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server