telegram-mcp
Provides full control over a Telegram user account via MTProto, including reading chats, searching message history, sending and forwarding messages, managing chats, and cleaning up conversations.
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-mcpWhat are my unread 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
An MCP server that gives an AI assistant real control of a Telegram user account over MTProto: read every chat, search the full history, send, forward, organise, clean up, and write itself new tools when it hits a gap.
It is not a bot-token integration. A BotFather bot can only see messages sent to it and replies come from the bot. This runs as you, so it sees your DMs, your groups and your whole scrollback, and messages it sends come from your account.
That power is the reason for the safety model below.
Safety model
There is no button UI in MCP, so the human gate is an explicit argument.
Read tools run freely. 10 of them.
Write tools refuse unless called with
confirm=true. 20 of them.6 are marked
[DESTRUCTIVE]in their description:delete_chat,clear_history,delete_messages,leave_chat,block_user,delete_deleted_account_chats.Bare names never resolve to strangers.
chat_info("Zzyzx")used to return a person the account had never messaged, because a bare name fell through to a global username lookup. Now a name is matched only against your own chats; reaching anyone else requires an explicit@username.Ambiguity is reported, never guessed. Fuzzy matching returns ranked candidates and refuses when two chats tie.
Relax the gate with MCP_REQUIRE_CONFIRM=destructive or none if you know what
you are doing. Default is all.
Related MCP server: telegram-mcp
Install
git clone <your-repo-url> telegram-mcp && cd telegram-mcp
python3.12 -m venv .venv
./.venv/bin/pip install -r requirements.txt
cp .env.example .envFill three values in .env:
Variable | Where from |
| https://my.telegram.org → API development tools |
| https://build.nvidia.com (only for the optional bot, not the MCP server) |
Then log in once. The code arrives inside the Telegram app, in the blue
Telegram service chat, not by SMS.
./.venv/bin/python auth.py send +91XXXXXXXXXX mcp
./.venv/bin/python auth.py code 12345 mcpCheck everything:
./.venv/bin/python doctor.pyConnect it
Claude Code
claude mcp add telegram -- /abs/path/to/telegram-mcp/.venv/bin/python /abs/path/to/telegram-mcp/mcp_server.pyClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"telegram": {
"command": "/abs/path/to/telegram-mcp/.venv/bin/python",
"args": ["/abs/path/to/telegram-mcp/mcp_server.py"]
}
}
}Any MCP client works; it speaks stdio.
Tools
Read, no confirmation
Tool | Does |
| Recent chats with unread counts and last message |
| Everything unread, grouped, with the actual messages |
| Recent messages from one chat |
| Server-side search across all history, or one chat |
| Which chats match a name |
| id, type, autoreply mode, notes, member count |
| Saved contacts, flagging deleted accounts |
| Dead DMs from people who deleted their account |
| Totals |
| Everything available, including self-built |
Write, confirm=true required
send_message · reply_to · forward · send_file · edit_message ·
mark_read · mark_all_read · archive_chat · mute_chat · pin_chat ·
set_mode · set_note · propose_tool · disable_tool
Destructive, confirm=true required
delete_chat · clear_history · delete_messages · leave_chat ·
block_user · delete_deleted_account_chats
Self-extending tools
Ask for something no tool covers and the server writes one. propose_tool takes
the body of an async run(client, **kwargs) function, audits it, loads it, and
persists it to plugins/enabled/. It appears in list_tools from then on.
The audit is the boundary. A plugin may do anything with the Telegram client but
may not import os, sys, subprocess, socket, urllib or requests,
call eval, exec, compile or open, or touch any dunder attribute or dunder
string. That separates a new Telegram capability from a shell on your machine.
functions, types, utils, asyncio, json, re and datetime are already
in scope, so a plugin never needs an import.
A self-built tool can be confidently wrong. A generated
my_profileread the bio fromget_me(), which never carries it, and returned an empty bio forever with no error. Approving source is not verifying behaviour. Run a new tool once and check the output.
Optional: the standalone bot
jarvis.py is a second front end. It runs the same tools behind a private
Telegram bot, so you control your account by chatting to it, with Send / Edit /
Cancel buttons instead of confirm=true. It uses two NVIDIA NIM models:
openai/gpt-oss-120b to pick tools and nvidia/nemotron-3-super-120b-a12b to
compose replies in your voice. It also does unattended draft-and-approve replies.
./run.shRun the bot or the MCP server, not both at once, unless you log in two
sessions (auth.py ... mcp does exactly that). Two Telethon clients sharing one
auth key can trip AUTH_KEY_DUPLICATED and log the account out.
Accuracy
eval.py runs 24 realistic commands and checks which tool was chosen and what
was forbidden. Currently 23–24 of 24, about 2.2s mean.
./.venv/bin/python eval.pyRun it after any prompt or tool change. It caught a regression that reading the
code would not: adding a grounded chat roster made "delete all the deleted
account chats" call delete_chat on one of them, because listing the dead
chats individually invited a single-item tool.
Things that will bite you
Bulk operations get flood-limited. 40
delete_dialogcalls back to back are mostly rejected._bulk()paces, honoursFloodWaitError, retries, and reports "did N of M, waited Xs, K failed". A plainexceptturns rate limiting into a silent partial success.Models send
{"": ""}to zero-argument tools, which Python rejects asunexpected keyword argument ''. Every argument is filtered throughinspect.signaturefirst.The session file is your account.
data/*.sessionis a full login. It is gitignored. Do not copy it anywhere.Anti-spam is real. This is your account, not a bot. Automated replies to strangers get accounts limited.
NVIDIA NIM model ids rot.
meta/llama-3.3-70b-instructreturns 410 Gone, andGET /v1/modelslists models that 404 when called. Never pick one from documentation; pull the list and benchmark.
License
MIT
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
- 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.18532MIT
- AlicenseCqualityCmaintenanceConnects AI tools to Telegram via MCP, enabling reading chats, sending messages, managing groups, and more using your own account.545MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with a user's Telegram account: list chats, read history, search, and send messages through Telegram's MTProto API.1MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to control a real Telegram user account via MTProto, allowing message sending, chat reading/searching, and message management through MCP tools.36
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Drive your Android phone and browser, build and run agent pipelines, from any AI assistant.
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
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/AnubhavChaturvedi-GitHub/telegram-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server