DM

dryeab/mcp-telegram

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

254 stars 39 forks 质量 63 趋势 18MIT

dryeab/mcp-telegram 是从 https://github.com/dryeab/mcp-telegram. 导入的 MCP 服务器候选

概览

dryeab/mcp-telegram 是从 https://github.com/dryeab/mcp-telegram. 导入的 MCP 服务器候选

概述(AI 翻译)

启用LLM来控制你的Telegram

通过模型上下文协议(MCP)将大型语言模型连接到Telegram。

该服务器由Telethon构建,允许AI代理与Telegram互动,实现发送/编辑/删除消息、搜索聊天、管理草稿、下载媒体等功能,使用MTProto实现更多功能。


  目录

  • 🚀 入门指南
  • 先决条件
  • 安装
  • ⚙️ 使用情况
  • 登录
  • 连接到MCP服务器
  • 🧰 可用工具
  • 📨 消息工具
  • 🔍 搜索与导航
  • 📝 选秀管理
  • 📂 媒体处理
  • 🛠️ 故障排除
  • 🤝 贡献
  • 📝 许可证

🚀 开始

先决条件

  • Python 3.10 或更高版本
  • uv 通过官方紫外线指南安装。

安装

安装 mcp-telegram CLI 工具:

⚙️ 用途

[!重要] 请确保您在使用本工具前已阅读并理解Telegram的服务条款。滥用该工具可能导致账户限制。

mcp-telegram 命令行工具是你的切入点。

登录

首先,使用你的Telegram账号进行认证:

该交互式命令将提示您执行:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Connect Large Language Models to Telegram via the Model Context Protocol (MCP).

Built with Telethon, this server allows AI agents to interact with Telegram, enabling features like sending/editing/deleting messages, searching chats, managing drafts, downloading media, and more using the MTProto.



🚀 Getting Started

Prerequisites

Installation

Install the mcp-telegram CLI tool:

uv tool install mcp-telegram

⚙️ Usage

[!IMPORTANT] Please ensure you have read and understood Telegram’s ToS before using this tool. Misuse of this tool may result in account restrictions.

The mcp-telegram command-line tool is your entry point.

mcp-telegram --help # See all commands

Login

First, authenticate with your Telegram account:

mcp-telegram login

This interactive command will prompt you for:

  • API ID & API Hash: Obtain these from my.telegram.org/apps.
  • Phone Number: Your Telegram-registered phone number (international format, e.g., +1234567890).
  • Verification Code: Sent to your Telegram account upon first login.
  • 2FA Password: If you have Two-Factor Authentication enabled.

Your credentials are securely stored in the session file for future use.

[!WARNING] Keep your API credentials private and never share them publicly

[!NOTE]

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-telegram": { "command": "mcp-telegram" /* Use full path if client can't find the command (e.g. "/usr/local/bin/mcp-telegram"). See IMPORTANT section below for full path instructions. */, "args": ["start"], "env": { "API_ID": "<your_api_id>", "API_HASH": "<your_api_hash>" } } } }