telegram
Telegram MCP server powered by Telethon to let MCP clients read chats, manage groups, and send/modify messages, media, contacts, and settings.
claude mcp add --transport stdio chigwell-telegram-mcp python -m telegram_mcp \ --env TELEGRAM_API_ID="your_api_id" \ --env TELEGRAM_API_HASH="your_api_hash" \ --env TELEGRAM_BOT_TOKEN="your_bot_token" \ --env TELEGRAM_SESSION_NAME="telegram_mcp_session"
How to use
This Telegram MCP server provides a comprehensive Telethon-powered integration for Claude, Cursor, and any MCP-compatible client. It exposes a wide range of Telegram tools as MCP functions, covering chat and group management, messaging, contact management, user profiles, media handling, searches, and governance tasks. You can query chats, send messages, manage groups and channels, handle invites, export/import contacts, work with polls, pins, reactions, and even inspect or trigger inline keyboard buttons. The server is designed to be consumed by MCP clients that can enumerate and call these tool APIs, enabling automation and conversational access to Telegram features through the MCP protocol.
How to install
Prerequisites:
- Python 3.8+ (recommended)
- pip (Python package manager)
- Access to Telegram API credentials (API ID, API Hash) and a bot token or a session-configured account
Installation steps:
- Install Python if not already installed
- Create and activate a virtual environment (optional but recommended)
- python -m venv venv
- source venv/bin/activate # on Unix/macOS
- .\venv\Scripts\activate # on Windows
- Install the Telegram MCP package (adjust package name if different in your repo)
- pip install telegram-mcp
- Configure environment variables with your Telegram credentials
- On Unix/macOS: export TELEGRAM_API_ID=your_api_id export TELEGRAM_API_HASH=your_api_hash export TELEGRAM_BOT_TOKEN=your_bot_token export TELEGRAM_SESSION_NAME=telegram_mcp_session
- On Windows (PowerShell): $env:TELEGRAM_API_ID = 'your_api_id' $env:TELEGRAM_API_HASH = 'your_api_hash' $env:TELEGRAM_BOT_TOKEN = 'your_bot_token' $env:TELEGRAM_SESSION_NAME = 'telegram_mcp_session'
- Run the MCP server (example using the Python module entry point)
- python -m telegram_mcp
- Verify the server starts and is reachable by your MCP client
Optional: If you prefer Docker, you can containerize this setup by creating a Dockerfile that installs Python and telegram-mcp and passes the required environment variables at runtime.
Additional notes
Environment variables are required for Telegram authentication (API ID/Hash and a bot token or session). Ensure you keep these credentials secure. The MCP server exposes a large suite of tools; you can selectively enable or disable features via your client configuration or by adjusting the package's internal access controls. If you encounter connection issues, verify that the Telegram credentials are valid and that your hosting environment allows outbound connections to Telegram servers. For long-running deployments, consider mounting a persistent session file (named via TELEGRAM_SESSION_NAME) to maintain login state across restarts.
Related MCP Servers
ddgs
A metasearch library that aggregates results from diverse web search services
mcp-omnisearch
🔍 A Model Context Protocol (MCP) server providing unified access to multiple search engines (Tavily, Brave, Kagi), AI tools (Perplexity, FastGPT), and content processing services (Jina AI, Kagi). Combines search, AI responses, content processing, and enhancement features through a single interface.
lihil
2X faster ASGI web framework for python, offering high-level development, low-level performance.
flapi
API Framework heavily relying on the power of DuckDB and DuckDB extensions. Ready to build performant and cost-efficient APIs on top of BigQuery or Snowflake for AI Agents and Data Apps
openproject
A Model Context Protocol (MCP) server that provides seamless integration with OpenProject API v3.
kokoro
TTS toolkit built on Kokoro-82M with librosa audio enhancement, MCP server for Claude/Cursor, CLI & Python API. Free & open-source for YouTube creators.