Labsco
overpod logo

MCP Telegram

β˜… 16

from overpod

Telegram MCP server with 20 tools β€” read chats, search messages, download media via MTProto

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedPaid serviceAdvanced setup

MCP Telegram

npm npm downloads Node.js TypeScript MCP SDK License: MIT mcp-telegram MCP server

πŸ“– Documentation Β· ☁️ Cloud version β€” connect Telegram to Claude.ai or ChatGPT in 30 seconds with QR code, no API keys needed.

<p align="center"> <img src="assets/demo.gif" alt="MCP Telegram demo β€” connect and summarize chats in Claude" width="700"> </p>

An MCP (Model Context Protocol) server that connects AI assistants like Claude to Telegram via the MTProto protocol. Unlike bots, this runs as a userbot -- it operates under your personal Telegram account using GramJS, giving full access to your chats, contacts, and message history.

Features

  • Comprehensive tool coverage -- the most full-featured Telegram MCP server available
  • MTProto protocol -- direct Telegram API access, not the limited Bot API
  • Userbot -- operates as your personal account, not a bot
  • Full-featured -- messaging, reactions, polls, scheduled messages, stickers, media, contacts, and more
  • Forum Topics -- list topics, read per-topic messages, send to specific topics, per-topic unread counts
  • Stickers -- search sticker sets, browse installed/recent stickers, send stickers to any chat
  • Account & profile management -- update profile, set emoji status, birthday, personal channel, profile photo, manage privacy settings, sessions, auto-delete timers
  • Chat folders -- create, edit, delete and reorder folders, toggle folder tags, read suggested folders (v1.33.0)
  • Global privacy -- read and set account-wide privacy settings (v1.33.0)
  • Global search -- search messages across all chats at once
  • Real-time polling -- fetch updates via stateless cursors; agent owns {pts, qts, date} state
  • Inline bots & buttons -- query inline bots, send results, press callback buttons
  • Stories -- read stories from peers, get story view stats; publish/edit/delete stories, react, pin, stealth mode, archive, report (v1.30.0)
  • Discussion -- get discussion-group info for channel posts with comments, list groups eligible for discussion (v1.30.0)
  • Read Receipts -- who read a message in a small group, when your private message was read (v1.30.0)
  • Admin controls -- toggle channel signatures, anti-spam, forum mode, prehistory; approve join requests
  • Stats -- channel and supergroup analytics (GetBroadcastStats / GetMegagroupStats)
  • Boosts & Business -- boost status, boosters list, Telegram Business chat links CRUD, work hours, location, greeting/away/intro messages
  • Star gifts -- browse available and saved gifts, save/convert gifts, manage Stars balance and subscriptions (opt-in via MCP_TELEGRAM_ENABLE_STARS=1, v1.34.0)
  • Shared daemon -- one background process serves multiple MCP clients over a single Telegram session; see the shared-daemon guide (v1.38.0)
  • QR code login -- authenticate by scanning a QR code in the Telegram app
  • Session persistence -- login once, stay connected across restarts
  • Human-readable output -- sender names are resolved, not just numeric IDs
  • Works with any MCP client -- Claude Code, Claude Desktop, ChatGPT, Cursor, VS Code, Mastra, etc.

Tools

All tools are auto-discoverable via MCP β€” your AI client will see the full list with parameters and descriptions when connected.

