telegram-mcp

This repository provides a Telegram MCP server, enabling interaction with Telegram chats through MCP-compatible hosts like Claude for Desktop, using tools for retrieving chats, messages, and sending messages.

81
7

Telegram MCP Server

A Telegram MCP (Model Context Protocol) server built using Python, Telethon, and MCP Python SDK. This server facilitates interaction with Telegram chats through MCP-compatible hosts like Claude for Desktop.

Tools Provided

  • get_chats: Retrieves a paginated list of Telegram chats.
  • get_messages: Retrieves paginated messages from a specified chat.
  • send_message: Sends a message to a specified chat.

Requirements

Installation and Setup

  1. Clone the repository and navigate into it.
  2. Create a .env file with Telegram API credentials from https://my.telegram.org/apps.
  3. Set up a Python environment using uv, activate it, and install dependencies: mcp[cli], telethon, python-dotenv, and nest_asyncio.
  4. Run main.py to authenticate with Telegram.

Integrating with Claude for Desktop

Configure Claude Desktop by editing claude_desktop_config.json and adding the MCP server configuration, ensuring the correct absolute path to the project directory is specified.

Usage

The Telegram tools will be accessible within Claude for Desktop or any MCP-compatible client.

License

Licensed under the Apache 2.0 License.

Repository

CH
chigwell

chigwell/telegram-mcp

Created

March 20, 2025

Updated

March 28, 2025

Language

Python

Category

Communication