Telegram 客户端库与 MCP 服务器

Telegram 客户端库与 MCP 服务器

提供 Telegram 客户端库和 MCP 服务器,用于 AI 助手与 Telegram 交互。

快速入门

环境配置

  1. 创建 .env 文件并填写 Telegram API 凭证:

    TELEGRAM_API_ID=your_api_id TELEGRAM_API_HASH=your_api_hash TELEGRAM_PHONE_NUMBER=your_phone_number PORT=3000

  2. 安装依赖:

    npm install

使用 Telegram 客户端库

运行以下命令启动示例客户端:

npm run client

启动 MCP 服务器

  1. 启动服务器:

    npm start

  2. 访问地址:http://localhost:3000/mcp

  3. 测试 MCP 客户端:

    npm run mcp-client

更多详情参考 MCP-README.mdCODE_STRUCTURE.md