Overview
Send and receive Telegram messages via bot API.
Setup
Run with npx:
npx -y @modelcontextprotocol/server-telegramConfiguration
TELEGRAM_BOT_TOKEN environment variableDocumentation
Telegram MCP
Overview
The Telegram MCP server enables AI agents to send and receive messages via the Telegram Bot API. Perfect for building AI-powered chatbots, notification systems, and communication assistants.
Features
- Send Messages: Send text, photos, and documents to chats
- Receive Messages: Get messages from chats (via webhook or polling)
- Manage Chats: List and manage chat conversations
- File Uploads: Send files and media
- Keyboard Buttons: Create interactive buttons
Installation
npx -y @modelcontextprotocol/server-telegram
Configuration
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-telegram"],
"env": {
"TELEGRAM_BOT_TOKEN": "your-bot-token"
}
}
}
}
Bot Setup
- Talk to BotFather on Telegram
- Create a new bot with
/newbot - Get the bot token
- Set the
TELEGRAM_BOT_TOKENenvironment variable
Available Tools
| Tool | Description |
|---|---|
send_message | Send a text message |
send_photo | Send a photo |
send_document | Send a file |
get_updates | Get recent messages |
get_chat_info | Get chat details |
get_chat_history | Get message history |
Usage Examples
Send a Notification
Send a message to my personal chat saying "Task completed!"
Create a Bot Response
Set up the bot to respond to "hello" with a friendly greeting.
Get Chat History
Show me the last 10 messages from the #general chat.
Pros
- ✅ Easy bot setup via BotFather
- ✅ Rich message types (text, media, files)
- ✅ Interactive keyboard buttons
- ✅ Good for notifications and alerts
Cons
- ❌ Requires bot token
- ❌ Limited to Telegram ecosystem
- ❌ Webhook setup needed for real-time
