Telegram MCP logo

Telegram MCP

Telegram MCP server: read, send, and search messages and manage chats via your account.

Install Telegram MCP

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "telegram-mcp-2": {
      "command": "uvx",
      "args": [
        "telegram-mcp-jgalea"
      ]
    }
  }
}

Settings β†’ Developer β†’ Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window β€” this can mean a slow first-time install rather than a real problem.

uvx telegram-mcp-jgalea

Process exited before answering initialize.

This is an experimental automated check and can have false negatives β€” missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

Security & health

What it can reach and how reliably it runs β€” from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8h ago via OSV.dev Β· telegram-mcp-jgalea (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars7Stargazers on the source repository.
Last commit26d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window β€” often a slow first install.

From the project README

telegram-mcp

Give your AI tools direct access to Telegram. Read chats, send messages, search history, manage groups, download media β€” all via the Model Context Protocol.

telegram-mcp is an MCP server that connects your Telegram account to Claude Code, Cursor, Windsurf, or any AI tool that supports MCP. Instead of switching to Telegram, you ask the AI to check your messages, reply to someone, or find that link from last week β€” and it does.

What makes this different:

  • Your real account. Uses MTProto (Telethon), not the Bot API. You see everything you'd see in the Telegram app β€” private chats, groups, channels, media.
  • 40 tools. Chats, messages, search, media, contacts, groups, channels, scheduling, reactions, admin tools, and more.
  • Passive caching. Messages are cached in local SQLite as you use the server. No explicit sync step β€” the cache builds itself. Gives you searchable history that grows over time.
  • Security first. Session files stored with restricted permissions. No credentials in config files. Rate limiting built in.

Quick Start

This is not a bot. There is no bot to add. No third party gives you a phone number. You log in as yourself, with the same phone number you already use for Telegram. If an AI tool tells you to "add a bot to give you a number", ignore it β€” and never share a Telegram login code with anyone, ever.

If you're asking Claude (or another AI agent) to install this for you: the agent can wire up the MCP server config and clone the repo, but the agent cannot complete the login step. Login is interactive β€” Telegram sends a code to your phone, and you type it into a terminal prompt yourself. You must run telegram-mcp login in a real terminal once, then the agent can use the server.

Install from PyPI

bash
uv tool install telegram-mcp-jgalea

Or with pip:

Terminal
pip install telegram-mcp-jgalea

Both provide the telegram-mcp command.

Install from source

bash
git clone https://github.com/jgalea/telegram-mcp.git
cd telegram-mcp
uv sync

Authenticate

Run the login command once to create your Telegram session:

bash
telegram-mcp login

You'll need a Telegram API ID and hash first. To get them:

  1. Go to my.telegram.org and log in with your phone number
  2. Click API development tools
  3. If you already have an app, use those credentials. Telegram only allows one API app per account, and the same api_id/api_hash work for any Telegram project.
  4. If not, fill in the form: App title (e.g. "telegram-mcp"), Short name (anything), Platform: "Other". Description can be left blank. Click Create application.
  5. Copy the App api_id (a number) and App api_hash (a hex string)

The login command will prompt for these if not already configured, then ask for:

  1. Your phone number
  2. The verification code Telegram sends you
  3. Your 2FA password (if enabled)

The session is saved to ~/.telegram-mcp/session.session. You only need to do this once.

Connect to Claude Code

Add to your MCP config (~/.claude.json):

config.json
{
  "mcpServers": {
    "telegram": {
      "command": "telegram-mcp",
      "args": ["serve"]
    }
  }
}

If installed from source:

config.json
{
  "mcpServers": {
    "telegram": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/telegram-mcp", "telegram-mcp", "serve"]
    }
  }
}

Troubleshooting

Tools return errors or empty results

You almost certainly haven't logged in yet. Installing the MCP server and logging into Telegram are two separate steps β€” installation alone is not enough. Run telegram-mcp login in a real terminal and complete the phone + code + 2FA flow. After that, restart Claude Code (or your MCP client) so the proxy picks up the new session.

You can confirm the session is healthy with the get_status tool β€” it returns {"connected": true, "authorized": true} when ready.

Claude says "this MCP can only access a bot conversation"

This is a hallucination. The server uses MTProto (Telethon) and logs in as your full Telegram account β€” every chat, group, channel, and contact you can see in the Telegram app is accessible. There is no bot involved. If this message appears, the underlying cause is almost always that the login step hasn't been done; see above.

Claude tells me to add a bot or give my number to a bot

Do not. This is unsafe advice, never required, and never part of this MCP's setup. Telegram login codes are how attackers steal accounts β€” never enter them into any bot or third-party service. The only place to type your code is the telegram-mcp login prompt running in your own terminal.

Daemon won't start / "another telegram-mcp daemon is running"

Check for a stale lock: ls ~/.telegram-mcp/daemon.lock and lsof ~/.telegram-mcp/daemon.sock. If no process is actually running, remove the stale socket file (rm ~/.telegram-mcp/daemon.sock) and retry. The lock auto-releases when the daemon exits cleanly or crashes.

"Not configured" / "Not authorized" errors

Same root cause as the first item β€” run telegram-mcp login. "Not configured" means ~/.telegram-mcp/config.json is missing API credentials; "Not authorized" means the credentials are there but no Telegram session exists yet.

Tools

Chats

