Telegram Notify MCP Server
telegram-copilot-bridge
通过 Telegram 远程控制 GitHub Copilot CLI。发送提示词、管理会话并批准工具调用——一切尽在您的智能手机上。
架构
📱 Telegram
↕ (Bot API long-polling)
🐍 telegram-copilot-bridge
↕ (stdin/stdout NDJSON — ACP)
🤖 copilot --acp --stdioRelated MCP server: tsgram-mcp
功能
远程提示词 — 从 Telegram 发送 Copilot 提示词,并在手机上接收结果
多会话 — 并行运行多个 Copilot 会话,并在它们之间切换
工具审批 — 通过内联按钮批准或拒绝 Copilot 的工具调用
自动驾驶模式 — 自动批准所有工具调用,实现免提操作
会话历史 — 一键恢复过去的 Copilot 会话
文件夹选择器 —
/new显示项目目录的内联按钮
安装
git clone https://github.com/NobufumiMurata/telegram-copilot-bridge.git
cd telegram-copilot-bridge
pip install -e .先决条件: 安装 Copilot CLI 并进行身份验证:
winget install GitHub.Copilot # or: npm install -g @github/copilot
copilot # then /login to authenticate设置
1. 创建 Telegram 机器人
打开 Telegram 并给 @BotFather 发送消息
发送
/newbot并按照提示操作复制机器人令牌 (token)
2. 获取您的聊天 ID 和用户 ID
向您的机器人发送任何消息,然后:
curl "https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates"从响应中,记录:
"chat": {"id": ...}→ 您的 Chat ID"from": {"id": ...}→ 您的 User ID(用于白名单)
3. 配置
复制示例文件并填写您的值:
cp .env.example .env# .env
TELEGRAM_BOT_TOKEN=1234567890:AAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
TELEGRAM_CHAT_ID=-100000000000
TELEGRAM_ALLOWED_USERS=123456789
# Default AI model
COPILOT_MODEL=claude-opus-4.6
# Root folder for /dirs and /new folder picker
COPILOT_DIRS_ROOT=/home/user/projects.env 文件在启动时会自动加载(从当前目录)。
使用 TELEGRAM_ENV_FILE=/path/to/.env 指向不同的位置。
Shell 中设置的环境变量始终优先于 .env。
使用方法
# Start (reads .env automatically)
python -m telegram_copilot_bridge
# With options
python -m telegram_copilot_bridge \
--cwd /path/to/project \
--model claude-opus-4.6 \
--timeout 120 \
-vCLI 选项:
标志 | 描述 | 默认值 |
| 会话的默认工作目录 | 当前目录 |
| AI 模型 (例如 |
|
| 自动关闭时间(分钟,0 = 不超时) |
|
| 自动批准所有工具调用 | 关闭(通过 Telegram 手动审批) |
| 启用调试日志 | 关闭 |
Telegram 命令
命令 | 操作 |
| 启动新的 Copilot 会话(如果设置了 |
| 列出过去的 CLI 会话(默认:3) |
| 恢复过去的会话 |
| 浏览目录 |
| 显示/设置 AI 模型 |
| 切换自动驾驶/手动审批 |
| 列出活动会话 |
| 切换活动会话 |
| 会话状态 |
| 停止会话 |
| 停止所有会话并退出 |
| 显示命令 |
(任何文本) | 作为提示词发送给活动会话 |
环境变量
所有变量都可以在 .env 或 shell 中设置。Shell 值优先。
Telegram:
变量 | 描述 | 默认值 |
| 机器人 API 令牌 | (必需) |
| 目标聊天 ID | (必需) |
| 逗号分隔的允许用户 ID | (允许所有人) |
|
| CWD 中的 |
| JSON 凭据文件(备用) | — |
Copilot:
变量 | 描述 | 默认值 |
| copilot 可执行文件路径 |
|
| 默认 AI 模型 |
|
| 自动批准工具调用 ( |
|
|
| (使用 --cwd) |
| 逗号分隔的允许工作目录 | (任意) |
| 逗号分隔的允许工具 |
|
| 权限审批超时(秒) |
|
| 单例锁的 TCP 端口 |
|
安全性
用户白名单:仅接受来自
TELEGRAM_ALLOWED_USERS的消息。所有其他用户将被静默忽略。超时:可配置的自动关闭超时(默认:无超时)。权限请求在 5 分钟后超时(可通过
COPILOT_PERMISSION_TIMEOUT_SECONDS配置)。仓库中无密钥:所有凭据均通过
.env文件或环境变量提供。工具白名单:使用
--allow-tool(而非--allow-all-tools)来限制 Copilot CLI 的操作权限。目录限制:通过
COPILOT_ALLOWED_DIRS限制 Copilot 会话可以在哪些目录中操作。单例锁:每台机器只能运行一个实例(TCP 端口锁)。
局限性
VS Code 本地运行不可见 — 无法获取 Copilot 在 VS Code 内部的操作。MCP 工具仅是来自 VS Code → Bridge 的单向调用。
Bridge 外部启动的 CLI 会话状态不可用 — 如果您直接在服务器上启动
copilot,则无法跟踪实时执行状态。/status中的活动显示(根据events.jsonl修改时间估算)是唯一的替代方案。Bridge 外部启动的 CLI 会话的工具审批请求无法中继 — 只有通过 Hub 启动的会话才能通过 Telegram 内联按钮中继工具审批请求。
单实例限制 — 每台机器只能有一个 Hub 进程(TCP 端口锁)。
Telegram 消息长度限制 — 超过 4000 个字符的响应会自动拆分。
许可证
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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
Reach your own phone from an AI agent: notifications, approval questions, reminders, ring, files.
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Human-in-the-loop for AI coding agents — ask questions, get approvals via Slack.
Share context and questions between Claude instances — VS Code, claude.ai web, and mobile.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables remote control of AI coding assistants (Claude Code/Codex) via Telegram, allowing you to manage long-running tasks, send commands, and receive notifications from anywhere. Supports unattended mode with smart polling for up to 7 days and multi-session management.830MIT
- AlicenseNot gradedqualityDmaintenanceConnects Claude Code sessions to Telegram, enabling AI-powered code assistance and file management directly from Telegram chats.89MIT
- AlicenseAqualityCmaintenanceEnables Claude Code to send and receive messages via Telegram for remote interaction and approval of sensitive operations.8127MIT
- AlicenseAqualityDmaintenanceEnables mobile control of Antigravity coding agents via Telegram, allowing task submission, plan approval, and artifact viewing.172MIT
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/NobufumiMurata/telegram-copilot-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server