Telegram MCP Bridge

Telegram MCP Bridge

Bridges Telegram bot messages to Claude Code through MCP, offering instant AI auto-replies and optional keyword-triggered Claude integration.

Category
访问服务器

README

Telegram MCP Bridge 🤖

A self-hosted bridge that connects a Telegram bot to Claude Code over the Model Context Protocol (MCP), with an instant auto-reply layer so the bot answers users immediately — even when the Claude app is closed.

Features ✨

  • Instant auto-replies — any message to the bot gets an AI reply in ~2 seconds (OpenAI-compatible LLM)
  • Claude integration — messages containing a keyword (default: claude) are routed to Claude Code for full-powered answers
  • Emoji reactions — automatically reacts to every incoming message 👍❤️🔥
  • Photo support + vision — when someone sends a photo, the bot reacts, analyzes the image content with a vision model, and replies with a description 📷👁️
  • User feedback buttons — every bot reply has 👍 / 👎 / 🚩 Report buttons; reports are sent to the admin 👍👎🚩
  • Per-chat context — each user only sees their own conversation history
  • History persistence — conversations survive restarts (saved to .history.json)
  • Allowlist support — optional: restrict usage to specific Telegram user IDs
  • SSE MCP server — Claude connects over http://127.0.0.1:8765/sse
  • Startup launcher — runs at login, always available

Architecture 🏗️

Telegram bot ←→ bridge (node) ←→ LLM (auto-reply, instant)
                      │
                      └── MCP over SSE ←→ Claude Code (smart mode)

Setup 🚀

Prerequisites

  • Node.js 18+
  • A Telegram bot token (from @BotFather)
  • An OpenAI-compatible LLM endpoint + API key

Install

npm install
cp config.env.example config.env
# edit config.env with your values

Run (manual)

node server.js

Run (auto-start at login, Windows)

Create a .bat in the Startup folder (shell:startup) that sets the env vars from config.env and runs node server.js.

Connect Claude Code

Add to ~/.claude.json:

{
  "mcpServers": {
    "telegram": {
      "type": "sse",
      "url": "http://127.0.0.1:8765/sse"
    }
  }
}

Configuration ⚙️

See config.env.example for all options: bot token, allowlist, SSE port, auto-reply model, fallback model, Claude keyword.

Security 🔒

  • Never commit config.env — it contains your bot token and API keys
  • Allowlist (ALLOWED_USER_IDS) restricts who can use the bot — recommended for private bots
  • The auto-reply uses your LLM API key — a public bot means anyone can consume your quota

License 📄

MIT

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

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

官方
精选