Telegram MCP Server
Integrations
Enables interaction with Telegram chats, allowing users to retrieve lists of chats, fetch message history, and send messages directly through the Telegram platform.
Telegram MCP Server
A Telegram MCP (Model Context Protocol) server built using Python, Telethon, and MCP Python SDK. This MCP server provides simple tools for interacting with Telegram chats directly through MCP-compatible hosts, such as Claude for Desktop.
Tools Provided
get_chats
: Retrieve a paginated list of your Telegram chats.get_messages
: Retrieve paginated messages from a specific chat.send_message
: Send a message to a specific chat.
Requirements
- Python 3.10 or higher
- Telethon package
- MCP Python SDK
- UV (optional but recommended)
Installation and Setup
Clone the Repository
Create Environment File
Copy and rename .env.example
to .env
and fill it with your Telegram credentials obtained from https://my.telegram.org/apps:
Your .env
file should look like:
Setup Python Environment
Use uv
to set up the Python environment and install dependencies:
Run the Server (First-time Auth)
The first time you run the server, Telethon will prompt you to enter a Telegram authentication code:
Authenticate by entering the code sent to your Telegram client. This step is only required once.
Integrating with Claude for Desktop
macOS/Linux
Edit your Claude Desktop configuration:
Add this MCP server configuration:
Ensure you replace /ABSOLUTE_PATH/telegram-mcp
with your project's absolute path.
Windows
Edit your Claude Desktop configuration:
Add this MCP server configuration:
Ensure you replace C:\ABSOLUTE_PATH\telegram-mcp
with your project's absolute path.
Usage
Once integrated, your Telegram tools (get_chats
, get_messages
, and send_message
) will become available within the Claude for Desktop UI or any other MCP-compatible client.
License
This project is licensed under the Apache 2.0 License.
This server cannot be installed
A server that enables interaction with Telegram chats directly through MCP-compatible hosts like Claude for Desktop, providing tools to retrieve chats, get messages, and send messages.