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: mcp-telegram
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.
Available Tools
4 toolssend_messageA
Send a free-form text message to the configured Telegram chat.
Use this for casual messages, inline code snippets, status updates, or any content that does not require structured formatting.
Args: text : The message body. Supports Telegram Markdown v1 by default. parse_mode : 'Markdown', 'HTML', or '' for plain text. Default: 'Markdown'.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| parse_mode | No | Markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses formatting support (Markdown, HTML, plain text) and default parse mode. However, it omits potential behavioral traits like idempotency, error handling, rate limits, or whether the message is sent immediately or queued.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (two sentences plus args) and front-loaded with purpose. Every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, the description covers usage, formatting, and parameters adequately. An output schema exists, so return values need not be described. Minor gaps like character limits or error behavior exist, but overall it is complete for typical use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It adds meaning to both parameters: 'text' is described as message body with Markdown support; 'parse_mode' is explained with options and default. This provides useful context beyond the schema types.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool sends a free-form text message to a configured Telegram chat, with specific verb and resource. It distinguishes from siblings like send_notification_with_buttons and wait_for_reply, which have different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly indicates when to use this tool: 'for casual messages, inline code snippets, status updates, or any content that does not require structured formatting.' It implies not to use for notifications with buttons or replies, but does not explicitly name alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_notificationA
Send a structured notification to the configured Telegram chat.
Automatically prepends an emoji for quick visual scanning. Default emojis by event type: completed → ✅ error → ❌ progress → 🔄 question → ❓
Override the default emoji with the icon parameter when the context calls for something more specific (e.g. icon='🚀' for a deployment, '🧪' for a test run, '📊' for a report).
Args: event : Event type — 'completed', 'error', 'progress', or 'question'. summary : One-line summary shown prominently (≤200 chars recommended). details : Optional multi-line body — stack traces, next steps, metrics, etc. icon : Optional emoji to override the default event icon.
| Name | Required | Description | Default |
|---|---|---|---|
| event | Yes | ||
| summary | Yes | ||
| details | No | ||
| icon | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses key behavior: automatic emoji prepending, default emojis by event type, and icon override. No annotations are provided, so description carries full burden; it does a good job describing the tool's operation without contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise yet comprehensive. Uses bullet points for default emojis and examples. Every sentence adds value; no fluff or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 4 parameters, no annotations, and presence of output schema, the description covers all necessary behavioral and parameter information. It is fully complete for an agent to invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description fully explains each parameter: event (enum values listed), summary (one-line, ≤200 chars), details (multi-line), icon (optional override). Adds meaningful context beyond schema structure.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the action (send) and resource (structured notification to Telegram chat). Distinguishes from siblings by specifying that it sends a structured notification with automatic emoji prepending, unlike send_message (presumably plain) or send_notification_with_buttons (interactive).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides examples of when to override icons (deployment, test run, report) but does not explicitly guide when to use this tool versus siblings like send_message or wait_for_reply. Implicit usage is clear but lacks exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_notification_with_buttonsA
Send a structured notification with up to 4 inline action buttons.
Buttons let the user reply with a single tap instead of typing. After sending, call wait_for_reply to capture the chosen button or typed reply.
Button design guidelines:
Provide 2–4 buttons with clear, action-oriented labels.
Keep each label under 30 characters.
Buttons are suggestions — users can always type a custom reply instead.
Use emoji prefixes in labels to aid scannability (e.g. '✅ Approve', '❌ Cancel').
Args: event : Event type — 'completed', 'error', 'progress', or 'question'. summary : One-line summary (≤200 chars). buttons : List of 1–4 button label strings. Each label becomes the button text AND the callback payload. details : Optional additional context or instructions for the user. icon : Optional emoji to override the default event icon.
| Name | Required | Description | Default |
|---|---|---|---|
| event | Yes | ||
| summary | Yes | ||
| buttons | Yes | ||
| details | No | ||
| icon | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It explains buttons are suggestions, users can type replies, and gives design guidelines (2-4 buttons, under 30 chars, emoji prefixes). It also notes that button labels become callback payloads.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured: a purpose sentence, bulleted guidelines, and an Args list. Every sentence adds value with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 5 parameters (3 required) and an output schema, the description covers all parameter semantics, workflow integration with wait_for_reply, and button design constraints. It is complete for an agent to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description compensates with an 'Args' section detailing each parameter: event enum, summary length ≤200, buttons list constraints (1-4 items, labels under 30 chars, payload behavior), details and icon optional with descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool sends a structured notification with up to 4 inline action buttons. This distinct purpose differentiates it from siblings like send_notification and send_message.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states to call wait_for_reply after sending, providing clear workflow guidance. It doesn't explicitly exclude sibling tools but the context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
wait_for_replyA
Wait for a reply from the user via Telegram and return it.
Handles both plain text messages and inline button taps (callback queries).
Smart polling intervals (minimises API calls): 0 – 10 min elapsed → poll every 30 s 10 min – 1 hr → poll every 60 s 1 hr+ → poll every 120 s
LLM guidelines for choosing max_wait_seconds: Simple yes/no or quick question → 300 (5 min) General task approval → 1 800 (30 min) ← default Stock price / alert trigger → 1 800 (30 min) End-of-day review → 7 200 (2 hr) Overnight / long-running job → 86 400 (24 hr) Multi-day wait → any value — no maximum
Args: max_wait_seconds : How long to wait. Default 1800, no upper limit. Pick a value appropriate to how soon a reply is expected.
| Name | Required | Description | Default |
|---|---|---|---|
| max_wait_seconds | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description transparently outlines smart polling intervals and behavior for different elapsed times. However, it does not mention potential side effects, error handling, or authentication requirements, leaving minor gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured, concise, and front-loaded with the main purpose. Every sentence adds value, using bullet points and a clear table for parameter guidance.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one optional parameter, output schema present), the description is sufficiently complete, covering behavior, parameter selection, and usage context without unnecessary details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single parameter max_wait_seconds is thoroughly explained with a default, a description of its purpose, and a table of recommended values for various contexts, compensating for the 0% schema description coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool waits for a user reply via Telegram and returns it, distinguishing it from sibling tools that send messages. It specifies handling of both text and callback queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidelines for when to use the tool, including a detailed table mapping scenarios to recommended max_wait_seconds values, helping the agent select appropriate parameters.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
v0.1.2- First observed
send_message - First observed
send_notification - First observed
send_notification_with_buttons - First observed
wait_for_reply
TDQS
Each tool has a distinct purpose: free-form text, structured notification, notification with buttons, and waiting for replies. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern with underscores (send_message, send_notification, send_notification_with_buttons, wait_for_reply).
With only 4 tools, the set is minimal but appropriately scoped for a Telegram bot focused on sending messages and awaiting replies. Slightly thin but not inadequate.
The core interaction loop (send message, structured notification with/without buttons, wait for reply) is covered. Missing features like message editing or history are minor gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables interaction with Telegram to send, read, and search messages across chats and dialogs. It supports waiting for incoming messages and retrieving conversation history through natural language commands.144MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that wraps the Telegram Bot API into semantic tools for LLM agents, supporting multi-bot management for sending and receiving messages. It enables agents to send text, photos, and documents, as well as fetch recent updates from multiple configured Telegram bots.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server enabling AI agents to interact with users via Telegram, supporting message and image sending, inline quick replies, and waiting for user responses.13MIT
- 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.24MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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