telegram-mcp
Provides read-only access to your Telegram account, allowing AI agents to list chats, read messages, search messages across chats or within one, check link status, and relink the account.
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-mcpsearch all my chats for the invoice number"
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
Let your AI agent read your Telegram.
A small server that runs in your own Cloudflare account, signs in as you (a normal Telegram login, like Telegram Desktop), and lets any MCP client (Claude Code, Claude Desktop, anything that speaks MCP) list, read and search your chats. It is read-only: nothing in it can send, edit or delete a message.
Ask your agent things like:
"What did Dana say about the flights?"
"Search all my chats for the invoice number."
"Summarize what I missed in the family group today."
Status: pre-release. The plumbing is tested (see Status); the Telegram login and the read tools have not yet been run against a real account. Try it on a spare account first.
How it works
Telegram keeps your whole history on its servers, so there is nothing to sync or mirror. Every tool call is a live request to Telegram through mtcute (an MTProto client) running inside a Durable Object. The only thing stored is the Telegram login itself, in that object's SQLite. No computer of yours needs to stay on.
Related MCP server: my-tg-mcp
Set it up
You need a Cloudflare account, Node 22.18+, and the Telegram app on your phone.
1. Get Telegram API credentials. Log in at https://my.telegram.org, open API development tools and create an app. Keep the api_id and api_hash private.
2. Deploy.
git clone https://github.com/sigman78/telegram-mcp
cd telegram-mcp
npm install
# A place for the sign-in tokens. Paste the id it prints into wrangler.jsonc.
npx wrangler kv namespace create OAUTH_KV
npx wrangler secret put TG_API_ID
npx wrangler secret put TG_API_HASH
npx wrangler secret put OWNER_PASSWORD # 12+ characters. Make it long.
npm run deployWrangler prints your URL, e.g. https://telegram-mcp.your-name.workers.dev. To keep your own KV id out of git, put it in wrangler.local.jsonc (git-ignored) and deploy with npm run deploy:local. Times are shown in UTC unless you set a TIMEZONE var (an IANA zone such as Europe/Berlin) in the config.
3. Link your account. Open <your-url>/setup, enter the password, and scan the QR code in Telegram (Settings > Devices > Link Desktop Device). If the account has two-step verification, the page asks for that password too.
4. Connect your agent.
claude mcp add --transport http telegram https://your-url/mcpThen type /mcp and sign in with the password. Other clients: point them at the same /mcp URL.
Tools
Tool | What it does |
| Chats, most recent first, with unread counts and the latest message. Filter by name, @username or id. |
| Read one chat, oldest first. Page back with |
| Telegram's own search, across all chats or inside one. |
| Linked as whom, and whether the session is still valid. |
| Log out of Telegram so you can link again. |
Security
Your Telegram session is a key to your whole account. Treat a deployment like a password manager.
The session lives only in the Durable Object. No messages are stored anywhere.
/mcpneeds an OAuth token, issued only after you type the password in the browser that started the approval. The approval screen names the app and shows where it will be redirected. Client registration is open, so read it.Password guesses are throttled, but that slows a guesser and does not stop one. The strength of the password is the real protection.
Browser sessions last 14 days and cannot be revoked individually; changing
OWNER_PASSWORDsigns everything out.Any approved client can call
relink.Client registration writes to KV and needs no login, so it is capped at 10 per minute per IP (the
ratelimitsbinding inwrangler.jsonc). The cap is approximate, so a determined flood could still use up the free KV write quota and lock you out until it resets.This uses Telegram's API unofficially, with your own
api_id. Keep call volume modest; heavy use triggersFLOOD_WAIT.To end access: remove the device in Telegram (Settings > Devices), call
relink, or delete the Worker.
More in SECURITY.md.
Status
Verified: typecheck and unit tests; mtcute connects to Telegram and makes calls from a deployed Durable Object; the stored login survives a client restart; OAuth registration, consent, sign-in, token exchange and MCP calls end to end; browser-bound approvals; password throttling; idle close not interrupting a long read.
Not yet verified with a real account: QR login, the 2FA step, the read tools against real chats, and that scan notices still arrive with the update stream off. If the setup page stays on the QR code for up to ~30 s after a scan and never shows "Scanned", that last point is the cause.
Related projects
Other Telegram MCP servers exist, mostly local and mostly able to send; for example chigwell/telegram-mcp and freQuensy23-coder/telegram-mcp-serverless (mtcute on Workers). This one differs in being read-only, OAuth-gated for MCP clients, and linked from a web page by QR code.
License
MIT.
This server cannot be deployed
Maintenance
Related MCP Connectors
Unofficial Telegram MCP server — read, search, reply and react in your own Telegram account.
Read-only MCP server: let AI agents read your ORANO saved-video library, tasks, and memory.
Read-only MCP access to authorized Vocci sessions, notes, files, and memory search.
Hosted Telegram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- FlicenseAqualityDmaintenanceRead-only MCP server for self-hosted Telegram access via Telethon. Enables reading messages, chats, and media but disallows any write operations.10-
- FlicenseNot gradedqualityBmaintenanceRead-only MCP access to a personal Telegram account. Allows querying chats, reading and searching messages via Streamable HTTP.-
- AlicenseNot gradedqualityBmaintenanceA read-only Telegram MCP server that only exposes a user-defined allowlist of chats, providing tools to list chats, fetch messages, search, and get context while stripping untrusted text and with no write capabilities.MIT
- FlicenseNot gradedqualityBmaintenanceRead-only MCP server for personal Telegram accounts, exposing chat folders, chats, and recent messages via MTProto.-