telegram-mcp

telegram-mcp

Turns any Telegram bot into a chat-first AI assistant, with MCP tools for sending messages and reading conversation history.

Category
Visit Server

README

telegram-mcp

Built by Shreyas · Shipped by Globalion

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)

  1. Visit https://telegram.regiq.in and sign in with Google.
  2. In Telegram, DM @BotFather/newbot, follow prompts, copy the token.
  3. Paste the token in the Telegram bot panel on your dashboard.
  4. 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:

  1. On the dashboard, generate an MCP API key.

  2. Add to claude_desktop_config.json:

    {
      "mcpServers": {
        "telegram": {
          "url": "https://telegram.regiq.in/api/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_KEY_HERE"
          }
        }
      }
    }
    
  3. Restart Claude Desktop. Now your agent has:

    • send_telegram_message(text) — notify you on Telegram
    • list_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 3012 locally)
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

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.

Official
Featured
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured