MCP Integration example with Telegram
@arananet
关于 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.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"mcp-telegram-poc": {
"command": "python3",
"args": [
"-m",
"venv",
".venv"
]
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
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.
沟通协作 分类下的更多 MCP 服务器
Telegram MCP server
chaindeadTelegram MCP for managing dialogs, messages, drafts, read statuses, and more.
Outlook MCP Server
Wallisking1991飞书MCP服务器
sdd330MCP server provides feishu related operations
Telegram MCP Server
kfastovTelegram user console client and archiver
WhatsApp MCP Server
msaelicesWhatsapp MCP Server implemented in Python
评论