ToolDescription
list_chatsList all dialogs (groups, channels, DMs) with unread counts
get_chat_infoDetails for a specific chat (members, description, type)
create_groupCreate a new group
create_channelCreate a new channel
archive_chatArchive or unarchive a chat
mute_chatMute or unmute notifications for a chat
leave_chatLeave a group or channel
delete_chatDelete a chat
mark_readMark a chat as read

Messages β€” Read

ToolDescription
read_messagesGet recent messages from a chat, with time and sender filters
search_messagesSearch by keyword or regex, optionally scoped to a chat
get_messageGet a single message by ID
get_message_repliesGet replies and thread for a message
get_scheduled_messagesList scheduled messages in a chat

Messages β€” Write

ToolDescription
send_messageSend a message to a chat (supports reply-to for forum topics)
edit_messageEdit a sent message
delete_messageDelete a message
forward_messageForward a message to another chat
schedule_messageSend a message at a future time
send_reactionReact to a message with an emoji

Messages β€” Manage

ToolDescription
pin_messagePin a message in a chat
unpin_messageUnpin a message

Media

ToolDescription
download_mediaDownload a photo, video, or document from a message (never overwrites)
send_fileSend a file or photo to a chat
send_voiceSend a voice message
send_locationSend a location
get_sticker_setsList available sticker packs

Contacts

ToolDescription
list_contactsList all contacts
get_contactGet contact details

Users

ToolDescription
get_userGet user profile info
block_userBlock a user
unblock_userUnblock a user

Groups & Channels

ToolDescription
get_participantsList members of a group or channel
add_participantAdd a user to a group or channel
remove_participantRemove a user from a group or channel
set_chat_titleChange a chat's title
set_chat_descriptionChange a chat's description
set_chat_photoChange a chat's photo
get_invite_linkGenerate an invite link
get_admin_logGet admin action history

Account & Utility

ToolDescription
get_meCurrent account info
get_statusConnection status and session health
get_dialogs_statsUnread counts and chat activity summary
export_chatExport a chat (max 1000 messages) to a JSON file in the downloads dir
clear_cacheWipe the local message cache

Architecture

Code
telegram-mcp/
β”œβ”€β”€ src/telegram_mcp/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ server.py        # MCP server, tool definitions, stdio entry point
β”‚   β”œβ”€β”€ client.py        # Telethon wrapper β€” all Telegram API calls
β”‚   β”œβ”€β”€ cache.py         # SQLite write-through cache
β”‚   └── login.py         # Interactive login CLI
β”œβ”€β”€ tests/
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ README.md
└── LICENSE

How it works

  1. server.py starts an MCP server on stdio, registers all tools, and handles incoming requests
  2. Each tool calls methods on client.py, which wraps Telethon's async API into clean functions
  3. cache.py intercepts results from client.py and writes messages to a local SQLite database. Search tools query Telegram live and merge with cached results for deeper history.
  4. login.py is a standalone CLI that runs the interactive Telethon auth flow and saves the session file

Data flow

Code
Claude Code β†’ MCP request β†’ server.py β†’ client.py β†’ Telegram API
                                              ↓
                                          cache.py β†’ ~/.telegram-mcp/cache.db

Storage

All data lives in ~/.telegram-mcp/:

Code
~/.telegram-mcp/
β”œβ”€β”€ config.json          # API ID, API hash, policy
β”œβ”€β”€ session.session      # Telethon session file (auth state)
β”œβ”€β”€ cache.db             # SQLite message cache
β”œβ”€β”€ audit.log            # Write-tier call log (rotates at 5 MB)
β”œβ”€β”€ daemon.log           # Daemon log (rotates at 5 MB, 2 backups)
└── downloads/           # Downloaded media and exports

Cache behavior

Reviews

No reviews yet β€” be the first to share how it worked for you.

Frequently Asked Questions about Telegram MCP

telegram-mcp is an MCP server that connects your Telegram account to MCP-compatible AI tools such as Claude Code, Cursor, and Windsurf. It uses Telethon and MTProto to let you read, send, and search messages, manage chats, groups, and channels, and work with media through your own Telegram account.

No, telegram-mcp is not a bot; it connects using your own Telegram account through MTProto and Telethon. You log in with the phone number you already use for Telegram, and there is no bot to add or third party that provides a phone number.

Run `telegram-mcp login` in a real terminal after obtaining a Telegram API ID and hash from my.telegram.org. The interactive login asks for your phone number, Telegram verification code, and 2FA password if enabled, then saves the session locally.

telegram-mcp provides tools for reading, sending, and searching messages; managing chats, groups, and channels; downloading media; handling contacts, scheduling, reactions, and admin tasks. Messages are passively cached in a local SQLite database as you use the server.

Install it from PyPI with `uv tool install telegram-mcp-jgalea` or `pip install telegram-mcp-jgalea`, then configure your MCP client to run `telegram-mcp serve`. You must complete `telegram-mcp login` separately before the server can access your Telegram account.

Related MCP servers

Add a badge to your READMEShow it’s listed β€” live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTelegram MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/telegram-mcp-2?style=directory)](https://allmcps.com/mcp/telegram-mcp-2)
HTML Embed
<a href="https://allmcps.com/mcp/telegram-mcp-2"><img src="https://allmcps.com/api/badge/telegram-mcp-2?style=directory" alt="Telegram MCP on AllMCPs" /></a>