tgbot-mcp
Provides tools for sending messages, structured notifications, action buttons, and waiting for replies via the Telegram Bot API.
Click on "Install 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., "@tgbot-mcpSend a Telegram message: 'Deploy completed.'"
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.
tgbot-mcp
A trusted, open-source MCP (Model Context Protocol) server for Telegram.
Built as a clean alternative to closed-source or opaque Telegram MCP packages — bot token authentication only, no personal account access, no proprietary backend.
Features
Bot token auth only — uses the official Telegram Bot API (
api.telegram.org). Your personal account is never touched.4 purpose-built tools for LLM workflows: send messages, send structured notifications, send notifications with action buttons, and wait for user replies.
Language-agnostic — tools are written in English, but the LLM responds to users in their own language automatically. No language is hardcoded.
Smart polling in
wait_for_replyto minimise API calls while staying responsive.
Related MCP server: telegram-mcp
Quick Start
1. Create a Telegram Bot
Open Telegram and message @BotFather.
Send
/newbotand follow the prompts.Copy the bot token (looks like
123456:ABC-DEF...).Start a chat with your new bot, then visit:
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdatesSend any message to the bot and look for
"chat":{"id":...}— that is your chat ID.
2. Register with Your MCP Client
Add the following to your MCP client configuration (e.g. claude_desktop_config.json):
{
"mcpServers": {
"tgbot-mcp": {
"command": "uvx",
"args": ["tgbot-mcp"],
"env": {
"TELEGRAM_BOT_TOKEN": "YOUR_BOT_TOKEN",
"TELEGRAM_CHAT_ID": "YOUR_CHAT_ID"
}
}
}
}uvx runs the server directly from PyPI without a separate install step. If you don't have uv yet:
curl -LsSf https://astral.sh/uv/install.sh | shAlternatively, install manually and run with
pip:pip install tgbot-mcpThen use
"command": "tgbot-mcp"(withoutuvx) in the config above.
Tools
send_message
Send a free-form text message to the configured chat.
Parameter | Type | Default | Description |
|
| (required) | Message body. Telegram Markdown supported. |
|
|
| Text formatting mode. |
Example prompt: "Send a Telegram message: 'Build finished successfully in 2m 14s.'"
send_notification
Send a structured notification with an automatic event emoji.
Event | Emoji |
| ✅ |
| ❌ |
| 🔄 |
| ❓ |
Parameter | Type | Default | Description |
|
| (required) | One of the four event types above. |
|
| (required) | One-line summary (≤200 chars). |
|
|
| Optional multi-line detail body. |
Example prompt: "Notify me on Telegram that the data pipeline completed. Include row counts."
send_notification_with_buttons
Send a notification with up to 4 inline action buttons. Ideal when you want the user to pick an option without typing.
Parameter | Type | Default | Description |
|
| (required) | Event type. |
|
| (required) | One-line summary. |
|
| (required) | 1–4 button labels. Each label is also the reply value. |
|
|
| Optional context text. |
Example prompt: "Ask me via Telegram whether to deploy to staging or production."
wait_for_reply
Block until the user replies (text message or button tap) or the timeout expires.
Parameter | Type | Default | Max | Description |
|
|
| no limit | How long to wait for a reply. |
Smart polling schedule:
Elapsed time | Poll interval |
0 – 10 minutes | 30 seconds |
10 minutes – 1 hr | 60 seconds |
1 hr+ | 120 seconds |
LLM guidelines for max_wait_seconds:
Scenario | Recommended value |
Simple yes/no question |
|
General task approval |
|
Stock price / event alert |
|
End-of-day review |
|
Overnight / long-running job |
|
Multi-day wait | any value — no limit |
Typical LLM Workflow
LLM: [does some long task]
→ send_notification_with_buttons(
event="question",
summary="Finished analysis. What should I do next?",
buttons=["📊 Generate report", "📧 Send email", "🔁 Re-run with new params"]
)
→ wait_for_reply(max_wait_seconds=1800)
→ [user taps "📊 Generate report"]
LLM: [generates the report]
→ send_notification(event="completed", summary="Report ready!", details="...")Environment Variables
Variable | Required | Description |
| ✅ | Bot token from @BotFather |
| ✅ | Chat ID to send messages to |
Development
# Clone and install in editable mode
git clone https://github.com/TGLEEEE/tgbot-mcp
cd tgbot-mcp
pip install -e ".[dev]"
# Run directly
TELEGRAM_BOT_TOKEN=... TELEGRAM_CHAT_ID=... python -m tgbot_mcp.serverSecurity
Only the official Telegram Bot API is used (
api.telegram.org). No third-party relay.Bot tokens are read from environment variables — never hardcoded.
Only the chat configured via
TELEGRAM_CHAT_IDreceives messages.No personal Telegram account credentials are ever required.
License
MIT — see LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TGLEEEE/tgbot-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server