telegram-mcp
Provides tools for interacting with Telegram, enabling the ability to send text messages, read chat histories, search through messages, and retrieve detailed information about dialogs and recent communications.
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-mcpsend a message to Alice saying I'll be there in ten minutes"
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
A Model Context Protocol (MCP) server for interacting with Telegram using mtcute.
Features
Send text messages to chats
Wait for incoming messages in specific chats
Read messages from chats
Search messages
List and get information about dialogs (chats)
Get recent messages across all chats
Set and inspect emoji-status IDs for accounts and channels
Related MCP server: io.github.daedalus/mcp-telegram-bot
Setup
Installation
Option 1: Download Pre-built Binary
Download the latest release for your platform from the releases page:
macOS (Apple Silicon):
telegram-mcp-darwin-arm64.tar.gzmacOS (Intel):
telegram-mcp-darwin-x64.tar.gzLinux:
telegram-mcp-linux-x64.tar.gzWindows:
telegram-mcp-win-x64.exe.zip
Extract the archive and make the binary executable (Unix systems):
tar -xzf telegram-mcp-*.tar.gz
chmod +x telegram-mcpOption 2: Build from Source
Clone the repository and install dependencies:
git clone git@github.com:zhigang1992/telegram-mcp.git cd telegram-mcp bun installBuild the executable:
bun run build
Initial Setup (First Time Only)
Get your Telegram API credentials from https://my.telegram.org
Run the initial setup to authenticate with Telegram:
export API_ID=your_api_id export API_HASH=your_api_hash ./telegram-mcpThe server will:
Prompt you to enter your phone number
Send you a verification code via Telegram
Ask for the verification code
Display the absolute storage path (you'll need this for MCP configuration)
Note the storage path displayed in the output. It will look something like:
Storage path: /Users/username/telegram-mcp/bot-data/session
Usage
As an MCP Server
Add to your Claude Desktop config using the storage path from the initial setup:
{
"mcpServers": {
"telegram": {
"command": "/path/to/telegram-mcp",
"env": {
"API_ID": "your_api_id",
"API_HASH": "your_api_hash",
"TELEGRAM_STORAGE_PATH": "/absolute/path/from/initial/setup"
}
}
}
}Important: The TELEGRAM_STORAGE_PATH must be the absolute path shown during initial setup. This ensures the MCP server uses the authenticated session.
Available Tools
Message Tools
messages_sendText- Send a text message to a chatchatId(required): Chat/User ID or usernametext(required): Message text to sendreplyToMessageId: Optional message ID to reply to
messages_getHistory- Get message history from a chatchatId(required): Chat/User ID or usernamelimit: Number of messages (default: 100, max: 100)offsetId: Message ID for pagination
messages_search- Search for messagesquery(required): Search querychatId: Specific chat to search in (optional)limit: Number of results (default: 50)
messages_getRecent- Get recent messages from all chatslimit: Number of chats (default: 10)messagesPerChat: Messages per chat (default: 10)
Interactive Tools
wait_for_reply- Wait for the next message in a chatchatId(required): Chat/User ID or username to wait for a message fromtimeoutSeconds: Timeout in seconds (default: 60, max: 300)
Status Tools
status_getCurrent- Get the current emoji status for a peerpeerId: Target peer, defaults toself
status_setEmoji- Set or clear an emoji statuspeerId: Target peer, defaults toselfemojiId: Custom emoji document ID, required unlessclear=trueisCollectible: SettruewhenemojiIdis a collectible IDuntil: Optional ISO-8601 timestamp or Unix timestamp stringclear: Clear the current status instead of setting one
status_listAvailable- List available default emoji-status IDsscope:selforchannel(default:self)limit: Maximum IDs to return (default: 100)
status_listCollectibles- List owned collectible IDs usable as self emoji statusesowner: Peer to inspect, defaults toselflimit: Maximum collectibles to return (default: 100)
Dialog Tools
dialogs_list- List all dialogslimit: Maximum dialogs (default: 50)filter: Filter options (onlyUsers, onlyGroups, onlyChannels)
dialogs_getInfo- Get detailed dialog informationchatId(required): Chat/User ID or username
Development
Run in development mode:
bun run devThe server stores session data in bot-data/ directory.
This server cannot be deployed
Maintenance
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Unofficial Telegram MCP server — read, search, reply and react in your own Telegram account.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- FlicenseBqualityDmaintenanceAn MCP server that enables interaction with Telegram messaging platform, allowing users to retrieve unread messages, fetch entity information, and send messages through natural language interfaces.610-
- AlicenseAqualityCmaintenanceMCP server that exposes a Telegram bot, enabling sending messages and retrieving updates through natural language.313 PyPI1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for sending and receiving Telegram messages via a bot, enabling AI assistants to interact directly through Telegram by sending messages, reading recent messages, and sending photos.23 npmMIT
- FlicenseNot gradedqualityCmaintenanceMCP server that enables interaction with the Telegram Bot API, allowing users to send messages, retrieve updates, and access chat information through natural language.-