CategoryTools
Authtelegram-status, telegram-login, telegram-logout
Messagingtelegram-send-message (incl. quoteText for verbatim reply quotes and Premium message effect), telegram-edit-message, telegram-delete-message, telegram-forward-message, telegram-send-scheduled, telegram-send-typing, telegram-translate-message, telegram-get-message-link
Scheduledtelegram-get-scheduled, telegram-delete-scheduled
Readingtelegram-list-chats, telegram-read-messages, telegram-search-messages, telegram-search-global, telegram-search-chats, telegram-get-unread, telegram-mark-as-read, telegram-get-replies, telegram-get-unread-mentions, telegram-get-unread-reactions, telegram-get-saved-dialogs
Draftstelegram-save-draft, telegram-get-drafts, telegram-clear-drafts
Forum Topicstelegram-list-topics, telegram-read-topic-messages, telegram-create-topic, telegram-edit-topic, telegram-delete-topic
Pollstelegram-create-poll
Poll Interaction (v1.31.0)telegram-vote-poll, telegram-get-poll-results, telegram-get-poll-voters, telegram-close-poll
Reactionstelegram-send-reaction, telegram-get-reactions, telegram-set-default-reaction, telegram-get-top-reactions, telegram-get-recent-reactions
Paid Reactions (v1.31.0)telegram-send-paid-reaction (β˜… Stars), telegram-toggle-paid-reaction-privacy, telegram-get-paid-reaction-privacy
Audio Transcription (v1.31.0)telegram-transcribe-audio (Premium), telegram-get-transcription, telegram-rate-transcription
Fact-check (v1.31.0)telegram-get-fact-check, telegram-edit-fact-check, telegram-delete-fact-check
Stickerstelegram-send-sticker, telegram-get-installed-stickers, telegram-get-recent-stickers, telegram-get-sticker-set, telegram-search-sticker-sets
Mediatelegram-send-file, telegram-download-media, telegram-get-profile-photo, telegram-get-web-preview
Rich Media Sendingtelegram-send-voice, telegram-send-video-note (round video), telegram-send-location (static or live), telegram-send-venue, telegram-send-contact, telegram-send-dice (πŸŽ²πŸŽ―πŸŽ°πŸ€βš½πŸŽ³), telegram-send-album (2–10 grouped photos/videos)
Groupstelegram-create-group, telegram-edit-group, telegram-invite-to-group, telegram-join-chat, telegram-leave-group, telegram-kick-user, telegram-ban-user, telegram-unban-user, telegram-set-admin, telegram-remove-admin, telegram-get-my-role, telegram-set-chat-permissions, telegram-set-slow-mode, telegram-get-admin-log
Chat Infotelegram-get-chat-info, telegram-get-chat-members, telegram-get-chat-folders
Folders (v1.33.0)telegram-create-folder, telegram-edit-folder, telegram-delete-folder, telegram-reorder-folders, telegram-get-suggested-folders, telegram-toggle-folder-tags
Global Privacy (v1.33.0)telegram-get-global-privacy-settings, telegram-set-global-privacy-settings
Invite Linkstelegram-create-invite-link, telegram-get-invite-links, telegram-revoke-invite-link
Contactstelegram-get-contacts, telegram-add-contact, telegram-get-contact-requests
Moderationtelegram-block-user, telegram-unblock-user, telegram-report-spam
Profiles (read)telegram-get-profile, telegram-update-profile
Profile (write, v1.32.0)telegram-set-emoji-status (Premium), telegram-list-emoji-statuses, telegram-clear-recent-emoji-statuses, telegram-set-profile-color (Premium), telegram-set-birthday, telegram-set-personal-channel, telegram-set-profile-photo, telegram-delete-profile-photo
Accounttelegram-get-sessions, telegram-terminate-session, telegram-set-privacy, telegram-set-auto-delete
Pinningtelegram-pin-message, telegram-unpin-message
Chat Settingstelegram-mute-chat, telegram-archive-chat, telegram-pin-chat, telegram-mark-dialog-unread
Admin Togglestelegram-toggle-channel-signatures, telegram-toggle-anti-spam, telegram-toggle-forum-mode, telegram-toggle-prehistory-hidden, telegram-set-chat-reactions, telegram-approve-join-request
Statstelegram-get-broadcast-stats, telegram-get-megagroup-stats
Inline Bots & Buttonstelegram-inline-query, telegram-inline-query-send, telegram-press-button, telegram-get-message-buttons
Real-Time Pollingtelegram-get-state, telegram-get-updates, telegram-get-channel-updates
Stories (read)telegram-get-all-stories, telegram-get-peer-stories, telegram-get-stories-by-id, telegram-get-story-views
Stories (write, v1.30.0)telegram-send-story, telegram-edit-story, telegram-delete-stories, telegram-react-to-story, telegram-export-story-link, telegram-read-stories, telegram-toggle-story-pinned, telegram-toggle-story-pinned-to-top, telegram-activate-stealth-mode (Premium), telegram-get-stories-archive, telegram-report-story
Discussion (v1.30.0)telegram-get-discussion-message, telegram-get-groups-for-discussion
Read Receipts (v1.30.0)telegram-get-message-read-participants, telegram-get-outbox-read-date
Booststelegram-get-my-boosts, telegram-get-boosts-status, telegram-get-boosts-list
Business (v1.32.0)telegram-get-business-chat-links, telegram-create-business-chat-link, telegram-edit-business-chat-link, telegram-delete-business-chat-link, telegram-resolve-business-chat-link, telegram-set-business-hours, telegram-set-business-location, telegram-set-business-greeting, telegram-set-business-away, telegram-set-business-intro
Opt-in (env-gated)telegram-get-group-call, telegram-get-group-call-participants (requires MCP_TELEGRAM_ENABLE_GROUP_CALLS=1); Stars & gifts telegram-get-stars-status, telegram-get-stars-transactions, telegram-get-stars-topup-options, telegram-get-stars-subscriptions, telegram-change-stars-subscription, telegram-get-available-star-gifts, telegram-get-saved-star-gifts, telegram-save-star-gift, telegram-convert-star-gift (requires MCP_TELEGRAM_ENABLE_STARS=1); telegram-get-quick-replies, telegram-get-quick-reply-messages (requires MCP_TELEGRAM_ENABLE_QUICK_REPLIES=1)

