Telegram Notify MCP Server

Telegram Notify MCP Server

Connects VS Code Copilot to Telegram for mobile notifications, interactive approval workflows, and remote command input. Enables users to monitor AI agents, approve sensitive operations, and provide follow-up instructions from their smartphone.

Category
访问服务器

README

telegram-copilot-bridge

Control GitHub Copilot CLI remotely from Telegram. Send prompts, manage sessions, and approve tool calls — all from your smartphone.

Architecture

📱 Telegram
    ↕ (Bot API long-polling)
🐍 telegram-copilot-bridge
    ↕ (stdin/stdout NDJSON — ACP)
🤖 copilot --acp --stdio

Features

  • Remote Prompting — Send Copilot prompts from Telegram, receive results on your phone
  • Multi-Session — Run multiple Copilot sessions in parallel, switch between them
  • Tool Approval — Approve or deny Copilot's tool calls via inline buttons
  • Autopilot Mode — Auto-approve all tool calls for hands-free operation
  • Session History — Resume past Copilot sessions with one tap
  • Folder Picker/new shows inline buttons for project directories

Installation

git clone https://github.com/NobufumiMurata/telegram-copilot-bridge.git
cd telegram-copilot-bridge
pip install -e .

Prerequisites: Install Copilot CLI and authenticate:

winget install GitHub.Copilot   # or: npm install -g @github/copilot
copilot                         # then /login to authenticate

Setup

1. Create a Telegram Bot

  1. Open Telegram and message @BotFather
  2. Send /newbot and follow the prompts
  3. Copy the bot token

2. Get Your Chat ID and User ID

Send any message to your bot, then:

curl "https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates"

From the response, note:

  • "chat": {"id": ...} → your Chat ID
  • "from": {"id": ...} → your User ID (for the allowlist)

3. Configure

Copy the example file and fill in your values:

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

The .env file is loaded automatically on startup (from the current directory). Use TELEGRAM_ENV_FILE=/path/to/.env to point to a different location. Environment variables set in the shell always take priority over .env.

Usage

# 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 \
  -v

CLI options:

Flag Description Default
--cwd <dir> Default working directory for sessions current dir
--model <name> AI model (e.g. claude-opus-4.6) claude-opus-4.6
--timeout <min> Auto-shutdown in minutes (0 = no timeout) 0
--autopilot Auto-approve all tool calls off (manual approval via Telegram)
-v, --verbose Enable debug logging off

Telegram Commands

Command Action
/new [dir] Start a new Copilot session (shows folder picker if COPILOT_DIRS_ROOT is set)
/history [n] List past CLI sessions (default: 3)
/resume <id> Resume a past session
/dirs [dir] Browse directories
/model [name] Show/set AI model
/mode Toggle autopilot/manual approval
/list List active sessions
/switch <id> Switch active session
/status Session status
/stop [id] Stop a session
/done Stop all sessions & exit
/help Show commands
(any text) Send as prompt to active session

Environment Variables

All variables can be set in .env or in the shell. Shell values take priority.

Telegram:

Variable Description Default
TELEGRAM_BOT_TOKEN Bot API token (required)
TELEGRAM_CHAT_ID Target chat ID (required)
TELEGRAM_ALLOWED_USERS Comma-separated allowed user IDs (allow all)
TELEGRAM_ENV_FILE Path to the .env file .env in CWD
TELEGRAM_CONFIG_PATH JSON credential file (fallback)

Copilot:

Variable Description Default
COPILOT_CLI_PATH Path to copilot executable copilot (from PATH)
COPILOT_MODEL Default AI model claude-opus-4.6
COPILOT_AUTOPILOT Auto-approve tool calls (true/false) false
COPILOT_DIRS_ROOT Root directory for /dirs and /new folder picker (uses --cwd)
COPILOT_ALLOWED_DIRS Comma-separated allowed working dirs (any)
COPILOT_ALLOWED_TOOLS Comma-separated tools to allow shell(git),read,write
COPILOT_PERMISSION_TIMEOUT_SECONDS Permission approval timeout (seconds) 300 (5 min)
HUB_LOCK_PORT TCP port for singleton lock 47732

Security

  • User allowlist: Only messages from TELEGRAM_ALLOWED_USERS are accepted. All other users are silently ignored.
  • Timeouts: Configurable auto-shutdown timeout (default: no timeout). Permission requests timeout after 5 minutes (configurable via COPILOT_PERMISSION_TIMEOUT_SECONDS).
  • No secrets in repo: All credentials via .env file or environment variables.
  • Tool allowlist: Uses --allow-tool (not --allow-all-tools) to restrict what Copilot CLI can do.
  • Directory restrictions: Restrict which directories Copilot sessions can operate in via COPILOT_ALLOWED_DIRS.
  • Singleton lock: Only one instance can run per machine (TCP port lock).

Limitations

  • VS Code ローカル実行は監視不可 — VS Code 上の Copilot が何をしているかを取得する手段はありません。MCP ツールは VS Code → Bridge の一方向呼び出しのみです。
  • Bridge 外で起動した CLI のステータスは取得不可 — サーバー上で直接 copilot を起動した場合、リアルタイムの実行状況は取れません。/status の Activity 表示(events.jsonl の更新時刻による推定)が代替手段です。
  • Bridge 外で起動した CLI の承認リクエストは中継不可 — Hub 経由で起動したセッションのみ、ツール承認を Telegram インラインボタンで中継できます。
  • シングルインスタンス制限 — Hub は 1 マシンにつき 1 プロセスのみ(TCP ポートロック)。
  • Telegram メッセージ長制限 — 4000 文字を超える応答は自動分割されます。

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选