telegram-mcp
Turns any Telegram bot into a chat-first AI assistant, with MCP tools for sending messages and reading conversation history.
README
telegram-mcp
Turn any Telegram bot into a chat-first AI assistant. Sign in with Google, paste your BotFather token, message your bot. Bonus: MCP tools let external agents (Claude Desktop, Cursor, custom scripts) push notifications to your bot and read your recent conversation history.
- Chat via your own Telegram bot — you own the token, you own the data.
- MCP over streamable-HTTP — plug into Claude Desktop, Cursor, etc.
- OpenRouter under the hood — swap models freely (Claude 5, GPT, Gemini).
- Self-host in one Docker Compose command if you don't want us in the loop.
Hosted for free at telegram.regiq.in.
Use it (hosted)
As a chat assistant (main use case)
- Visit https://telegram.regiq.in and sign in with Google.
- In Telegram, DM @BotFather →
/newbot, follow prompts, copy the token. - Paste the token in the Telegram bot panel on your dashboard.
- Open your bot on Telegram, send
/start, then chat with it in plain English.
Commands your bot understands:
- Any plain-English message → assistant replies with memory of the conversation
/reset→ clears conversation history/start→ welcome message
As an MCP tool (optional)
If you want your Claude Desktop / Cursor agent to push messages into your Telegram bot:
-
On the dashboard, generate an MCP API key.
-
Add to
claude_desktop_config.json:{ "mcpServers": { "telegram": { "url": "https://telegram.regiq.in/api/mcp", "headers": { "Authorization": "Bearer YOUR_KEY_HERE" } } } } -
Restart Claude Desktop. Now your agent has:
send_telegram_message(text)— notify you on Telegramlist_recent_messages(max)— read recent bot history
Great for: long-running job notifications, scheduled reminders, agent-to-human handoff.
Tools
| Tool | Purpose |
|---|---|
send_telegram_message |
Push a message from your agent into the user's bot. |
list_recent_messages |
Return recent bot conversation for context. |
Self-host
You'll need:
- Docker + Compose
- A Google OAuth client — Cloud Console. Scopes:
openid,email,profile. Redirect:<PUBLIC_BASE_URL>/api/auth/callback/google - An OpenRouter API key — openrouter.ai/keys
- A public HTTPS domain for Telegram webhooks to reach (Cloudflare Tunnel or
ngrok http 3012locally)
git clone https://github.com/globalion/telegram-mcp
cd telegram-mcp
cp .env.example .env
# fill in NEXTAUTH_SECRET, GOOGLE_*, OPENROUTER_API_KEY, PUBLIC_BASE_URL
docker compose up -d
# open http://localhost:3012
How it works
Telegram
▼
/api/telegram/webhook/<per-user-secret>
│
▼
┌─────────────┐
│ chat.ts │ loads recent history from Postgres
│ │ → sends to OpenRouter
│ │ → persists reply + sends via bot API
└─────────────┘
External MCP clients (Claude Desktop, Cursor, custom agents)
▼
/api/mcp (Bearer <apiKey>)
│
┌───────────┴───────────┐
▼ ▼
send_telegram_message list_recent_messages
Per-user webhook URL segment is a random secret so a leaked bot token can't be pointed at someone else's account. Google refresh tokens aren't touched — Google sign-in is identity only.
License
MIT. See LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.