Claude Code Telegram Kit
Enables sending properly rendered Markdown messages to Telegram and remotely resetting Claude Code's context, addressing gaps in Anthropic's official Telegram channel.
README
Claude Code Telegram Kit
Not another Telegram bridge. Anthropic's official Claude Code Channel keeps inbound. This kit fixes the two things it does not do: Markdown that survives Telegram's parser, and resetting context from your phone.
Research-preview infrastructure. Review the security model before connecting it to a machine with valuable data.
| Official Channel | With this kit |
|---|---|
![]() |
![]() |
The same Markdown document, both paths. The official reply tool defaults to format: "text", so markup arrives literal; its markdownv2 mode shifts MarkdownV2 escaping onto the model, where one missed character fails the send. send_reply takes the document unescaped and picks the transport itself. (Figures are rendered from both paths, not device screenshots.)
Why this exists
Every other "Claude Code + Telegram" project replaces the official Channel: its own poller, its own session management, its own pairing. This one does not. Inbound polling, sender pairing, attachments, and permission relay stay with Anthropic's plugin. The kit adds two bounded outbound/control capabilities beside it, without a second getUpdates consumer:
- Telegram Renderer MCP — one canonical
send_reply(raw Markdown)tool with deterministic Rich Message vs MarkdownV2 routing, permanent-only fallback, and👀 → 👍/👎processing reactions. - Session Control MCP — an approval-gated
/resetpath that finalizes the confirmed acceptance reaction, then hands execution to a root-owned, fail-closed local reset helper that PID 1 executes.
Both gaps are open upstream. This kit is the interim answer:
- anthropics/claude-code#39684 — no way to clear or reset context remotely
- anthropics/claude-code#36622 and claude-plugins-official#774 — requesting a MarkdownV2
parse_mode
Quickstart
Requires the official telegram@claude-plugins-official plugin already paired and working.
git clone https://github.com/project-tharsis/claude-code-telegram-kit
cd claude-code-telegram-kit
bun install --frozen-lockfile
bun run check
sha=$(git rev-parse HEAD)
python3 scripts/deploy_local.py install --repo . --ref "$sha" --bun "$(command -v bun)"
Then copy examples/.mcp.json, examples/telegram-settings.json, and examples/CLAUDE.md into your Claude project, replacing USER with your own paths. Merge examples/access-ux.json into the official Channel's access.json to enable the initial 👀 acknowledgement. Send a message with a GFM table; the renderer should report mode: rich and replace 👀 with 👍.
The renderer works on its own. /reset additionally needs the root helper, installed separately by the exact-commit procedure in the session-control README.
For production deployment, rollback, and verification, follow the operations runbook rather than this section.
Architecture
Telegram
-> telegram@claude-plugins-official # sole inbound poller
-> Claude Code
-> telegram-renderer MCP # bounded outbound rendering
-> session-control MCP # bounded reset scheduling
-> systemd transient unit
-> root-owned session reset helper
The renderer and control MCPs reuse the official Channel's token and access.json authority. They require dmPolicy: allowlist, secure 0600 state files, and exact destination membership.
Design invariants
These five define the blast radius:
- One Telegram
getUpdatesconsumer per bot token. - No arbitrary Bot API method tool.
- No arbitrary shell command tool.
- Timeouts, 429s, 5xx responses, and unknown outcomes never trigger a resend.
- PID 1 owns reset execution before the Claude process is terminated.
The complete set is in docs/design-invariants.md.
Repository layout
packages/
shared/ Telegram authority validation
telegram-renderer-mcp/ Markdown renderer and MCP server
session-control-mcp/ Reset controller, MCP server, root helper
examples/ Generic Claude, MCP, systemd, and reset config
scripts/ Versioned local install and rollback
Requirements
- Linux with systemd and procfs mounted at
/proc - Claude Code 2.1.234 or newer
- Bun 1.3.14 or newer
- Python 3.11 or newer
- Anthropic's official
telegram@claude-plugins-officialplugin
Installation model
Do not run production from a mutable development checkout. Install an exact commit into a versioned release directory:
~/.local/share/claude-code-telegram-kit/
releases/<git-sha>/
current -> releases/<git-sha>
previous -> releases/<previous-sha>
scripts/deploy_local.py extracts a Git archive with a Python 3.11-compatible no-link/no-traversal extractor, installs production dependencies, verifies the release receipt, and atomically swaps current/previous. It never installs root-owned files.
python3 scripts/deploy_local.py status
python3 scripts/deploy_local.py rollback
Keep Telegram credentials and allowlists under Claude's state directory, and keep reset configuration root-owned under /etc/claude-code-telegram-kit/.
Session reset
The local recovery authority is:
sudo claude-code-session-reset --config /etc/claude-code-telegram-kit/reset.json
The optional Telegram /reset command is a thin MCP front end. It cannot recover a Claude process that is already unable to receive messages; keep the local helper available as the break-glass path.
Development
bun install --frozen-lockfile
bun run check
bun audit
Security
Read SECURITY.md before deployment. Never commit bot tokens, chat IDs, transcripts, service-specific paths, or live reset configuration.
Project status
The code is extracted from a live, verified deployment, then generalized into a clean-room public repository. APIs may change before 1.0.0.
The initial release is source-only. Workspace packages are marked private and are not published to npm; install from an exact Git commit with the versioned deploy script.
License
Apache-2.0. See LICENSE, NOTICE, and THIRD_PARTY_NOTICES.md. Release procedure: RELEASING.md.
This project is independent and is not endorsed by Anthropic or Telegram.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。