Tip: Ask your AI assistant "What Telegram tools are available?" to get the full list with parameters and descriptions.

Optional Features

Some tools are disabled by default and must be opted in via environment variables:

VariableValueTools enabled
MCP_TELEGRAM_ENABLE_GROUP_CALLS1telegram-get-group-call, telegram-get-group-call-participants
MCP_TELEGRAM_ENABLE_STARS1Stars balance & transactions, top-up options, subscriptions, and Star Gifts (browse / save / convert)
MCP_TELEGRAM_ENABLE_QUICK_REPLIES1telegram-get-quick-replies, telegram-get-quick-reply-messages

Add these to your .env file or MCP client config to enable them.

Development

npm run dev        # Start with file watching (tsx)
npm start          # Start the MCP server
npm run login      # QR code login in terminal
npm run build      # Compile TypeScript
npm run lint       # Check code with Biome
npm run lint:fix   # Auto-fix lint issues
npm run format     # Format code with Biome

Project Structure

src/
  index.ts            -- MCP server entry point
  telegram-client.ts  -- TelegramService class (GramJS wrapper)
  qr-login-cli.ts     -- CLI utility for QR code login
  tools/              -- Modular tool definitions
    auth.ts           -- Connection & login
    messages.ts       -- Send, read, search, edit, delete, forward; inline bots; real-time polling
    chats.ts          -- Chat listing, group management, admin toggles, stats
    contacts.ts       -- Contacts, profiles, moderation
    media.ts          -- Files, photos, downloads
    reactions.ts      -- Reactions, set-chat-reactions
    extras.ts         -- Pin, schedule, polls, topics
    stickers.ts       -- Sticker sets, send, search, browse
    account.ts        -- Sessions, privacy, auto-delete, profile, emoji status, birthday, chat mute/folders, invite links
    business.ts       -- Telegram Business: chat links CRUD, work hours, location, greeting/away/intro
    boosts.ts         -- Boost status, my boosts, boosters list
    stories.ts        -- Stories: list all, peer, by-id, view stats
    group-calls.ts    -- Group call info and participants (opt-in: MCP_TELEGRAM_ENABLE_GROUP_CALLS)
    stars.ts          -- Stars wallet status and transactions (opt-in: MCP_TELEGRAM_ENABLE_STARS)
    quick-replies.ts  -- Quick replies and messages (opt-in: MCP_TELEGRAM_ENABLE_QUICK_REPLIES)
    shared.ts         -- Shared utilities

Tech Stack

  • TypeScript -- ES2022, ESM modules
  • GramJS (telegram) -- Telegram MTProto client
  • @modelcontextprotocol/sdk -- MCP server framework
  • Zod -- Runtime schema validation for tool parameters
  • Biome -- Linter and formatter
  • tsx -- TypeScript execution without a build step
  • dotenv -- Environment variable management

Security

  • API credentials are stored in .env (gitignored)
  • Session is stored in ~/.mcp-telegram/session with 0600 permissions (owner-only access)
  • Session directory is created with 0700 permissions
  • Phone number is not required -- QR-only authentication
  • No data is sent to third-party services -- all communication goes directly to Telegram servers via MTProto
  • QR login codes are generated locally and never leave your machine
  • One session per process -- using the same session in multiple processes simultaneously causes AUTH_KEY_DUPLICATED errors (see Troubleshooting)
  • This is a userbot (personal account), not a bot -- respect the Telegram Terms of Service

License

MIT