telegram-bot-mcp

telegram-bot-mcp

Exposes the Telegram Bot API as tools for MCP clients, enabling sending messages, photos, polls, and more via a Telegram bot.

Category
Visit Server

README

telegram-bot-mcp

A Model Context Protocol (MCP) server that exposes the Telegram Bot API as tools — letting Claude and other MCP clients send messages, photos, polls and more via a Telegram bot.

Built with FastMCP (Python). No external auth proxy required — OIDC/JWT authentication is built in.

Features

  • Tools: get_me, list_chats, send_message, send_photo, send_document, send_location, send_poll, edit_message_text, delete_message, get_chat, get_chat_member_count
  • Three auth modes: stdio (no auth), static Bearer token, full OIDC OAuth2 proxy (e.g. Authentik, Keycloak)
  • Transports: stdio (Claude Desktop) + Streamable HTTP (remote/K8s)
  • Multi-arch Docker image: linux/amd64 + linux/arm64

Quick Start

stdio (Claude Desktop / local)

pip install .
export TELEGRAM_BOT_TOKEN=your_token_here
python -m telegram_bot_mcp

Add to Claude Desktop claude_desktop_config.json:

{
  "mcpServers": {
    "telegram": {
      "command": "python",
      "args": ["-m", "telegram_bot_mcp"],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your_token_here"
      }
    }
  }
}

Streamable HTTP (remote)

export TELEGRAM_BOT_TOKEN=your_token_here
export AUTH_TOKEN=your_secret_bearer_token   # optional: require auth
python -m telegram_bot_mcp --transport streamable-http --port 8000

Connect from Claude Code:

claude mcp add telegram --transport http https://your-host:8000/mcp \
  --header "Authorization: Bearer your_secret_bearer_token"

OIDC OAuth2 (production)

Full OAuth2 flow — the server acts as an OIDC proxy. Users authenticate via your identity provider (Authentik, Keycloak, Auth0, etc.) and receive a session that lasts SESSION_LIFETIME_HOURS (default: 8h).

export TELEGRAM_BOT_TOKEN=your_token_here
export OIDC_DISCOVERY_URL=https://auth.example.com/application/o/my-app/.well-known/openid-configuration
export OIDC_CLIENT_ID=your_client_id
export OIDC_CLIENT_SECRET=your_client_secret
export BASE_URL=https://telegram-bot-mcp.example.com
python -m telegram_bot_mcp --transport streamable-http --port 8000

Environment Variables

Variable Required Description
TELEGRAM_BOT_TOKEN Yes Bot token from @BotFather
OIDC_DISCOVERY_URL No* OIDC discovery URL — enables full OAuth2 proxy mode
OIDC_CLIENT_ID No* OAuth2 client ID
OIDC_CLIENT_SECRET No* OAuth2 client secret
BASE_URL No* Public base URL of this server (required for OAuth2 redirects)
JWT_SIGNING_KEY No Stable key for signing session JWTs; random per startup if unset
SESSION_LIFETIME_HOURS No Session duration in hours (default: 8)
AUTH_TOKEN No Static Bearer token (simpler alternative to OIDC)
KNOWN_CHATS No Pre-configured chats: Name=chat_id,Name2=chat_id2
CHAT_STORE_PATH No Path for discovered-chat cache (default: ~/.local/share/fastmcp/chats.json)

* All four OIDC variables must be set together to enable OAuth2 mode.

Docker

docker run -p 8000:8000 \
  -e TELEGRAM_BOT_TOKEN=your_token_here \
  -v telegram-data:/data \
  ghcr.io/your-org/telegram-bot-mcp:latest

The named volume (telegram-data:/data) persists discovered chat IDs across container restarts.

Or use Docker Compose:

cp .env.example .env  # fill in your token
docker compose up -d

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
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
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
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