Telegram Bot MCP

Telegram Bot MCP

Exposes Telegram Bot API operations as MCP tools, enabling managing messages, chats, and forum topics via a FastMCP server.

Category
Visit Server

README

Telegram Bot MCP

A FastMCP server that exposes Telegram Bot API operations as Model Context Protocol (MCP) tools. The server uses aiogram for Telegram Bot API calls and pydantic-settings for environment-based configuration.

Requirements

  • Python 3.10 or newer
  • A Telegram bot token from BotFather
  • An MCP-compatible client that can connect over streamable-http, sse, or stdio

Installation

  1. Clone or download this project.

  2. Install dependencies.

    pip install -r requirements.txt
    
  3. Create your environment file.

    cp .env.example .env
    

    On Windows PowerShell:

    Copy-Item .env.example .env
    
  4. Edit .env as needed for server transport, logging, and safety limits. (logging and safety limits currently not working)

Running the server

Run from the project root:

python telegram_bot_mcp.py

The default transport is streamable-http on 127.0.0.1:51000.

You can override transport, host, and port with command-line arguments:

python telegram_bot_mcp.py --transport streamable-http --host 127.0.0.1 --port 51000

Supported transport values are:

  • streamable-http
  • sse
  • stdio

MCP client configuration example

For a client that launches the server with a command, use a configuration similar to:

{
  "mcpServers": {
    "telegram-bot-mcp": {
      "command": "python",
      "args": ["telegram_bot_mcp.py", "--transport", "stdio"]
    }
  }
}

For HTTP-based clients, start the server with streamable-http and configure the client to connect to:

http://127.0.0.1:51000/mcp

Supported MCP tools

Server tools

Tool Description
health_check Returns basic MCP server status, server name, and active transport.

User and bot identity tools

Tool Parameters Description
get_me telegram_bot_token: string Returns sanitized identity information for the supplied Telegram bot token.

Chat tools

Tool Parameters Description
get_chat_infomations telegram_bot_token: string, chat_id: int | string Returns sanitized Telegram chat information for a chat ID or username. Note: the tool name currently uses infomations as implemented in the project.
delete_forum_topic telegram_bot_token: string, chat_id: int | string, message_thread_id: int, confirm: boolean = false Deletes a forum topic from a Telegram forum supergroup. Requires confirm=true.

Message tools

Tool Parameters Description
delete_message telegram_bot_token: string, chat_id: int | string, message_id: int Deletes one Telegram message from a conversation.
delete_messages telegram_bot_token: string, chat_id: int | string, message_ids: int[] Deletes multiple Telegram messages by explicit message IDs. Limited to 100 message IDs per call.
delete_message_history_range telegram_bot_token: string, chat_id: int | string, start_message_id: int, end_message_id: int, confirm: boolean = false Best-effort deletion of every message ID in an inclusive range. Requires confirm=true and is limited to 100 message IDs per call.

Telegram Bot API limitations

Telegram bots can only perform actions allowed by the Telegram Bot API and the bot's permissions in each chat. In particular:

  • The bot must be a member of the target chat.
  • Administrative permissions may be required for deleting messages or forum topics.
  • The Telegram Bot API cannot enumerate an entire chat history for deletion.
  • Message deletion is best-effort and may fail for messages the bot is not allowed to delete.

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