MTM - MCP Telegram MORE
A Telegram-integrated MCP server that enables remote control of Claude sessions through a Telegram bot, including chat, tool approvals, task tracking, and workspace management. It provides a MiniApp interface for real-time monitoring and control of Claude's activities from mobile devices.
README
MTM - MCP Telegram MORE
Custom Telegram channel for Claude Code — a daemon + MCP server + MiniApp that turns a Telegram bot into a full-featured remote control for your Claude sessions.
Features
Remote chat with Claude
- Send messages to Claude from any Telegram client; Claude's replies stream back the same way.
- File attachments supported in both directions (uploads / screenshots / downloads).
- MiniApp inside the bot with three tabs: Chat, Tasks, Status.
Tool approvals over Telegram
- Every risky tool call (Bash, Edit, Write, MCP tools, etc.) can require explicit approval.
- Approval prompts arrive as Telegram messages with Allow/Deny buttons; you approve from your phone.
- Tool-level allowlist lets you auto-approve safe tools (
/allow Read,/deny Bash sudo). - Global YOLO mode (
/yolo on) temporarily disables approvals.
Live task tracking
- Claude's
TodoWritelist is mirrored to the Tasks tab in real-time. - Status transitions (pending → in_progress → completed) update live over WebSocket.
Sub-agent & tool visibility
- Sticky status bar at the top of the MiniApp shows what Claude is doing right now ("main: Edit · config.ts", "main + 2 subagents running").
- Collapsible agent bubbles for each sub-agent spawn — drill down into the tools each sub-agent ran.
- Important tools (write-actions,
Task, MCP) are highlighted; read-only tools collapsed by default. - Tool-event history retained for 7 days by default (configurable).
Workspace awareness
- Multiple concurrent Claude sessions across different projects, each mapped to its own workspace.
/wscommand in the bot switches which workspace incoming messages target.
Access control
- Pairing flow: DM the bot → receive 6-digit code → redeem with
/mcp-telegram:access pair <code>. - Allowlist with
owner/userroles;ownercan promote and remove. - Policy modes:
pairing(code-only),allowlist(closed),open(anyone — only for dev).
Tunnel abstraction
- Public URL exposed via a pluggable tunnel provider.
- Default URL is auto-pushed to Telegram as the bot's MiniApp button, including per-chat overrides for every allowlisted user.
Prerequisites
- Bun —
curl -fsSL https://bun.sh/install | bash - A tunnel tool matching your chosen provider:
- A Telegram bot token from @BotFather (use
/newbot). - Node.js (for the Claude Code hook scripts — any recent version).
Quick start
# 1. Clone & install workspace deps
git clone <repo> mcp-telegram && cd mcp-telegram
bun install
# 2. Put the bot token into the daemon's env file
mkdir -p ~/.mcp-tg
echo "TELEGRAM_BOT_TOKEN=<your-bot-token>" > ~/.mcp-tg/.env
# 3. Build the MiniApp (served statically by the daemon)
bun run --cwd packages/miniapp build
# 4. Start the daemon (long-running; keep in a terminal or use install-service)
bun run --cwd packages/daemon start
# Logs print the public tunnel URL and port 17080.
# 5. Load the plugin into Claude Code (for hook + MCP integration)
claude --dangerously-load-development-channels plugin:mcp-telegram@mcp-telegram-local
# 6. From inside Claude Code, configure and pair
/mcp-telegram:configure <BOT_TOKEN>
# DM your bot in Telegram → receive a 6-digit pair code
/mcp-telegram:access pair ABC123
# 7. Open the MiniApp by tapping the "Open" button in the bot chat.
Configuration
~/.mcp-tg/.env (required)
| Variable | Default | Purpose |
|---|---|---|
TELEGRAM_BOT_TOKEN |
— (required) | Bot token from @BotFather. |
MCP_TG_PORT |
17080 |
Local port the daemon listens on. |
MCP_TG_DATA_DIR |
~/.mcp-tg |
Where the DB, uploads, lock, tokens live. |
MCP_TG_JWT_SECRET |
auto-gen | HS256 signing key for MiniApp sessions. Generate on first boot if absent. |
MCP_TG_HOOK_TOKEN |
auto-gen via /configure |
Shared secret used by Claude Code hooks to POST into daemon. |
MCP_TG_DAEMON_PORT |
17080 |
Port the hook scripts target (usually same as MCP_TG_PORT). |
MCP_TG_TOOL_EVENTS_TTL_DAYS |
7 |
Retention for the tool-events audit log (hourly cleanup). |
Variables are read from ~/.mcp-tg/.env by the daemon at startup; you can also export them in your shell.
~/.mcp-tg/config.json (daemon-managed)
Managed by the daemon and the /mcp-telegram:configure skill. Keys:
tunnel_provider— one ofcloudflared|tuna|manual|none.tunnel_manual_url— only used whentunnel_provider = manual; must be a publicly reachable HTTPS URL proxying to127.0.0.1:17080.default_workspace— optional slug used for system-event broadcasts before any workspace connects.
Choosing a tunnel provider
# Default: cloudflared (auto-generated trycloudflare URL, rotates per restart)
/mcp-telegram:configure tunnel cloudflared
# tuna.am alternative
/mcp-telegram:configure tunnel tuna
# Bring-your-own public URL (nginx, frp, your domain, etc.)
/mcp-telegram:configure tunnel manual
# then edit ~/.mcp-tg/config.json and set tunnel_manual_url to your HTTPS endpoint.
# No public access (local MiniApp only; Telegram bot still works for chat)
/mcp-telegram:configure tunnel none
After changing provider, restart the daemon. The new URL is pushed to the Telegram bot automatically — both as the default MiniApp button and for every allowlisted user's per-chat override.
Slash commands (in Claude Code)
| Command | Description |
|---|---|
/mcp-telegram:configure <TOKEN> |
Write bot token to ~/.mcp-tg/.env. |
/mcp-telegram:configure tunnel <provider> |
Set tunnel provider (see above). |
/mcp-telegram:access pair <CODE> |
Redeem a 6-digit pair code received via bot DM. |
/mcp-telegram:access list |
Show the current allowlist. |
/mcp-telegram:access remove <userId> |
Revoke access for a user. |
/mcp-telegram:access policy [<mode>] |
Show or set pairing / allowlist / open. |
/mcp-telegram:install-service |
Install a systemd --user service so the daemon starts on login (Linux only). |
All skills talk to the running daemon at http://127.0.0.1:17080/admin/* using the bearer token in ~/.mcp-tg/admin.token (auto-generated on first boot, mode 0600).
Bot commands (in Telegram)
| Command | Description |
|---|---|
/ws |
List workspaces / switch the target for incoming messages. |
/approvals |
Show current approval status / toggle on/off. |
/allowlist |
Manage the auto-approve tool allowlist. |
/allow <tool> [substring] |
Add an allow rule. |
/deny <tool> [substring] |
Add a deny rule. |
/yolo on | off |
Globally disable/enable approval prompts. |
Out-of-band: DM any non-command text to send it to the currently selected workspace's Claude session.
Deployment
For ad-hoc use, bun run --cwd packages/daemon start in a terminal is enough. For anything persistent:
# Linux — systemd user service (starts at login, restarts on failure)
/mcp-telegram:install-service
# Logs: journalctl --user -u mcp-telegram -f
# Stop: systemctl --user stop mcp-telegram
# Disable: systemctl --user disable mcp-telegram
On macOS / Windows run the daemon under your own process manager (launchd, pm2, nssm, etc.) — the MVP does not ship install scripts for those platforms.
Architecture (brief)
- daemon (
packages/daemon) — the only long-running process. Owns the bot, HTTP + WS servers, SQLite, tunnel, and approvals state. - mcp-server (
packages/mcp-server) — a stdio process spawned per Claude Code session; thin WebSocket client of the daemon. - miniapp (
packages/miniapp) — React SPA built once, served statically by the daemon at the tunnel URL. - shared (
packages/shared) — protocol, status, and tool-event types. - plugin (
plugin/) — Claude Code plugin with MCP server config, approval hooks, TodoWrite sync hook, and the sub-agent tool-events hook.
Full design docs live under docs/superpowers/specs/.
Tests
bun test # all workspaces
bun test --cwd packages/daemon # daemon-only
bun test --cwd packages/miniapp # MiniApp (vitest)
Security
- Pairing codes are in-memory only — a daemon restart invalidates them; DM the bot for a fresh code.
- Never approve a pairing request that arrived through the bot itself. The
/mcp-telegram:accessskill refuses operations downstream of Telegram input to prevent prompt-injection via messages. - MiniApp
initDatais validated server-side (HMAC-SHA256 per Telegram spec). MiniApp JWTs live 15 min. - Daemon binds to
127.0.0.1; public reach exists only through the tunnel provider. MCP_TG_HOOK_TOKENis the only credential required by hooks; it stays inside~/.mcp-tg/.env(mode 0600) and is never sent outside127.0.0.1.- Tool-event history is pruned after
MCP_TG_TOOL_EVENTS_TTL_DAYS(default 7);agent_sessionsindex is kept indefinitely as a compact audit trail.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。