mcp-telegram-agent 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ # Telegram Bot Token:向 @BotFather 建立機器人後取得
2
+ TELEGRAM_BOT_TOKEN=123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ
3
+
4
+ # 預設目標 Chat ID:發送任一訊息給 @userinfobot 取得
5
+ TELEGRAM_DEFAULT_CHAT_ID=123456789
@@ -0,0 +1,25 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Set up uv
16
+ uses: astral-sh/setup-uv@v5
17
+ with:
18
+ python-version: "3.12"
19
+
20
+ # 測試檔(tests/)不進版控,僅在本機驗證,此處直接建置發佈
21
+ - name: Build package
22
+ run: uv build
23
+
24
+ - name: Publish to PyPI
25
+ run: uv publish
@@ -0,0 +1,31 @@
1
+ # ===== 本機開發與測試專區(絕不推上公開庫) =====
2
+ dev_test/
3
+ tests/
4
+ *.local
5
+ *.session
6
+ *.token
7
+ .env
8
+ .env.*
9
+ !.env.example
10
+
11
+ # ===== Python =====
12
+ __pycache__/
13
+ *.py[cod]
14
+ *.egg-info/
15
+ .eggs/
16
+ build/
17
+ dist/
18
+ .venv/
19
+ venv/
20
+ .pytest_cache/
21
+ .mypy_cache/
22
+ .ruff_cache/
23
+ .coverage
24
+ htmlcov/
25
+
26
+ # ===== IDE 與系統檔案 =====
27
+ .idea/
28
+ .vscode/
29
+ *.swp
30
+ .DS_Store
31
+ Thumbs.db
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PCKuo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.5
2
+ Name: mcp-telegram-agent
3
+ Version: 0.1.0
4
+ Summary: FastMCP-style MCP server empowering AI agents with full-featured Telegram Bot control: rich keyboards, local files, media albums, and interactive widgets.
5
+ Author: PCKuo
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Keywords: ai-agent,automation,fastmcp,mcp,model-context-protocol,telegram,telegram-bot
9
+ Requires-Python: >=3.10
10
+ Requires-Dist: httpx>=0.27.0
11
+ Requires-Dist: mcp[cli]>=1.0.0
12
+ Requires-Dist: pydantic>=2.0.0
13
+ Description-Content-Type: text/markdown
14
+
15
+ # mcp-telegram-agent
16
+
17
+ A lightweight, zero-login-risk Model Context Protocol (MCP) server empowering AI agents with Telegram Bot capabilities. Built with Python (SDK-compatible with both `mcp` 1.x FastMCP and 2.x MCPServer), designed to work seamlessly out-of-the-box with `uvx` and modern AI coding agents like VS Code Cline and Claude Desktop.
18
+
19
+ Also includes the ultra-short command alias `tg-agent`.
20
+
21
+ [繁體中文說明文件](README.zh-TW.md)
22
+
23
+ ---
24
+
25
+ ## Highlights
26
+
27
+ * **Pure Bot API Architecture**: Zero login session risk, no SMS codes or sensitive credential files needed.
28
+ * **Dual CLI Entry Points**: Call via standard `mcp-telegram-agent` or the compact `tg-agent` alias.
29
+ * **Full Keyboard Support**: Effortlessly construct dynamic Inline Keyboards (with URLs or callback data) and custom Reply Keyboards.
30
+ * **Rich Media & Local Files**: Deliver logs, reports, source code, images, audio, voice notes, videos, and multi-image albums (2–10 files).
31
+ * **Interactive Tooling**: Launch quizzes, single/multiple-choice polls, GPS coordinates, digital contact cards, and animated dice.
32
+ * **Message Lifecycle**: Broadcast bot statuses (typing, uploading) and edit or delete messages on the fly.
33
+ * **Instant uvx Execution**: Run directly with no virtual environments or manual package installs.
34
+
35
+ ---
36
+
37
+ ## Quick Start
38
+
39
+ ### 1. Prerequisites
40
+ * **Telegram Bot Token**: Obtain one from `@BotFather`.
41
+ * **Chat ID**: Get your unique numerical Chat ID by sending any message to `@userinfobot`.
42
+
43
+ ### 2. Configuration for AI Clients
44
+
45
+ Add the configuration below to your MCP settings file (e.g., `cline_mcp_settings.json` or `claude_desktop_config.json`):
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "telegram": {
51
+ "command": "uvx",
52
+ "args": ["mcp-telegram-agent"],
53
+ "env": {
54
+ "TELEGRAM_BOT_TOKEN": "YOUR_TELEGRAM_BOT_TOKEN",
55
+ "TELEGRAM_DEFAULT_CHAT_ID": "YOUR_CHAT_ID"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Available Tools
65
+
66
+ * `send_text_message`: Send Markdown/HTML text with inline buttons or custom reply keyboards.
67
+ * `send_local_document`: Send any local file (PDF, CSV, code, logs, archives).
68
+ * `send_local_photo`: Send image files with captions and inline buttons.
69
+ * `send_local_video`: Send video files as native players.
70
+ * `send_local_audio_or_voice`: Send music tracks or native voice audio notes.
71
+ * `send_media_album`: Deliver 2 to 10 photos or videos as a grouped carousel.
72
+ * `send_poll`: Create interactive single/multiple choice polls or scored quizzes.
73
+ * `send_location`: Broadcast map location points via coordinates.
74
+ * `send_contact`: Share phone contact cards.
75
+ * `send_dice`: Send animated dice, basketball, football, or slot machines.
76
+ * `send_chat_action`: Display temporary bot statuses (typing, uploading).
77
+ * `edit_message_text`: Dynamically update previously sent text and keyboards.
78
+ * `delete_message`: Clean up or remove specific messages.
79
+
80
+ ---
81
+
82
+ ## License
83
+
84
+ This project is licensed under the MIT License.
85
+
@@ -0,0 +1,71 @@
1
+ # mcp-telegram-agent
2
+
3
+ A lightweight, zero-login-risk Model Context Protocol (MCP) server empowering AI agents with Telegram Bot capabilities. Built with Python (SDK-compatible with both `mcp` 1.x FastMCP and 2.x MCPServer), designed to work seamlessly out-of-the-box with `uvx` and modern AI coding agents like VS Code Cline and Claude Desktop.
4
+
5
+ Also includes the ultra-short command alias `tg-agent`.
6
+
7
+ [繁體中文說明文件](README.zh-TW.md)
8
+
9
+ ---
10
+
11
+ ## Highlights
12
+
13
+ * **Pure Bot API Architecture**: Zero login session risk, no SMS codes or sensitive credential files needed.
14
+ * **Dual CLI Entry Points**: Call via standard `mcp-telegram-agent` or the compact `tg-agent` alias.
15
+ * **Full Keyboard Support**: Effortlessly construct dynamic Inline Keyboards (with URLs or callback data) and custom Reply Keyboards.
16
+ * **Rich Media & Local Files**: Deliver logs, reports, source code, images, audio, voice notes, videos, and multi-image albums (2–10 files).
17
+ * **Interactive Tooling**: Launch quizzes, single/multiple-choice polls, GPS coordinates, digital contact cards, and animated dice.
18
+ * **Message Lifecycle**: Broadcast bot statuses (typing, uploading) and edit or delete messages on the fly.
19
+ * **Instant uvx Execution**: Run directly with no virtual environments or manual package installs.
20
+
21
+ ---
22
+
23
+ ## Quick Start
24
+
25
+ ### 1. Prerequisites
26
+ * **Telegram Bot Token**: Obtain one from `@BotFather`.
27
+ * **Chat ID**: Get your unique numerical Chat ID by sending any message to `@userinfobot`.
28
+
29
+ ### 2. Configuration for AI Clients
30
+
31
+ Add the configuration below to your MCP settings file (e.g., `cline_mcp_settings.json` or `claude_desktop_config.json`):
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "telegram": {
37
+ "command": "uvx",
38
+ "args": ["mcp-telegram-agent"],
39
+ "env": {
40
+ "TELEGRAM_BOT_TOKEN": "YOUR_TELEGRAM_BOT_TOKEN",
41
+ "TELEGRAM_DEFAULT_CHAT_ID": "YOUR_CHAT_ID"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Available Tools
51
+
52
+ * `send_text_message`: Send Markdown/HTML text with inline buttons or custom reply keyboards.
53
+ * `send_local_document`: Send any local file (PDF, CSV, code, logs, archives).
54
+ * `send_local_photo`: Send image files with captions and inline buttons.
55
+ * `send_local_video`: Send video files as native players.
56
+ * `send_local_audio_or_voice`: Send music tracks or native voice audio notes.
57
+ * `send_media_album`: Deliver 2 to 10 photos or videos as a grouped carousel.
58
+ * `send_poll`: Create interactive single/multiple choice polls or scored quizzes.
59
+ * `send_location`: Broadcast map location points via coordinates.
60
+ * `send_contact`: Share phone contact cards.
61
+ * `send_dice`: Send animated dice, basketball, football, or slot machines.
62
+ * `send_chat_action`: Display temporary bot statuses (typing, uploading).
63
+ * `edit_message_text`: Dynamically update previously sent text and keyboards.
64
+ * `delete_message`: Clean up or remove specific messages.
65
+
66
+ ---
67
+
68
+ ## License
69
+
70
+ This project is licensed under the MIT License.
71
+
@@ -0,0 +1,70 @@
1
+ # mcp-telegram-agent
2
+
3
+ 專為 AI 代理與自動化流程設計的全功能 Telegram 機器人控制協議伺服器。採用純 Python 實作,相容 mcp SDK 1.x(FastMCP)與 2.x(MCPServer),原生支援 `uvx` 隨選即用,完美相容 VS Code Cline 與 Claude Desktop 等開發環境。
4
+
5
+ 同時支援超短指令別名 `tg-agent`。
6
+
7
+ [English Documentation](README.md)
8
+
9
+ ---
10
+
11
+ ## 專案亮點
12
+
13
+ * **純機器人架構**:僅需 Bot Token 與 Chat ID,無需輸入電話驗證碼登入個人帳號,零帳號被封風險。
14
+ * **雙命令列進入點**:同時支援標準 `mcp-telegram-agent` 與精簡 `tg-agent` 別名指令。
15
+ * **完整鍵盤支援**:原生支援行內按鈕(超連結與回傳識別碼)以及手機底部回覆鍵盤。
16
+ * **實體本機檔案與相簿**:輕鬆發送日誌、報表、原始碼、圖片、語音、影片,以及 2 至 10 個項目的多媒體相簿。
17
+ * **豐富互動元件**:支援即時投票、測驗、地圖經緯度座標、電話名片及官方動畫表情符號。
18
+ * **狀態與訊息生命週期維護**:支援即時廣播機器人打字狀態,並能動態更新或刪除指定訊息。
19
+ * **uvx 極速啟動**:免除手動建立虛擬環境與安裝依賴的繁瑣步驟。
20
+
21
+ ---
22
+
23
+ ## 快速開始
24
+
25
+ ### 1. 前置準備
26
+ * **Telegram Bot Token**:於 Telegram 搜尋 `@BotFather` 建立機器人並獲取 Token。
27
+ * **Chat ID**:發送任一訊息給 `@userinfobot` 獲取個人專屬數值 Chat ID。
28
+
29
+ ### 2. 用戶端配置範例
30
+
31
+ 在 MCP 設定檔(例如 VS Code 的 `cline_mcp_settings.json` 或 `claude_desktop_config.json`)中加入以下內容:
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "telegram": {
37
+ "command": "uvx",
38
+ "args": ["mcp-telegram-agent"],
39
+ "env": {
40
+ "TELEGRAM_BOT_TOKEN": "你的_BOT_TOKEN",
41
+ "TELEGRAM_DEFAULT_CHAT_ID": "你的_CHAT_ID"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ---
49
+
50
+ ## 提供之工具列表
51
+
52
+ * `send_text_message`:發送 Markdown 與 HTML 格式化文字,支援行內按鈕或底部鍵盤。
53
+ * `send_local_document`:傳送各類本機報告、CSV、ZIP 或原始碼檔案。
54
+ * `send_local_photo`:發送圖片檔案並支援即時全螢幕預覽。
55
+ * `send_local_video`:發送本機影片並支援內嵌播放器。
56
+ * `send_local_audio_or_voice`:發送音訊或語音留言。
57
+ * `send_media_album`:批次發送 2 至 10 張圖片或影片組成相簿輪播。
58
+ * `send_poll`:建立互動式單選、多選投票或附帶解析之標準測驗。
59
+ * `send_location`:傳送經緯度地理位置座標地圖。
60
+ * `send_contact`:傳送名片聯絡人資訊。
61
+ * `send_dice`:發送隨機動畫表情,如骰子與拉霸機等。
62
+ * `send_chat_action`:向用戶端顯示當前操作狀態,如打字中與上傳檔案中。
63
+ * `edit_message_text`:動態更新既有訊息內容與按鈕。
64
+ * `delete_message`:清理特定暫存或歷史訊息。
65
+
66
+ ---
67
+
68
+ ## 授權條款
69
+
70
+ 本專案採用 MIT 授權協議開源發布。
@@ -0,0 +1,3 @@
1
+ """mcp-telegram-agent: FastMCP server for full-featured Telegram Bot control."""
2
+
3
+ __version__ = "0.1.0"