MCP-Communicator-Telegram

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Allows communication with users through Telegram. Provides tools to ask questions, send notifications, share files, and create project archives via a Telegram bot.

MCP コミュニケーター(テレグラム)

Telegramを通じてユーザーとのコミュニケーションを可能にするMCPサーバー。このサーバーは、質問、通知の送信、ファイルの共有、プロジェクトアーカイブの作成など、Telegramボットを介してユーザーとやり取りするためのツールを提供します。

インストール

npm経由(グローバル)

npm install -g mcp-communicator-telegram

npx経由(オンデマンド)

npx mcptelegram

Telegram チャット ID を取得するには:

npx mcptelegram-chatid

特徴

  • Telegramを通じてユーザーに質問する
  • ユーザーに通知を送信する(応答は不要)
  • Telegram経由でユーザーにファイルを送信する
  • プロジェクトの zip ファイルを作成して送信します (.gitignore を尊重)
  • 応答を非同期的に受信する(応答を無期限に待機する)
  • 返信ベースのメッセージ追跡のサポート
  • 安全なチャットID検証
  • エラー処理とログ記録

前提条件

  • Node.js (v14以上)
  • Telegram ボット トークン ( @BotFatherから取得)
  • Telegram チャット ID (付属のユーティリティを使用して取得できます)

インストール

  1. リポジトリをクローンします。
git clone https://github.com/qpd-v/mcp-communicator-telegram.git cd mcp-communicator-telegram
  1. 依存関係をインストールします:
npm install
  1. Telegram ボットを作成します:
    • Telegramを開いて@BotFatherを検索します
    • /newbotを送信し、指示に従ってください
    • 受け取ったボットトークンを保存する
  2. チャットIDを取得します:
    • .env.example.envにコピーする
    • ボット トークンを.envファイルに追加します。
      TELEGRAM_TOKEN=your_bot_token_here
    • チャット ID ユーティリティを実行します。
      npm run build node build/get-chat-id.js
    • ボットにメッセージを送信する
    • コンソールに表示されるチャットIDをコピーします
    • チャット ID を.envファイルに追加します。
      TELEGRAM_TOKEN=your_bot_token_here CHAT_ID=your_chat_id_here

構成

サーバーを MCP 設定ファイル (通常、Windows では%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.jsonにあります) に追加します。

{ "mcpServers": { "mcp-communicator-telegram": { "command": "node", "args": ["path/to/mcp-communicator-telegram/build/index.js"], "env": { "TELEGRAM_TOKEN": "your_bot_token_here", "CHAT_ID": "your_chat_id_here" } } } }

利用可能なツール

ask_user

Telegram 経由でユーザーに質問し、返答を待ちます。

入力スキーマ:

{ "type": "object", "properties": { "question": { "type": "string", "description": "The question to ask the user" } }, "required": ["question"] }

使用例:

const response = await use_mcp_tool({ server_name: "mcp-communicator-telegram", tool_name: "ask_user", arguments: { question: "What is your favorite color?" } });

通知ユーザー

Telegram 経由でユーザーに通知メッセージを送信します (応答は不要です)。

入力スキーマ:

{ "type": "object", "properties": { "message": { "type": "string", "description": "The message to send to the user" } }, "required": ["message"] }

使用例:

await use_mcp_tool({ server_name: "mcp-communicator-telegram", tool_name: "notify_user", arguments: { message: "Task completed successfully!" } });

ファイル送信

Telegram 経由でユーザーにファイルを送信します。

入力スキーマ:

{ "type": "object", "properties": { "filePath": { "type": "string", "description": "The path to the file to send" } }, "required": ["filePath"] }

使用例:

await use_mcp_tool({ server_name: "mcp-communicator-telegram", tool_name: "send_file", arguments: { filePath: "path/to/file.txt" } });

zip_プロジェクト

プロジェクト ディレクトリの zip ファイル (.gitignore パターンを尊重) を作成し、Telegram 経由でユーザーに送信します。

入力スキーマ:

{ "type": "object", "properties": { "directory": { "type": "string", "description": "Directory to zip (defaults to current working directory)" } }, "required": [] }

デフォルトディレクトリ(現在の作業ディレクトリ)での使用例:

await use_mcp_tool({ server_name: "mcp-communicator-telegram", tool_name: "zip_project", arguments: {} });

特定のディレクトリでの使用例:

await use_mcp_tool({ server_name: "mcp-communicator-telegram", tool_name: "zip_project", arguments: { directory: "/path/to/your/project" } });

特徴:

  • ディレクトリ名に基づいて[project-name]-project.zipという名前のzipファイルを作成します。
  • 指定したディレクトリまたは現在の作業ディレクトリを圧縮できます
  • .gitignore パターンを尊重
  • アーカイブ内の正しいファイルパスを維持する
  • 送信後にZIPファイルを自動的にクリーンアップします
  • 最大2GBのファイルを処理します

発達

プロジェクトをビルドします。

npm run build

開発モードで実行:

npm run dev

変更に注意してください:

npm run watch

クリーンビルドディレクトリ:

npm run clean

安全

  • サーバーは設定されたチャットIDからのメッセージにのみ応答します
  • 環境変数は機密性の高い設定に使用されます
  • メッセージIDは質問と回答のペアを追跡するために使用されます
  • ボットは適切な文脈のないメッセージを無視します

ライセンス

ISC

著者

qpd-v

バージョン

0.2.1 # 新機能のメジャーバージョンアップ:notify_user、send_file、zip_project ツール

-
security - not tested
F
license - not found
-
quality - not tested

Telegramを通じてユーザーとのコミュニケーションを可能にするMCPサーバー。このサーバーは、ユーザーに質問し、Telegramボットを介して回答を受け取るためのツールを提供します。

  1. Installation
    1. Via npm (global)
    2. Via npx (on-demand)
  2. Features
    1. Prerequisites
      1. Installation
        1. Configuration
          1. Available Tools
            1. ask_user
            2. notify_user
            3. send_file
            4. zip_project
          2. Development
            1. Security
              1. License
                1. Author
                  1. Version
                    ID: cvt5yz29og