Telegram MCP Server
A Model Context Protocol (MCP) server for Telegram, built with Telethon and FastMCP.
Features
- MTProto Support: High-performance communication via Telethon.
- FastMCP: Seamless integration with AI agents.
- Async & Performance: Optimized for speed and concurrency.
- Professional Core: Built-in logging, caching, and configuration.
Setup
- Install
uvif you haven't already. - Clone the repository.
- Create a
.envfile based on.env.example:cp .env.example .env - Fill in your
API_IDandAPI_HASHfrom my.telegram.org. - Install dependencies:
uv sync
Usage
Run the MCP server:
uv run python -m telegram_mcp.server
Structure
src/telegram_mcp/core/: Essential utilities (logger, cache, config).src/telegram_mcp/service/: Business logic and external API clients.src/telegram_mcp/models/: Pydantic data models.src/telegram_mcp/server.py: MCP server definition and tool registration.