Telegram Bot Testing & Verification MCP Server
Provides tools for interacting with and testing Telegram bots end-to-end, including sending commands and messages, clicking inline buttons, running multi-step test suites, sending and downloading media, performing inline queries, and managing chat history.
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., "@Telegram Bot Testing & Verification MCP ServerSend /start to @my_test_bot and verify the welcome message"
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 Bot Testing & Verification MCP Server ๐ค๐งช
A Model Context Protocol (MCP) server that allows AI Coding Agents (such as Antigravity, Claude Desktop, Cursor, and custom agent backends) to autonomously interact with, test, click buttons on, and verify Telegram bots end-to-end.
๐ AI Agents: See the dedicated AI Agent Testing Guide for tool selection workflows, test suites, and best practices.
Environment Recommendation: We strongly recommend using the Test Server (TELEGRAM_TEST_MODE=true) for bot development and automated testing because it carries zero risk to your main personal Telegram account.
Note: Make sure your target bot and user account are on the same environment (Test Server bot โ Test Server account, or Prod bot โ Prod account), as Telegram test and production networks are completely isolated.
๐ Features
Command & Message Dispatch: Send commands (
/start,/help,/settings) and text payloads to any target bot.Inline Keyboard Navigation: Click inline callback buttons (
CallbackQuery), trigger button menus, and inspect in-place message updates.Multi-Step Test Suite Runner (
telegram_run_test_suite): Execute full regression test scenarios with assertions andsleepdelays in a single tool call.Media & File Testing: Send photos, documents, audio, or PDFs to bots, and download returned media to verify generated files.
Inline Query Mode: Test
@bot queryinline modes and inspect returned inline articles and preview metadata.Python Code Execution Sandbox (
telegram_execute_code): Run custom asynchronous Python scripts with direct access to the liveTelegramClientand raw MTProto functions.Clean State Management: Clear dialog history before/after test runs for idempotent testing.
Related MCP server: telegram-mcp
๐ Quickstart
1. Clone & Install Dependencies
git clone https://github.com/Fire162/telegram-bot-mcp.git
cd telegram-bot-mcp
pip install -r requirements.txt2. Configure Environment
Copy .env.example to .env:
cp .env.example .envAdd your Telegram API credentials from my.telegram.org:
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hash
TELEGRAM_TEST_MODE=false3. Generate Session (One-Time Login)
Run the interactive login script:
python3 login.pyEnter your phone number and the verification code sent to your Telegram app.
The script saves your
TELEGRAM_SESSIONstring automatically into.env.
4. Run the MCP Server
python3 server.py๐ Connecting to AI Agents
Antigravity CLI (agy) / Gemini
The repository includes a pre-configured .agents/plugins/telegram-bot/ plugin. Any agy session started in this workspace will automatically discover and load the tools.
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"telegram-bot": {
"command": "python3",
"args": ["/path/to/telegram-bot-mcp/server.py"],
"env": {
"TELEGRAM_API_ID": "your_api_id",
"TELEGRAM_API_HASH": "your_api_hash",
"TELEGRAM_SESSION": "your_session_string",
"TELEGRAM_TEST_MODE": "false"
}
}
}
}๐ ๏ธ MCP Tools Reference
Tool Name | Parameters | Purpose |
|
| Sends a command and waits for reply. |
|
| Sends text payloads or queries. |
|
| Clicks inline buttons and returns updated message state. |
|
| Uploads images/documents/audio. |
|
| Downloads media from bot messages. |
|
| Performs inline queries ( |
|
| Convenience single-step assertion. |
|
| Runs multi-step test workflows with |
|
| Executes arbitrary Python code with live Telethon client access. |
|
| Fetches recent conversation history. |
|
| Clears conversation dialog for clean tests. |
๐งช Example Test Suite Scenario
[
{"action": "send", "text": "/start"},
{"action": "sleep", "seconds": 1.0},
{"action": "assert_reply", "contains": "Welcome to my bot!"},
{"action": "click_button", "text": "Settings"},
{"action": "sleep", "seconds": 0.5},
{"action": "assert_reply", "contains": "Notification Preferences"}
]๐ License
MIT License. See LICENSE for details.
This server cannot be installed
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
Multi-tenant Telegram gateway for AI agents โ HTTP+stdio, 8 tools, MTProto User API
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Build and deploy websites, Telegram and Discord bots from chat via the DreamAgent platform.
Related MCP Servers
- FlicenseAqualityBmaintenanceEnables AI agents to interact with Telegram via MTProto, supporting high-performance communication and seamless integration.1
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with a user's Telegram account: list chats, read history, search, and send messages through Telegram's MTProto API.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to test Telegram bots by driving the official Telegram Web client in a real browser, allowing visual verification of bot responses, inline keyboards, and Mini Apps.2MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to control a personal Telegram account for sending/reading messages, media, group management, and more via the MTProto API.MIT
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/Fire162/telegram-bot-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server