How moeinv363/telegram-mcp-bridge works
Telegram MCP Bridge is a self-hosted Telegram bot that replies immediately through an OpenAI-compatible LLM and can route keyword-triggered requests to Claude Code over MCP/SSE. Its documented workflow also includes per-chat history, photo analysis, reactions, and feedback. An optional Cloudflare Worker handles Telegram webhooks and can use Gemini when the local bridge is offline. The source index lists the main files but provides no excerpts, so relationships below rely on README statements; internal call ordering is not inferred.
Main entry points: server.js Bridge runtime · worker.js Telegram webhook
Components 19
Local Telegram Bridge
- Bridge runtime
server.js - Allowlist
server.js - Instant replies
server.js - Per-chat context
server.js - History persistence
server.js - History file
- Photo vision
server.js - Emoji reactions
server.js - Feedback buttons
server.js
Claude Integration
- MCP SSE endpoint
server.js
Worker Fallback
- Telegram webhook
telegram-worker/src/worker.js - Gemini fallback
telegram-worker/src/worker.js
Other components
- Telegram user
- Telegram Bot API
- Bot admin
- OpenAI-compatible LLM
- Vision model
- Claude Code
- Gemini
Connections 22
- Telegram user → Telegram Bot API: messages
README.md - Telegram Bot API → Bridge runtime: delivers updates
README.md - Bridge runtime → Allowlist: restricts users
README.md - Bridge runtime → Instant replies: auto-replies
README.md - Instant replies → OpenAI-compatible LLM: requests answer
README.md - Bridge runtime → Per-chat context: keeps chat context
README.md - Per-chat context → History persistence: persists conversations
README.md - History persistence → History file: reads and writes
README.md - Telegram Bot API → Photo vision: sends photos
README.md - Photo vision → Vision model: analyzes image
README.md - Photo vision → Telegram Bot API: replies with description
README.md - Bridge runtime → Emoji reactions: reacts to messages
README.md - Emoji reactions → Telegram Bot API: sends reactions
README.md - Instant replies → Feedback buttons: adds buttons
README.md - Feedback buttons → Telegram Bot API: delivers buttons
README.md - Feedback buttons → Bot admin: sends reports
README.md - Bridge runtime → MCP SSE endpoint: serves SSE
README.md - Claude Code → MCP SSE endpoint: connects over SSE
README.md - Telegram Bot API → Telegram webhook: webhook updates
README.md - Telegram webhook → Bridge runtime: forwards when online
README.md - Telegram webhook → Gemini fallback: uses when offline
README.md - Gemini fallback → Gemini: requests answer
README.md