{"id":40071103,"url":"https://github.com/leshchenko1979/fast-mcp-telegram","last_synced_at":"2026-02-19T00:25:55.422Z","repository":{"id":289909428,"uuid":"972787007","full_name":"leshchenko1979/fast-mcp-telegram","owner":"leshchenko1979","description":"Telegram MCP Server and HTTP-MTProto bridge | Multi-user auth, intelligent search, file sending, web setup | Docker \u0026 PyPI ready","archived":false,"fork":false,"pushed_at":"2026-01-19T06:25:43.000Z","size":1823,"stargazers_count":18,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-19T15:10:03.048Z","etag":null,"topics":["agent","agentic-ai","automation","claude","cursor","cursor-ai","fastmcp","mcp","mcp-client","mcp-server","telegram","telethon"],"latest_commit_sha":null,"homepage":"https://t.me/mcp_telegram","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leshchenko1979.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-25T16:57:27.000Z","updated_at":"2026-01-19T06:24:58.000Z","dependencies_parsed_at":"2026-01-17T12:34:00.010Z","dependency_job_id":null,"html_url":"https://github.com/leshchenko1979/fast-mcp-telegram","commit_stats":null,"previous_names":["leshchenko1979/tg_mcp","leshchenko1979/fast-mcp-telegram"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/leshchenko1979/fast-mcp-telegram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshchenko1979%2Ffast-mcp-telegram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshchenko1979%2Ffast-mcp-telegram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshchenko1979%2Ffast-mcp-telegram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshchenko1979%2Ffast-mcp-telegram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leshchenko1979","download_url":"https://codeload.github.com/leshchenko1979/fast-mcp-telegram/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshchenko1979%2Ffast-mcp-telegram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","agentic-ai","automation","claude","cursor","cursor-ai","fastmcp","mcp","mcp-client","mcp-server","telegram","telethon"],"created_at":"2026-01-19T08:09:00.168Z","updated_at":"2026-01-21T12:07:44.041Z","avatar_url":"https://github.com/leshchenko1979.png","language":"Python","funding_links":[],"categories":["カテゴリ"],"sub_categories":["💬 \u003ca name=\"communication\"\u003e\u003c/a\u003eコミュニケーション"],"readme":"\u003cimg alt=\"Hero image\" src=\"https://github.com/user-attachments/assets/635236f6-b776-41c7-b6e5-0dd14638ecc1\" /\u003e\n\n[![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://python.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Docker Ready](https://img.shields.io/badge/Docker-Ready-blue?logo=docker)](https://github.com/leshchenko1979/fast-mcp-telegram)\n\n**Fast MCP Telegram Server** - Production-ready Telegram integration for AI assistants with comprehensive search, messaging, and direct API access capabilities.\n\n## 🌐 Demo\n\n1. Open https://tg-mcp.redevest.ru/setup to begin the authentication flow.\n2. After finishing, you'll receive a ready-to-use `mcp.json` with your Bearer token.\n3. Use the config with your MCP client to check out this MCP server capabilities.\n4. Or try the HTTP‑MTProto Bridge right away with curl (replace TOKEN):\n```bash\ncurl -X POST \"https://tg-mcp.redevest.ru/mtproto-api/messages.SendMessage\" \\\n  -H \"Authorization: Bearer TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"params\": {\"peer\": \"me\", \"message\": \"Hello from Demo!\"}}'\n```\n\n## 📖 Table of Contents\n\n- [✨ Features](#-features)\n- [🚀 Quick Start](#-quick-start)\n- [🏗️ Server Modes](#️-server-modes)\n- [🌐 HTTP-MTProto Bridge](#-http-mtproto-bridge)\n- [📚 Documentation](#-documentation)\n- [🔒 Security](#-security)\n- [🤝 Contributing](#-contributing)\n- [📄 License](#-license)\n\n## ✨ Features\n\n| Feature | Description |\n|---------|-------------|\n| 🔐 **Multi-User Authentication** | Production-ready Bearer token auth with session isolation and LRU cache management |\n| 🌐 **HTTP-MTProto Bridge** | Direct curl access to any Telegram API method with entity resolution and safety guardrails |\n| 🔍 **Intelligent Search** | Global \u0026 per-chat message search with multi-query support and intelligent deduplication |\n| 🏗️ **Dual Transport** | Seamless development (stdio) and production (HTTP) deployment support |\n| 📁 **Secure File Handling** | Rich media sharing with SSRF protection, size limits, and album support |\n| 💬 **Advanced Messaging** | Send, edit, reply with formatting, file attachments, and phone number messaging |\n| 📊 **Unified Session Management** | Single configuration system for setup and server, with multi-account support |\n| 👥 **Smart Contact Discovery** | Search users, groups, channels with uniform entity schemas and profile enrichment |\n| ⚡ **High Performance** | Async operations, parallel queries, connection pooling, and memory optimization |\n| 🛡️ **Production Reliability** | Auto-reconnect, structured logging, comprehensive error handling with clear actionable messages |\n| 🎯 **AI-Optimized** | Literal parameter constraints, LLM-friendly API design, and MCP ToolAnnotations |\n| 🌍 **Web Setup Interface** | Browser-based authentication flow with immediate config generation |\n\n## 🛠️ Available Tools\n\n| Tool | Purpose | Key Features |\n|------|---------|--------------|\n| `search_messages_globally` | Search across all chats | Multi-term queries, date filtering, chat type filtering |\n| `search_messages_in_chat` | Search within specific chat | Supports \"me\" for Saved Messages, optional query for latest messages |\n| `send_message` | Send new message | File attachments (URLs/local), formatting (markdown/html), replies |\n| `edit_message` | Edit existing message | Text formatting, preserves message structure |\n| `read_messages` | Read specific messages by ID | Batch reading, full message content with metadata |\n| `find_chats` | Find users/groups/channels | Multi-term search, contact discovery, username/phone lookup |\n| `get_chat_info` | Get detailed profile info | Member counts, bio/about, online status, enriched data |\n| `send_message_to_phone` | Message phone numbers | Auto-contact management, optional cleanup, file support |\n| `invoke_mtproto` | Direct Telegram API access | Raw MTProto methods, entity resolution, safety guardrails |\n\n**📖 For detailed tool documentation with examples, see [Tools Reference](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/Tools-Reference.md)**\n\n## 🚀 Quick Start\n\n### 1. Install from PyPI\n```bash\npip install fast-mcp-telegram\n```\n\n### 2. Authenticate with Telegram\n```bash\nfast-mcp-telegram-setup --api-id=\"your_api_id\" --api-hash=\"your_api_hash\" --phone-number=\"+123456789\"\n```\n\n**🌐 Prefer a browser?** Run the server and open `/setup` to authenticate and download a ready‑to‑use `mcp.json`. You can also reauthorize existing sessions through the same interface.\n\n### 3. Configure Your MCP Client\n\n**STDIO Mode (Development with Cursor IDE):**\n```json\n{\n  \"mcpServers\": {\n    \"telegram\": {\n      \"command\": \"fast-mcp-telegram\",\n      \"env\": {\n        \"API_ID\": \"your_api_id\",\n        \"API_HASH\": \"your_api_hash\",\n        \"PHONE_NUMBER\": \"+123456789\"\n      }\n    }\n  }\n}\n```\n\n**HTTP_AUTH Mode (Production with Bearer Token):**\n```json\n{\n  \"mcpServers\": {\n    \"telegram\": {\n      \"url\": \"https://your-server.com\",\n      \"headers\": {\n        \"Authorization\": \"Bearer AbCdEfGh123456789KLmnOpQr...\"\n      }\n    }\n  }\n}\n```\n\n### 4. Start Using!\n```json\n{\"tool\": \"search_messages_globally\", \"params\": {\"query\": \"hello\", \"limit\": 5}}\n{\"tool\": \"send_message\", \"params\": {\"chat_id\": \"me\", \"message\": \"Hello from AI!\"}}\n```\n\n**📝 For detailed installation instructions, see [Installation Guide](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/Installation.md)**\n\n## 🏗️ Server Modes\n\n| Mode | Transport | Authentication | Use Case |\n|------|----------|----------------|----------|\n| **STDIO** | stdio | Disabled | Development with Cursor IDE |\n| **HTTP_NO_AUTH** | HTTP | Disabled | Development HTTP server |\n| **HTTP_AUTH** | HTTP | Required (Bearer token) | Production deployment |\n\n## 🌐 HTTP-MTProto Bridge\n\n**Direct curl access to any Telegram API method** - Execute any Telegram MTProto method via HTTP requests with automatic entity resolution and safety guardrails.\n\n### Quick Examples\n```bash\n# Send message with automatic entity resolution\ncurl -X POST \"https://your-domain.com/mtproto-api/messages.SendMessage\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n        \"params\": {\"peer\": \"@username\", \"message\": \"Hello from curl!\"},\n        \"resolve\": true\n      }'\n\n# Send message using params_json (works with n8n and other tools)\ncurl -X POST \"https://your-domain.com/mtproto-api/messages.SendMessage\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n        \"params_json\": \"{\\\"peer\\\": \\\"@username\\\", \\\"message\\\": \\\"Hello from curl!\\\"}\",\n        \"resolve\": true\n      }'\n\n# Get message history with peer resolution\ncurl -X POST \"https://your-domain.com/mtproto-api/messages.getHistory\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n        \"params\": {\"peer\": \"me\", \"limit\": 10},\n        \"resolve\": true\n      }'\n```\n\n**📖 For complete MTProto Bridge documentation, see [MTProto Bridge Guide](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/MTProto-Bridge.md)**\n\n## 📚 Documentation\n\n- **[Installation Guide](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/Installation.md)** - Detailed installation and configuration\n- **[Deployment Guide](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/Deployment.md)** - Docker deployment and production setup\n- **[Tools Reference](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/Tools-Reference.md)** - Complete tools documentation with examples\n- **[Search Guidelines](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/Search-Guidelines.md)** - Search best practices and limitations\n- **[Operations Guide](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/Operations.md)** - Health monitoring and troubleshooting\n- **[Project Structure](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/docs/Project-Structure.md)** - Code organization and architecture\n- **[Contributing Guide](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/CONTRIBUTING.md)** - Development setup and contribution guidelines\n\n## 🔒 Security\n\n**Key Security Features:**\n- Bearer token authentication with session isolation\n- SSRF protection for file downloads\n- Dangerous method blocking with opt-in override\n- Session file security and automatic cleanup\n\n**📖 For complete security information, see [SECURITY.md](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/SECURITY.md)**\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/CONTRIBUTING.md) for:\n\n- Development setup instructions\n- Testing guidelines\n- Code quality standards\n- Pull request process\n\n**Quick Start for Contributors:**\n1. Fork the repository\n2. Read the [Contributing Guide](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/CONTRIBUTING.md)\n3. Create a feature branch\n4. Make your changes and add tests\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/leshchenko1979/fast-mcp-telegram/blob/master/LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- [FastMCP](https://github.com/jlowin/fastmcp) - MCP server framework\n- [Telethon](https://github.com/LonamiWebs/Telethon) - Telegram API library\n- [Model Context Protocol](https://modelcontextprotocol.io) - Protocol specification\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Made with ❤️ for the AI automation community**\n\n[⭐ Star us on GitHub](https://github.com/leshchenko1979/fast-mcp-telegram) • [💬 Join our community](https://t.me/mcp_telegram)\n\n\u003c/div\u003e\n\n---\n\nmcp-name: io.github.leshchenko1979/fast-mcp-telegram\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleshchenko1979%2Ffast-mcp-telegram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleshchenko1979%2Ffast-mcp-telegram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleshchenko1979%2Ffast-mcp-telegram/lists"}