Telegram MCP Server and HTTP-MTProto bridge | Multi-user, web setup, Docker and MTProto-Proxy ready
Fast MCP Telegram Server - Production-ready Telegram integration for AI assistants with comprehensive search, messaging, and direct API access capabilities.
mcp.json with your Bearer token.curl -X POST "https://tg-mcp.l1979.ru/mtproto-api/messages.SendMessage" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"params": {"peer": "me", "message": "Hello from Demo!"}}'| Feature | Description |
|---|---|
| :closed_lock_with_key: Multi-User Authentication | Production-ready Bearer token auth with session isolation and LRU cache management |
| :globe_with_meridians: HTTP-MTProto Bridge | Direct curl access to any Telegram API method with entity resolution and safety guardrails |
| :mag: Unified Message API | Single get_messages tool for search, browse, read by IDs, and replies - 5 modes in one |
| :speech_balloon: Universal Replies | Get replies from channel posts, forum topics, or any message with one parameter |
| :mag_right: Intelligent Search | Global & per-chat message search with multi-query support and intelligent deduplication |
| :building_construction: Dual Transport | Seamless development (stdio) and production (HTTP) deployment support |
| :file_folder: Secure File Handling | Rich media sharing with SSRF protection, size limits, album support, optional HTTP attachment streaming |
| :envelope: Advanced Messaging | Send, edit, reply, post to forum topics, formatting, file attachments, and phone number messaging |
| :microphone: Voice Transcription | Automatic speech-to-text for Premium accounts with parallel processing and polling |
| :card_file_box: Unified Session Management | Single configuration system for setup and server, with multi-account support |
| :busts_in_silhouette: Smart Contact Discovery | Search users, groups, channels with uniform entity schemas, forum detection, profile enrichment |
| :file_folder: Folder Filtering | Filter chats by dialog folder (archived, custom folders) with integer ID or name matching |
| :robot: Bot Chat Detection | Bots identified with type: "bot" and filterable via chat_type="bot" |
| :zap: High Performance | Async operations, parallel queries, connection pooling, and memory optimization |
| :shield: Production Reliability | Auto-reconnect, structured logging, comprehensive error handling with clear actionable messages |
| :dart: AI-Optimized | Literal parameter constraints, LLM-friendly API design, and MCP ToolAnnotations |
| :globe_with_meridians: Web Setup Interface | Browser-based authentication flow with immediate config generation |
| 🚀 MTProto Proxy Support | Connect via MTProto proxy with automatic Fake TLS (EE prefix) and standard proxy detection |
pip install fast-mcp-telegramfast-mcp-telegram-setup --api-id="your_api_id" --api-hash="your_api_hash" --phone-number="+123456789"Or use the web interface: run fast-mcp-telegram and open /setup
uvx --from fast-mcp-telegram fast-mcp-telegram-setup --api-id="your_api_id" --api-hash="your_api_hash" --phone-number="+123456789"Sessions are stored in ~/.config/fast-mcp-telegram/ and persist between uvx invocations.
STDIO:
{
"mcpServers": {
"telegram": {
"command": "uvx",
"args": ["fast-mcp-telegram"],
"env": {
"API_ID": "your_api_id",
"API_HASH": "your_api_hash"
}
}
}
}HTTP_AUTH:
{
"mcpServers": {
"telegram": {
"url": "https://your-server.com",
"headers": {
"Authorization": "Bearer AbCdEfGh123456789..."
}
}
}
}{"tool": "search_messages_globally", "params": {"query": "hello", "limit": 5}}
{"tool": "get_messages", "params": {"chat_id": "me", "limit": 10}}
{"tool": "send_message", "params": {"chat_id": "me", "message": "Hello!"}}This project uses GitHub Actions for automatic builds and deployments.
SSH_HOST, SSH_USER, SSH_PRIVATE_KEY.env in your forkmain — deployment happens automaticallyManual deployment: Use scripts/sync-remote-config.sh
See Deployment Guide for details.
See SECURITY.md for details.
MIT License - see LICENSE
leshchenko1979/fast-mcp-telegram
April 25, 2025
April 13, 2026
Python