MCP Integration example with Telegram
@arananet
About MCP Integration example with Telegram
A Python-based Model Context Protocol (MCP) client and server that enables LLMs to send notifications via Telegram and receive user responses.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-telegram-poc": {
"command": "python3",
"args": [
"-m",
"venv",
".venv"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCP Integration example with Telegram?
A Python-based Model Context Protocol (MCP) client and server that enables LLMs to send notifications via Telegram and receive user responses. It decouples the LLM’s reasoning from the execution of external actions, making tool integration more modular and maintainable.
How to use MCP Integration example with Telegram?
Clone the repository, install dependencies (pip install -r requirements.txt), create a virtual environment, and fill in your Telegram credentials in a .env file (Telegram bot token, chat ID, OpenAI API key). Run the server with python3 src/mcp_handler.py, or test client interaction with python3 examples/test_client.py. The server exposes two tools: send_alert (sends a Telegram message) and check_reply (polls for replies).
Key features of MCP Integration example with Telegram
- Send text alerts to Telegram with customizable urgency levels
- Check for user replies with configurable timeouts
- Integration with MCP‑compatible LLM applications
- Decouples reasoning from execution for safer tool use
- Update external tools without changing LLM prompts
- Supports AutoGen 0.4 framework integration
Use cases of MCP Integration example with Telegram
- Notify a user of critical events and wait for confirmation
- Enable an LLM to send alerts and process human feedback
- Prototype MCP‑based tool integrations with messaging platforms
- Demonstrate modular architecture for LLM‑driven workflows
FAQ from MCP Integration example with Telegram
How does MCP differ from function calls or agent tools?
MCP separates the LLM’s decision‑making from execution; you can swap out tools without modifying the LLM. Direct function calls or agent methods mix logic, making maintenance harder.
What are the prerequisites?
Python 3.11+, a Telegram bot token (from @BotFather), your Telegram chat ID, and an OpenAI API key.
How do I get a Telegram bot token and find my chat ID?
Chat with @BotFather on Telegram, send /newbot, and follow the prompts. To find your chat ID, send a message to your bot, then visit https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates and look for the chat object’s id field.
What runtime environment is needed?
The server runs as a standalone Python script. Use a virtual environment and install dependencies from requirements.txt. It is tested on Linux/macOS.
Are there known limits?
The README does not specify limits beyond the configurable timeout_seconds for check_reply (default 60 seconds). The server uses polling for replies.
Frequently asked questions
How does MCP differ from function calls or agent tools?
MCP separates the LLM’s decision‑making from execution; you can swap out tools without modifying the LLM. Direct function calls or agent methods mix logic, making maintenance harder.
What are the prerequisites?
Python 3.11+, a Telegram bot token (from @BotFather), your Telegram chat ID, and an OpenAI API key.
How do I get a Telegram bot token and find my chat ID?
Chat with @BotFather on Telegram, send `/newbot`, and follow the prompts. To find your chat ID, send a message to your bot, then visit `https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates` and look for the `chat` object’s `id` field.
What runtime environment is needed?
The server runs as a standalone Python script. Use a virtual environment and install dependencies from `requirements.txt`. It is tested on Linux/macOS.
Are there known limits?
The README does not specify limits beyond the configurable `timeout_seconds` for `check_reply` (default 60 seconds). The server uses polling for replies.
Basic information
More Communication MCP servers
MCP Email Server
Shy2593666979一个基于 MCP (Model Context Protocol) 的邮件服务,支持 LLM 发送带附件的电子邮件及在指定目录中搜索文件。提供安全的 SMTP 传输、多收件人支持和附件模式匹配搜索功能,适用于 Gmail、Outlook、Yahoo、QQ 邮箱和网易 126 邮箱等主流邮箱服务。
slack-mcp-server
ubie-ossA Slack MCP server

AgentCouch
Messaging rooms for AI agents: hand off context across tools, worktrees, machines, and teammates. Agents meet in shared rooms over MCP, hand off directly, and leave a replayable transcript; live sessions wake on reply, b
Mcp Telegram
dryeabMCP Server for Telegram
feishu-tools-mcp
Li-vienMCP server provides Feishu related operations to AI encoding agents such as cursor 飞书MCP插件,读取文档、发送消息、合同审批、数据处理.....
Comments