telegram-mcp
Allows interacting with Telegram as a user account, reading private chats, sending messages and files, searching messages and public channels, managing contacts, and drafting replies in the user's style.
Click on "Deploy 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 list my recent unread chats"
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
Your Telegram account in an MCP client. Signs in as you, not as a bot: it reads your private chats, and anything it sends comes from you.
Install
Node 22+.
Get API keys: my.telegram.org → API development tools → create an app (platform
Other, rest blank) → copy api_id and api_hash.Sign in — once, in a terminal:
TELEGRAM_API_ID=... TELEGRAM_API_HASH=... npx @vkruglikov/telegram-mcp loginIt asks for your phone, the code Telegram sends, and your 2FA password if you have one. This is a terminal command and not a tool on purpose — as a tool, the code and the password would pass through the model's context and land in chat logs.
Register the server:
claude mcp add telegram \ --env TELEGRAM_API_ID=... \ --env TELEGRAM_API_HASH=... \ -- npx -y @vkruglikov/telegram-mcpClients that read a JSON config instead:
{ "mcpServers": { "telegram": { "command": "npx", "args": ["-y", "@vkruglikov/telegram-mcp"], "env": { "TELEGRAM_API_ID": "...", "TELEGRAM_API_HASH": "..." } } } }Check:
npx @vkruglikov/telegram-mcp status.
logout revokes the session server-side and deletes it locally.
Related MCP server: telegram-mcp
Features
Your account:
| Dialogs, newest first, or only unread |
| Find a dialog by name — |
| Read a chat. Does not mark it read |
| Full-text, one chat or the whole account |
| Delivered immediately, no undo |
| Save an attachment |
| The only tool that marks anything read — the other side sees it |
| Saved contacts |
All of Telegram, not just your chats:
| Channels, groups and people you have never opened |
| Text of every public channel. A few free searches a day; the result says how many are left |
Prompts, shown as slash commands: personalize, draft_reply, catch_up.
Drafting in your voice
Run
/personalize. It callssample_my_messagesto collect messages you sent in recent private chats, then describes the patterns: languages and how you mix them, message length, greetings and sign-offs, punctuation you skip, which emoji and where, recurring phrasings, how formality shifts, and what you never do.It shows the profile before saving. Edit or reject it.
Saved to
~/.telegram-mcp/style.md. Reconnect the server to load it./draft_reply <chat> [intent]writes in that voice and shows the draft. It never sends.
get_style_profile prints the profile, forget_style_profile deletes it.
The profile covers how you write, not what you think. Facts, opinions and commitments stay yours to supply.
Everything stays on your machine
Local process, straight to Telegram, no service in between. Everything lives in
~/.telegram-mcp:
session.db— your login sessionstyle.md— your style profile, if you made onedownloads/— downloaded attachments
No telemetry, no account of ours, no third party. Credentials, session and messages go nowhere else.
Treat session.db like a password. It grants full access to your account without the
password and without 2FA. Never copy it to another machine or into a repo. If it leaks,
revoke it in Telegram → Settings → Devices. Deleting the folder by hand revokes nothing —
use logout.
License
MIT
Available Tools
16 toolsdownload_mediaBIdempotent
Download the media attached to one message. Returns the saved path.
Inputs: chat (required), message_id (required), dest_dir.
forget_style_profileAIdempotent
Delete the stored writing-style profile.
Inputs: no named parameters.
get_historyARead-only
Read the most recent messages of a chat, newest first. Read-only: this does not mark anything as read.
Inputs: chat (required), limit.
get_style_profileARead-only
Show the stored writing-style profile, if there is one.
Inputs: no named parameters.
list_chatsARead-only
List recent dialogs, newest first. Use the returned chat_id for every other tool.
Inputs: limit, archived, unread_only.
list_contactsARead-only
List saved contacts.
Inputs: no named parameters.
mark_readAIdempotent
Mark a chat as read. The other side sees read receipts — this is visible to them.
Inputs: chat (required).
sample_my_messagesARead-only
Collect messages the user themselves wrote, as raw material for describing how they write. Private chats only, text only, no recipients — this is a style sample, not a transcript.
Inputs: chats, per_chat, min_length.
save_style_profileAIdempotent
Store the description of how the user writes. Replaces any previous one. It is loaded on every start and used when drafting on their behalf.
Inputs: profile (required).
search_chatsARead-only
Find dialogs by title or username. Matches across scripts, so "Вадим" finds "Vadim" and "Sasha" finds "Саша". Several chats often match a common first name — check the results and pick the right chat_id before sending anything.
Inputs: query (required), limit.
search_messagesARead-only
Full-text search over messages, inside one chat or across the whole account when chat is omitted.
Inputs: query (required), chat, limit.
search_public_chatsARead-only
Search all of Telegram — not the user's own dialogs — for public channels, groups, bots and users by name or @username. Use this to find a chat the user has never opened; use search_chats for the ones they already have. Results are split into "mine" (their own contacts and dialogs) and "public" (everyone else). Public results are strangers: several channels share one name, and the flags say which is verified and which is flagged as a scam.
Inputs: query (required), limit.
search_public_postsARead-only
Full-text search over posts in every public channel on Telegram, whether or not the user follows them. This is the whole network, not the account: use search_messages for the user's own chats. Telegram rations these searches — the result reports how many free ones are left today, so do not spend them on repeated near-identical queries.
Inputs: query (required), limit.
send_fileADestructive
Upload a local file to a chat. Delivered immediately, no undo.
Inputs: chat (required), path (required), caption.
send_messageADestructive
Send a text message. It is delivered immediately and there is no undo — confirm the chat_id came from list_chats or search_chats first.
Inputs: chat (required), text (required), reply_to.
whoamiARead-only
Show which Telegram account this server is signed in as.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool has a distinct purpose: account identity, chat listing/searching by scope, messaging, file/media operations, read status, and style profiling. No two tools overlap in function; searching is divided by scope (own chats, public channels, public posts) to avoid ambiguity.
Most tools follow verb_noun snake_case pattern (list_chats, search_messages, send_file). 'whoami' is a minor deviation as a single word command. Overall consistent and predictable.
With 16 tools, the set covers the core Telegram operations without being overly large. The count is slightly above the typical 3-15 range but still well-scoped for a messaging server that includes a style profiling subsystem.
The tool surface covers listing, searching, sending, reading, and style profiling. However, common CRUD operations like message editing, deletion, reactions, and chat management (create/leave/mute) are missing, which agents might need.
Maintenance
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Hosted Telegram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Unofficial Telegram MCP server — read, search, reply and react in your own Telegram account.
Your Gmail, Calendar, Drive, GitHub, Oura, wallet and confirmed profile facts in any MCP client.
Related MCP Servers
- FlicenseBqualityBmaintenanceProvides full access to a personal Telegram account via MTProto, enabling MCP clients to read chats, send messages, manage media, and more.70-
- AlicenseBqualityCmaintenanceEnables MCP clients to operate a Telegram account as a userbot, providing tools for reading and sending messages, searching chats and contacts, managing media, and performing other account actions via MTProto with a locally encrypted session.28MIT
- FlicenseNot gradedqualityCmaintenanceEnables users to interact with their own Telegram account through MTProto, supporting chat listing, message reading and searching, sending messages, and fetching contacts via MCP tools.-
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to drive a real Telegram account, exposing chats, messages, media, secret chats, admin rights, invite links, Mini Apps, and multi-account routing as callable tools.32GPL 3.0