Telegram MCP bridge for Claude Code — daemon + stdio proxy with multi-session support
Project description
Telegram MCP Bridge
Telegram MCP bridge for Claude Code — get notifications, ask questions, and interact with your Claude Code sessions through Telegram.
Each Claude Code session gets its own thread (topic) in a Telegram group, so you can monitor multiple sessions at once.
Features
- Send messages — progress updates, final reports, notifications
- Ask and wait — ask questions in Telegram and get answers back in Claude Code
- Inline buttons — present options for the user to choose from
- Send files — share screenshots, logs, documents
- Real-time monitoring — watch for incoming Telegram messages
- Multi-session — each Claude Code session gets its own Telegram thread
Architecture
Telegram group (is_forum: true, with Topics)
└── Thread per session ("{project} #{pid} — {time}")
│
daemon.py (single process, launchd, port 8765)
aiohttp HTTP API + single Telegram long-polling via httpx
│
proxy.py (stdio MCP, spawned by Claude Code)
Thin FastMCP proxy: lazy registration on first tool call
│
Claude Code (any number of sessions)
Why two processes? Telegram Bot API allows only one getUpdates polling per token. The daemon centralizes polling and distributes messages to sessions via HTTP.
Quick Start
1. Create a Telegram bot and group
- Create a bot via @BotFather — save the token
- Create a Telegram group, enable Topics (group settings → Topics)
- Add the bot to the group as admin (needs "Manage Topics" permission)
- Get the group chat ID (send a message, then check
https://api.telegram.org/bot<TOKEN>/getUpdates)
2. Install
pip install telegram-mcp-bridge
Or from source:
git clone https://github.com/OlegPrivet/telegram-mcp-bridge.git
cd telegram-mcp-bridge
pip install -e .
3. Configure
mkdir -p ~/.claude/channels/telegram-daemon
cat > ~/.claude/channels/telegram-daemon/.env << EOF
TELEGRAM_BOT_TOKEN=your-bot-token
TELEGRAM_CHAT_ID=-100your-group-id
DAEMON_PORT=8765
EOF
4. Start the daemon
tg-mcp-daemon
For macOS, use launchd for auto-start:
cd telegram-mcp-bridge
./launchd/generate-plist.sh
cp launchd/com.claude.tg-mcp-daemon.plist ~/Library/LaunchAgents/
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.claude.tg-mcp-daemon.plist
For Windows, use Task Scheduler for auto-start:
# Create a scheduled task that starts the daemon at logon
schtasks /create /tn "TelegramMCPDaemon" /tr "tg-mcp-daemon" /sc onlogon /rl limited
# Or if installed from source:
schtasks /create /tn "TelegramMCPDaemon" /tr "python -m telegram_mcp_bridge.daemon" /sc onlogon /rl limited
# Start it now without rebooting
schtasks /run /tn "TelegramMCPDaemon"
Note (Windows): The config directory is
%USERPROFILE%\.claude\channels\telegram-daemon\.env. Create it with:mkdir "$env:USERPROFILE\.claude\channels\telegram-daemon" -Force @" TELEGRAM_BOT_TOKEN=your-bot-token TELEGRAM_CHAT_ID=-100your-group-id DAEMON_PORT=8765 "@ | Set-Content "$env:USERPROFILE\.claude\channels\telegram-daemon\.env"
5. Register MCP in Claude Code
claude mcp add telegram -s user -- tg-mcp-proxy
Or if installed from source:
claude mcp add telegram -s user -- python3 -m telegram_mcp_bridge.proxy
MCP Tools
| Tool | Description |
|---|---|
send_message(message) |
Send a message (fire-and-forget) |
send_file(file_path, caption?) |
Send a file/screenshot to the thread |
send_and_wait(message) |
Send and wait for a reply (5 min timeout) |
send_and_wait_with_options(message, options) |
Send with inline buttons |
monitor_chat() |
Wait for incoming message (30 min timeout) |
check_inbox() |
Check for unread messages (non-blocking) |
list_sessions() |
List active sessions |
Management
Daemon
# Health check
curl -s http://127.0.0.1:8765/api/health
# Active sessions
curl -s http://127.0.0.1:8765/api/sessions | python3 -m json.tool
# Restart (macOS launchd)
launchctl kickstart -k gui/$(id -u)/com.claude.tg-mcp-daemon
# Stop (macOS launchd)
launchctl bootout gui/$(id -u)/com.claude.tg-mcp-daemon
# Restart (Windows Task Scheduler)
schtasks /end /tn "TelegramMCPDaemon" & schtasks /run /tn "TelegramMCPDaemon"
# Stop (Windows Task Scheduler)
schtasks /end /tn "TelegramMCPDaemon"
# Delete scheduled task (Windows)
schtasks /delete /tn "TelegramMCPDaemon" /f
# Logs
tail -f ~/.claude/channels/telegram-daemon/daemon.log
Proxy
Proxy processes are spawned automatically by Claude Code — one per session. They unregister gracefully on exit.
# Proxy logs
tail -f /tmp/tg_mcp_proxy.log
Configuration
| Variable | Default | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN |
— | Bot token from @BotFather (required) |
TELEGRAM_CHAT_ID |
— | Group chat ID with topics (required) |
DAEMON_PORT |
8765 |
HTTP API port for daemon |
SESSION_NAME |
auto | Custom session name for the thread |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file telegram_mcp_bridge-0.1.3.tar.gz.
File metadata
- Download URL: telegram_mcp_bridge-0.1.3.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc12de5b7aa60ab444c10f3e103b04cdcc9f8b3bbfd8edc717a208d4bd9d010f
|
|
| MD5 |
a0466664f52eb09626ef04ce34d9364d
|
|
| BLAKE2b-256 |
ef9f98792ffc7c3edee9d2689221fe31b603b48294438afd01b109b917fa65be
|
Provenance
The following attestation bundles were made for telegram_mcp_bridge-0.1.3.tar.gz:
Publisher:
publish.yml on OlegPrivet/telegram-mcp-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telegram_mcp_bridge-0.1.3.tar.gz -
Subject digest:
cc12de5b7aa60ab444c10f3e103b04cdcc9f8b3bbfd8edc717a208d4bd9d010f - Sigstore transparency entry: 1293623189
- Sigstore integration time:
-
Permalink:
OlegPrivet/telegram-mcp-bridge@83b17b7126ed32fd8cab071ddaae501576ce6d9c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OlegPrivet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@83b17b7126ed32fd8cab071ddaae501576ce6d9c -
Trigger Event:
push
-
Statement type:
File details
Details for the file telegram_mcp_bridge-0.1.3-py3-none-any.whl.
File metadata
- Download URL: telegram_mcp_bridge-0.1.3-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
938488202a39d4a5fc99ca6861142267c4704199377b9ca119d29b16956fd9ea
|
|
| MD5 |
304a31f5f2e33f036535294dd43a300b
|
|
| BLAKE2b-256 |
8a33372ef103821a0c0e4559219ecc937fe5c4dbb30bb483e46768ac3c780812
|
Provenance
The following attestation bundles were made for telegram_mcp_bridge-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on OlegPrivet/telegram-mcp-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telegram_mcp_bridge-0.1.3-py3-none-any.whl -
Subject digest:
938488202a39d4a5fc99ca6861142267c4704199377b9ca119d29b16956fd9ea - Sigstore transparency entry: 1293623200
- Sigstore integration time:
-
Permalink:
OlegPrivet/telegram-mcp-bridge@83b17b7126ed32fd8cab071ddaae501576ce6d9c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OlegPrivet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@83b17b7126ed32fd8cab071ddaae501576ce6d9c -
Trigger Event:
push
-
Statement type: