About Telegram
Telegram is a hosted or self-hosted bridge between Telegram chats and an agent. It stores incoming messages for agents to poll and lets agents send replies, while platform slash commands work independently of the agent.
Key features
- 01Poll inbound Telegram messages
- 02Send agent replies to Telegram
- 03Read recent messages and clear history
- 04Handle platform slash commands
- 05Hosted or Docker Compose deployment
Use cases
- 01Use Telegram as a chat interface for an agent
- 02Let an agent reply to incoming Telegram messages
- 03Review or clear stored chat history
MCP support
MCP clients connect to the `/api/mcp` endpoint with a Bearer API key. The server provides tools to retrieve incoming messages, send replies, inspect recent history, and clear it.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://telegram.regiq.in/api/mcpclaude mcp add --transport http shreyas-profile-telegram https://telegram.regiq.in/api/mcp{"mcpServers":{"shreyas-profile-telegram":{"type":"http","url":"https://telegram.regiq.in/api/mcp"}}}Open in Cursor{"servers":{"shreyas-profile-telegram":{"type":"http","url":"https://telegram.regiq.in/api/mcp"}}}Open in VS Code{"mcpServers":{"shreyas-profile-telegram":{"type":"http","url":"https://telegram.regiq.in/api/mcp"}}}{"mcpServers":{"shreyas-profile-telegram":{"serverUrl":"https://telegram.regiq.in/api/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
https://telegram.regiq.in/api/mcpAuth requiredTools
Details
From the project READMEtelegram-mcp
Bidirectional Telegram ⇆ agent bridge. No LLM in our stack.
Your agent (Claude Desktop, Cursor, a custom script) is the brain. Our platform is the pipe: we take messages you send on Telegram, store them, and hand them to your agent when it polls. When your agent has something to say back, it pushes through us to your Telegram.
- Bring your own agent. Any MCP client works.
- No inference in the middle. We don't call an LLM. No vendor lock-in.
- Bidirectional.
get_new_messagespulls inbound,send_telegram_messagepushes outbound. - Platform slash-commands.
/help,/clear,/recent,/window,/usageall work even if your agent is offline.
Hosted at telegram.regiq.in or self-host with the Docker Compose below.
Use it (hosted)
-
Visit https://telegram.regiq.in, sign in with Google.
-
DM @BotFather →
/newbot. Paste the token in your dashboard. -
On the dashboard: Generate MCP API key, copy it.
-
Add to Claude Desktop's
claude_desktop_config.json(or Cursor / any MCP client):{ "mcpServers": { "telegram": { "url": "https://telegram.regiq.in/api/mcp", "headers": { "Authorization": "Bearer YOUR_KEY_HERE" } } } } -
Send
/startto your bot on Telegram.
Now your agent can call get_new_messages to see what you sent it, and send_telegram_message to reply.
Tools
| Tool | Direction | Notes |
|---|---|---|
get_new_messages() | user → agent | Returns inbound messages since the last pull. Read-once. |
send_telegram_message(text) | agent → user | Delivers text to the user's Telegram bot. |
list_recent_messages(max=20) | read | Last N stored messages, both directions. No cursor advance. |
clear_history() | action | Wipes stored history for the user. |
Slash commands (platform-handled)
Handled by the platform directly — your agent isn't involved. So /help works even when nothing is polling.
| Command | Effect |
|---|---|
/start | Registers this Telegram chat with your account. |
/help | Lists commands. |
/recent [N] | Shows the last N stored messages. |
/clear | Wipes history. |
/window N | Sets the history window (default 20). |
/usage | Stored message count. |
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 - A public HTTPS domain for Telegram webhooks (Cloudflare Tunnel or
ngrok http 3012locally)
No LLM key required. Your agent brings its own model.
git clone https://github.com/globalion/telegram-mcp
cd telegram-mcp
cp .env.example .env
# fill NEXTAUTH_SECRET, GOOGLE_*, PUBLIC_BASE_URL
docker compose up -d
# open http://localhost:3012
Architecture
Telegram app Your MCP agent
▲ │ ▲ │
│ │ text poll │ │ push
│ ▼ │ ▼
┌──────────────────────────────────────────────────┐
│ Our platform (Hetzner) │
│ - /api/telegram/webhook/<per-user-secret> │
│ · slash-commands answered here │
│ · plain text stored, no reply │
│ - /api/mcp Bearer-auth JSON-RPC │
│ · get_new_messages, send_telegram_message │
│ · list_recent_messages, clear_history │
│ - Postgres: User, ApiKey, TelegramLink, Message │
└──────────────────────────────────────────────────┘
Per-user webhook URL segment is a random secret so a leaked bot token can't be pointed at someone else's account. Google sign-in is identity + ban anchor only — per-message identity comes from the MCP API key + chatId.
License
MIT. See LICENSE.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.