Skip to content
MCP server

mcp-telegram MCP Server

Telegram MCP server (MTProto). Connect Claude, Codex, Cursor, Claude Code, VS Code, Cline, Windsurf, and other MCP clients to a real Telegram user account: read dialogs, search messages globally, send/edit/forward, react/poll, moderate channels, tag Saved

mcp-telegram scores 37 (Limited), licensed MIT and written in TypeScript. It installs as a local process. It declares 40 tools. Filed under Communication, AI and memory. GitHub shows 34 stars. Package registries report about 126 downloads a week. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.

by beautyfreeMITTypeScript34 stars
Trust score
37Limited
Trust score 37 of 100, Limited

Limited trust

37 of 100 from six public signals. Nobody can buy a point.

  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 37 comes from

0 + 5 + 8 + 10 + 4 + 10 = 37. Each factor is capped, so no single signal can carry a listing.

Registry0 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 0 of 30 points.
Maintenance5 / 20

How recently the repository saw a commit or release.

Maintenance: 5 of 20 points.
Popularity8 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 8 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "beautyfree-mcp-telegram": {      "command": "npx",      "args": [        "-y",        "mcp-telegram@3.0.0"      ]    }  }}

Environment variables

This server does not declare environment variables.

Tools40Tool docs quality grade D

All capabilities

About

npm version License Node

A Model Context Protocol (MCP) server that connects Claude Desktop, Codex CLI, Cursor, Claude Code, VS Code, Cline, Windsurf, Goose, and any other MCP-compatible client to a real Telegram user account via MTProto—so your agent can read, search, send, moderate, and manage Telegram chats from chat or automated tool calls instead of clicking through the Telegram UI.

Use it to: read dialogs and search messages globally · send/edit/forward/react/poll · download media and transcribe voice notes · moderate channels (ban/restrict/promote, invite links, slow-mode, admin log, forum topics) · manage stories, contacts, drafts, notifications, folders, privacy · or fall through to the raw MTProto bridge for anything else. All against a single signed-in user account—no bot required.

[!WARNING] This server signs in as a real Telegram user (not a bot). Sessions live in ~/.telegram-agent/. Treat that directory like a password.

Prerequisites

  1. Node.js >=20
  2. Telegram API credentials from my.telegram.org/apps — api_id and api_hash

Want a lighter transport?

This package is the MCP server — every tool schema (~12,700 tokens) sits in your agent's context on every turn. Good for any MCP client and for hosted runtimes that can't shell out.

If your agent is Claude Code / Codex CLI / Cursor / Gemini CLI / Cline / Windsurf, there's a companion package — telegram-agent — that ships the same Telegram surface as a universal agent skill. The agent only loads the skill instructions when your prompt mentions Telegram — ~50× lower context cost in idle. Standalone (no MCP server in the loop), but uses the same ~/.telegram-agent/ session store as this package — sign in once, use either or both.

npm i -g telegram-agent
telegram-agent login
npx skills add beautyfree/telegram-agent -a claude-code -g

Continue below for the MCP install path.

Install

Option A — automatic, all clients:

npx add-mcp mcp-telegram \
  --env TELEGRAM_API_ID=123456 \
  --env TELEGRAM_API_HASH=abc...

add-mcp (from Neon) writes the correct config for Claude Desktop, Claude Code, Cursor, VS Code, Codex, Gemini CLI, Cline, Zed, Goose, OpenCode, and others. Pick the client in the interactive prompt.

[!IMPORTANT] Both env vars are required. Get them from my.telegram.org/apps.

Option B — manual config:

{
  "mcpServers": {
    "telegram": {
      "command": "npx",
      "args": ["-y", "mcp-telegram"],
      "env": {
        "TELEGRAM_API_ID": "123456",
        "TELEGRAM_API_HASH": "abc..."
      }
    }
  }
}
{
  "mcpServers": {
    "telegram": {
      "command": "npx",
      "args": ["-y", "mcp-telegram"],
      "env": {
        "TELEGRAM_API_ID": "123456",
        "TELEGRAM_API_HASH": "abc..."
      }
    }
  }
}
{
  "servers": {
    "telegram": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcp-telegram"],
      "env": {
        "TELEGRAM_API_ID": "123456",
        "TELEGRAM_API_HASH": "abc..."
      }
    }
  }
}
claude mcp add telegram \
  -e TELEGRAM_API_ID=123456 \
  -e TELEGRAM_API_HASH=abc... \
  -- npx -y mcp-telegram
