Telegram API integration for accessing user data, managing dialogs (chats, channels, groups), retrieving messages, and handling read status
The Telegram MCP server acts as a crucial intermediary, leveraging the Model Context Protocol to seamlessly connect AI assistants with the Telegram API. This integration unlocks a range of powerful capabilities, enabling AI to interact with and understand your Telegram data in a controlled and secure manner.
The Model Context Protocol (MCP) is a game-changer for AI applications. It provides a standardized framework for Large Language Models (LLMs) to access external data sources and tools. This means AI assistants can now leverage real-world information and perform actions beyond their initial training, opening up a world of possibilities.
This server specifically bridges the gap between the Telegram API and MCP-compatible AI assistants. By implementing the MCP, the server allows AI to:
Crucially, this is all done with the user in control, ensuring privacy and security.
The Telegram MCP server boasts a robust set of features:
tool: tg_me
: Get current account information (name, profile picture, etc.).tool: tg_dialogs
: List all your Telegram dialogs, with the option to filter for unread messages.tool: tg_read
: Mark specific dialogs as read.tool: tg_dialog
: Retrieve messages from a specific dialog, allowing AI to analyze conversation history.tool: tg_send
: Send draft messages to any dialog, enabling AI to assist with communication.Here are some practical examples of how you can use the Telegram MCP server with your AI assistant:
The Telegram MCP server offers multiple installation options to suit your technical expertise and operating system.
The easiest method for macOS and Linux users:
# Install brew install chaindead/tap/telegram-mcp # Update brew upgrade chaindead/tap/telegram-mcp
Run the latest version directly without installation:
npx -y @chaindead/telegram-mcp
Important NPX Considerations:
Authentication: npx -y @chaindead/telegram-mcp auth ...
Claude/Cursor Configuration:
{ "mcpServers": { "telegram": { "command": "npx", "args": ["-y", "@chaindead/telegram-mcp"], "env": { "TG_APP_ID": "<your-api-id>", "TG_API_HASH": "<your-api-hash>" } } } }
Download pre-built binaries for your operating system and architecture.
# For Intel Mac (x86_64) curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Darwin_x86_64.tar.gz # For Apple Silicon (M1/M2) curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Darwin_arm64.tar.gz # Extract the binary sudo tar xzf telegram-mcp.tar.gz -C /usr/local/bin # Make it executable sudo chmod +x /usr/local/bin/telegram-mcp # Clean up rm telegram-mcp.tar.gz
# For x86_64 (64-bit) curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Linux_x86_64.tar.gz # For ARM64 curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Linux_arm64.tar.gz # Extract the binary sudo tar xzf telegram-mcp.tar.gz -C /usr/local/bin # Make it executable sudo chmod +x /usr/local/bin/telegram-mcp # Clean up rm telegram-mcp.tar.gz
.zip
filetelegram-mcp.exe
to a directory in your PATHFor developers who want to build from source:
go install github.com/chaindead/telegram-mcp@latest
Prerequisites:
Obtain your API ID and hash from Telegram API.
Run the following command, replacing the placeholders with your actual credentials:
telegram-mcp auth --app-id <your-api-id> --api-hash <your-api-hash> --phone <your-phone-number>
--password <2fa_password>
.--new
.Enter the verification code you receive from Telegram.
Configure your AI client (e.g., Claude Desktop, Cursor) to recognize the Telegram MCP server.
Locate the configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add the server configuration:
For Claude Desktop:
{ "mcpServers": { "telegram": { "command": "telegram-mcp", "env": { "TG_APP_ID": "<your-app-id>", "TG_API_HASH": "<your-api-hash>", "PATH": "<path_to_telegram-mcp_binary_dir>", "HOME": "<path_to_your_home_directory>" } } } }
For Cursor:
{ "mcpServers": { "telegram-mcp": { "command": "telegram-mcp", "env": { "TG_APP_ID": "<your-app-id>", "TG_API_HASH": "<your-api-hash>" } } } }
The Telegram MCP server is a powerful tool for integrating AI assistants with your Telegram account. By following this guide, you can unlock a new level of productivity and efficiency, leveraging AI to manage your messages, organize your conversations, and communicate more effectively. Remember to always adhere to the Telegram API Terms of Service to ensure responsible and ethical usage.
๐ VOYP Voice Over Your Phone MCP Server for making calls.
๐ An MCP server with openAPI specs for using the WhatsApp unnoficial API (https://waha.devlike.pro/ also open source: https://github.com/devlikeapro/waha
๐ ๐ JMeter MCP Server for performance testing
๐ โ๏ธ Slack workspace integration for channel management and messaging