telegram-bot-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@telegram-bot-mcp Send a message to the general chat saying the deadline is extended."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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_countThree 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
Related MCP server: telegram-bot-mcp
Quick Start
stdio (Claude Desktop / local)
pip install .
export TELEGRAM_BOT_TOKEN=your_token_here
python -m telegram_bot_mcpAdd 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 8000Connect 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 8000Environment Variables
Variable | Required | Description |
| Yes | Bot token from @BotFather |
| No* | OIDC discovery URL — enables full OAuth2 proxy mode |
| No* | OAuth2 client ID |
| No* | OAuth2 client secret |
| No* | Public base URL of this server (required for OAuth2 redirects) |
| No | Stable key for signing session JWTs; random per startup if unset |
| No | Session duration in hours (default: |
| No | Static Bearer token (simpler alternative to OIDC) |
| No | Pre-configured chats: |
| No | Path for discovered-chat cache (default: |
* 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:latestThe 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 -dLicense
MIT — see LICENSE.
Available Tools
11 toolsdelete_messageC
Delete a message from a chat.
Inputs: chat_id (required), message_id (required). Returns: result
edit_message_textC
Edit the text of an existing message.
Inputs: text (required), chat_id (required), message_id (required), parse_mode. Returns: object
get_chatA
Return information about a chat (group, channel, or private).
Inputs: chat_id (required). Returns: object
get_chat_member_countC
Return the number of members in a chat.
Inputs: chat_id (required). Returns: result
get_meA
Return basic information about the bot (id, username, name, etc.).
Inputs: no named parameters. Returns: object
list_chatsA
List all known chats the bot can send messages to.
Combines two sources:
Persistent discovery: fetches new Telegram updates, extracts chats, and saves them to disk. Subsequent calls return the cached list instantly plus any newly discovered chats.
Static config: chats defined via the KNOWN_CHATS environment variable (format: "Name=chat_id,Name2=chat_id2") are always included.
Returns a dict with:
chats: list of {chat_id, name, type, username, source}
hint: what to tell the user if their desired chat is not in the list
Use the chat_id value with send_message and other tools. If the desired chat is missing, communicate the hint to the user and call list_chats again after they have followed the instructions.
Inputs: no named parameters. Returns: object
send_documentC
Send a file/document to a Telegram chat.
Inputs: chat_id (required), document (required), caption, parse_mode. Returns: object
send_locationB
Send a geographic location to a Telegram chat.
Inputs: chat_id (required), latitude (required), longitude (required), horizontal_accuracy. Returns: object
send_messageB
Send a text message to a Telegram chat.
Inputs: text (required), chat_id (required), parse_mode, reply_to_message_id, +1 more. Returns: object
send_photoC
Send a photo to a Telegram chat.
Inputs: photo (required), chat_id (required), caption, parse_mode. Returns: object
send_pollB
Send a poll to a Telegram chat.
Inputs: chat_id (required), options (required), question (required), is_anonymous, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct action or resource: chat operations (get_chat, get_chat_member_count, list_chats), message sending by type (send_message, send_photo, send_document, send_location, send_poll), and message editing/deletion (edit_message_text, delete_message). The send_* tools are clearly differentiated by content type, and get_me is a distinct bot-info operation.
The naming follows a mostly consistent verb_object pattern: get_chat, send_message, send_photo, delete_message, list_chats, edit_message_text, get_me, get_chat_member_count. The only slight deviation is get_chat_member_count (three-word object) and get_me (pronoun instead of noun), but these are minor and not confusing.
At 11 tools, the server is well-scoped for a Telegram bot MCP. Each tool covers a common, distinct Telegram operation without bloat. There is no overlap, redundancy, or superfluous tools.
The tool set covers core Telegram operations well: sending (all message types), editing, deletion, chat discovery, and bot info. Minor gaps include no ability to send stickers/video/audio, no pin/unpin message, no forward_message, and no reply-to support beyond basic sending, but these are edge operations not essential for most bot workflows.
Maintenance
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Read chats and members; send, edit and delete messages with a bot in Telegram.
Create and manage trading strategies, bots, webhooks and signals from any MCP client.
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to send messages and interact with Telegram chats through MCP tools, with support for user management, conversation history, and bot command handling.1-
- AlicenseBqualityDmaintenanceFull-featured Telegram Bot API server for MCP (Model Context Protocol). 174 tools covering the entire Bot API — messages, chats, stickers, payments, forums, stories, and more.100585 npm7MIT
- AlicenseAqualityDmaintenanceExposes the Telegram Bot API as tools for Claude Code or any MCP client, enabling message sending, chat management, file handling, and bot information retrieval.201MIT
- AlicenseAqualityCmaintenanceAn MCP server that lets an LLM send messages, photos, and documents to Telegram through a bot. Provides four tools: get_me, send_message, send_photo, and send_document.4MIT