[mcp_servers.telegram]
command = "npx"
args = ["-y", "mcp-telegram"]
env = { TELEGRAM_API_ID = "123456", TELEGRAM_API_HASH = "abc..." }

First-time sign in

Ask your agent:

Sign in to my Telegram.

The agent calls the login tool. A browser tab opens. Enter your phone number, the SMS code, and 2FA password if you have one. The tab shows a green checkmark — you can close it. The session is now stored locally and the agent can read your Telegram.

To add another account, ask the agent to call login again.

Tools

102 tools covering the full Telegram user-account surface. Common ones below; the rest are grouped under collapsibles. Every tool accepts an optional accountId (omit when only one account is signed in). peer accepts a numeric chat id, an @username, or the literal "me" (Saved Messages).

Top of the menu:

ToolWhat it does
loginOpen the browser-based sign-in flow. Adds an account.
list_accountsList signed-in accounts.
list_dialogsList dialogs/chats/channels. Filters: unread, archived, ignorePinned, folder, limit.
list_messagesList messages in a dialog. Newest first.
search_messagesSearch inside one dialog: query, filter (photos/videos/url/voice/...), fromUser, date range.
search_globalSearch across every chat you have.
search_dialogsFind dialogs by name/title/username substring.
send_messageSend text. Supports replyTo, topMsgId, parseMode, schedule, silent.
send_fileSend a file (local path or https:// URL). Pass an array for an album.
download_mediaSave the media on a message to disk.
transcribe_messageTranscribe a voice/video note (Premium).
invoke_mtprotoCall any raw MTProto method by name. Auto-resolves peer/channel/user strings.

These are local-only: they manage which Telegram sessions live in ~/.telegram-agent/ and the settings UI. No Telegram API call beyond the sign-in flow itself.

ToolWhat it does
list_accountsList signed-in accounts.
loginBrowser-based sign-in. Adds an account.
logoutDrop a local session and revoke it on Telegram.
open_settingsOpen the local settings page (tool surface + read-only).
ToolWhat it does
get_meReturn the profile of the authenticated user.
update_profileChange own first/last name and bio.
update_my_usernameSet or clear own @username.
set_birthdaySet the account birthday.
set_profile_photoUpload a new avatar (local path or URL).
ToolWhat it does
list_dialogsList dialogs. Filters: unread, archived, ignorePinned, folder, limit.
search_dialogsFind dialogs by name/title/username substring.
resolve_usernameResolve @username to a user/channel/chat entity.
list_foldersList custom dialog folders (chat filters).
list_contactsList contacts.
ToolWhat it does
list_messagesList messages in a dialog.
search_messagesSearch inside one dialog (text, type filter, sender, date range).
search_globalSearch across every chat.
get_messageFetch one or more messages by id.
get_message_reactionsGet reactions on messages.
mark_as_readMark messages read up to an id.
ToolWhat it does
send_messageSend text.
edit_messageEdit a previously sent message.
delete_messagesDelete by id (optionally revoke for all).
forward_messagesForward messages between dialogs.
pin_message / unpin_messagePin / unpin in a dialog.
send_reactionSet reactions on a message.
send_message_to_phoneSend to a phone number, auto-creates a temporary contact.
ToolWhat it does
send_fileSend a file (path or URL). Albums via array.
download_mediaSave a message's media to disk.
download_profile_photoSave a peer's avatar to disk.
transcribe_messageTranscribe voice/video (Premium).
ToolWhat it does
send_pollSend a poll. Supports quiz, multiple-choice, anonymous, close period.
vote_pollCast a vote.
close_pollFinalize a poll.
get_poll_resultsFetch tally.
ToolWhat it does
send_reactionSet emoji reactions on a message.
get_message_reactionsRead reactions.
set_default_reactionSet account-wide default.
ToolWhat it does
list_storiesFeed of contacts' stories.
get_peer_storiesOne peer's stories.
send_storyPost a story (photo or video).
delete_storyDelete own stories.
view_storyMark stories viewed.
get_story_viewersList who viewed your story.
ToolWhat it does
ban_userFull ban (optional untilDate).
unban_userLift restrictions.
restrict_userApply a custom rights mask.
promote_adminGrant admin rights (with rank).
demote_adminStrip admin rights.
invite_userAdd users to a channel/supergroup.
kick_participantKick from chat/channel.
get_participantSingle participant info.
list_participantsMembers with filter (admins/banned/bots/...) and substring search.
delete_user_historyRemove every message by a user.
get_admin_logRecent admin events with event-type filter.
ToolWhat it does
edit_titleChange title (works for channels, supergroups, and basic groups).
edit_aboutChange description.
edit_photoChange avatar (path or URL).
update_usernameSet/clear public @username.
check_usernameCheck availability.
set_slow_modeSet slow-mode seconds.
toggle_signaturesAuthor signatures on channel posts.
toggle_pre_history_hiddenHide history from new members.
toggle_join_requestRequire admin approval to join.
leave_channelLeave a channel/supergroup.
get_channel_infoExtended info (about, counts, linked chat, slow-mode).
get_user_infoExtended user info (bio, common chats).
ToolWhat it does
create_channelNew broadcast channel or supergroup (optional forum mode).
delete_channelPermanently delete.
migrate_chatBasic group → supergroup.
transfer_ownershipHand over creator rights (requires 2FA password).
ToolWhat it does
create_invite_linkNew link with optional expiry, usage cap, join-request gate.
list_invite_linksList active or revoked links.
revoke_invite_linkRevoke a specific link.
list_invite_joinersList users that joined via a link.
ToolWhat it does
list_topicsList forum topics.
create_topicCreate a new topic.
edit_topicRename, re-icon, close, hide.
ToolWhat it does
save_draftSave a draft for a dialog.
clear_draftDrop the draft for a dialog.
list_draftsList all dialog drafts.
ToolWhat it does
mute_peerMute a chat (optional untilDate).
unmute_peerUnmute.
get_notify_settingsRead settings.
set_notify_settingsUpdate mute, previews, sound, story-mute.
ToolWhat it does
create_folderNew folder with include/exclude rules.
edit_folderReplace folder rules.
delete_folderRemove a folder.
reorder_foldersSet display order.
ToolWhat it does
list_contactsAll contacts.
add_contactAdd a user to contacts.
delete_contactRemove users from contacts.
search_contactsSearch contacts + global directory.
ToolWhat it does
block_user / unblock_userBlock / unblock.
list_blockedBlock list.
get_privacyRead a privacy key.
set_privacyUpdate a privacy key (mode + allow/disallow lists).
ToolWhat it does
get_my_stickersInstalled sticker sets.
install_sticker_setInstall by short name.
add_recent_stickerPin a sticker to recent.
ToolWhat it does
get_my_boostsList your boost slots.
apply_boostApply slots to a channel.
ToolWhat it does
get_inline_bot_resultsRun an inline bot query.
invoke_mtprotoCall any MTProto method by qualified name (e.g. messages.SendMessage, stories.GetAllStories). String values for peer/channel/user/fromPeer/toPeer/bot/chat are auto-resolved to InputPeer / InputUser.

Gating which tools are exposed

Three env vars, applied in order:

VariableEffect
MCP_TELEGRAM_READONLY=1Hide every destructive / mutating tool.
MCP_TELEGRAM_TOOLS=name1,name2,prefix*Strict allowlist — only these tools register.
MCP_TELEGRAM_DISABLE=name1,prefix*Blocklist applied after the allowlist.

Examples:

MCP_TELEGRAM_READONLY=1                                    # read-only agent
MCP_TELEGRAM_TOOLS='login,list*,search*,get*'              # discovery-only
MCP_TELEGRAM_DISABLE='delete*,ban*,kick*,create_channel,delete_channel,transfer_ownership,invokeMtproto'  # safer write set

Environment

VariableRequiredDefaultNotes
TELEGRAM_API_IDyes—From my.telegram.org/apps. If unset, the auth page prompts for it and saves to state.json.
TELEGRAM_API_HASHyes—Same as above.
TELEGRAM_AGENT_HOMEno~/.telegram-agentState + per-account session storage. Legacy MCP_TELEGRAM_HOME still accepted. If only ~/.mcp-telegram exists from a previous install, it's used automatically.
TELEGRAM_AGENT_DOWNLOADSno$TELEGRAM_AGENT_HOME/downloadsWhere download_media / download_profile_photo save files. Legacy MCP_TELEGRAM_DOWNLOADS still accepted.
MCP_TELEGRAM_READONLYno—Set to 1/true/yes to hide every destructive tool.
MCP_TELEGRAM_TOOLSno—Strict allowlist. Comma-separated tool names; supports prefix* wildcards. If set, anything not matched is hidden.
MCP_TELEGRAM_DISABLEno—Blocklist applied after the allowlist. Same syntax.
LOG_LEVELnoinfodebug for verbose stderr.

Choosing which tools the agent sees

The three gating vars stack — MCP_TELEGRAM_READONLY → MCP_TELEGRAM_TOOLS → MCP_TELEGRAM_DISABLE.

# Read-only agent — every mutating tool is hidden
MCP_TELEGRAM_READONLY=1

# Discovery-only — only login + the list/search/get tools
MCP_TELEGRAM_TOOLS='login,list*,search*,get*,resolveUsername'

# Allow writes but keep destructive ones away from the agent
MCP_TELEGRAM_DISABLE='delete*,ban*,kick*,create_channel,delete_channel,transfer_ownership,invokeMtproto'

# Specific surface: read + send/edit only
MCP_TELEGRAM_TOOLS='login,list_accounts,list_dialogs,list_messages,search_messages,search_global,send_message,editMessage'

In an MCP client config, drop these into the same env block as TELEGRAM_API_ID/TELEGRAM_API_HASH. To verify, re-open your client — the tools the server advertises are exactly the ones registered after the gates run.

Data layout

~/.telegram-agent/
├── state.json          known accounts (no secrets in here)
└── sessions/
    └── <account_id>/   per-account MTProto session

If a Telegram session is invalidated server-side (logged out from another device, password rotated, etc.), the next tool call returns an error telling the agent to call login to re-authorize.

Development

git clone https://github.com/beautyfree/mcp-telegram
cd mcp-telegram
npm install
echo "TELEGRAM_API_ID=...\nTELEGRAM_API_HASH=..." > .env
npm run dev

Layout:

src/
├── index.ts           bin entry — stdio MCP server, tool registrations
├── telegram.ts        MTProto client + login state machine
├── auth-browser.ts    ephemeral HTTP server that drives the browser flow
├── auth-page.ts       inline HTML for the auth page
├── state.ts           persistent state in ~/.telegram-agent/
└── logger.ts

License

MIT — see LICENSE.


Telegram MCP · MCP Telegram · Telegram MCP server · Telegram for Claude · Telegram for Cursor · Telegram for Claude Code · Telegram for VS Code · Telegram for Codex · Telegram for Cline · Telegram for Windsurf · Telegram for AI agents · Telegram MTProto MCP · Telegram user-account MCP · Telegram automation MCP · Model Context Protocol Telegram · MCP server Telegram · gramjs MCP

Frequently asked questions

What is mcp-telegram MCP Server?

Telegram MCP server (MTProto). Connect Claude, Codex, Cursor, Claude Code, VS Code, Cline, Windsurf, and other MCP clients to a real Telegram user account: read dialogs, search messages globally, send/edit/forward, react/poll, moderate channels, tag Saved

How do I install mcp-telegram MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. mcp-telegram MCP Server runs locally from the npm package mcp-telegram with the command npx -y mcp-telegram@3.0.0.

Is mcp-telegram MCP Server free and open source?

Yes. mcp-telegram MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does mcp-telegram MCP Server support remote (HTTP) connections?

No remote endpoint is listed for mcp-telegram MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does mcp-telegram MCP Server provide?

mcp-telegram MCP Server provides 40 tools, including close_poll, delete_messages, delete_story, and download_media. See the full tool list for descriptions and parameters.

How is mcp-telegram MCP Server's trust score calculated?

mcp-telegram MCP Server scores 37 out of 100 (Limited). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server