mcpField
T
Telegram MCP Server

Telegram MCP Server

ローカル
github.com/MobileVibeコミュニケーション456 週間前に更新

Telegram MCP Server について

Telegram MCP Serverは、LLMから指定したTelegramチャットへ通知を送り、ユーザーの返信を受け取るMCPサーバーです。緊急度の設定や返信確認に対応し、非同期のやり取りが必要なアプリケーション向けです。

主な機能

  1. 01Telegramチャットへのテキスト通知
  2. 02通知の緊急度設定
  3. 03ユーザー返信の待機と取得

活用シーン

  1. 01プロジェクトやタスクの進捗通知
  2. 02ユーザー確認の依頼と返信確認

MCP 対応

MCPクライアント向けに、Telegram通知の送信と返信確認のツールを公開します。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

インストール方法は未掲載です

このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。

リポジトリ

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

Telegram MCP サーバー

LLM が Telegram 経由で通知を送信し、ユーザーからの応答を受け取れるようにする Model Context Protocol(MCP)サーバーです。

機能

  • 緊急度をカスタマイズして、Telegram チャットにテキスト通知を送信します
  • ユーザーからの応答を待ち、取得します
  • Cline やその他の MCP 対応 LLM アプリケーションと連携します

前提条件

  • Node.js 16 以降
  • Telegram ボットトークン(@BotFather から取得)
  • Telegram チャット ID

インストール

npm から(推奨)
npm install -g telegram-mcp
GitHub から
git clone https://github.com/CHarrisTech/telegram-mcp.git
cd telegram-mcp
npm install
npm run build

設定

サーバーには次の 2 つの環境変数が必要です。

  • TELEGRAM_BOT_TOKEN:Telegram ボットトークン
  • TELEGRAM_CHAT_ID:Telegram チャット ID
Telegram ボットトークンの取得
  1. Telegram で @BotFather とのチャットを開始します
  2. コマンド /newbot を送信します
  3. 新しいボットを作成するための手順に従います
  4. BotFather が新しいボットのトークンを発行します
チャット ID の確認
  1. 新しいボットとのチャットを開始します
  2. ボットにメッセージを送信します
  3. https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates にアクセスします
  4. 応答内の chat オブジェクトを探し、id フィールドを確認します

使用方法

単独で実行する
# Set environment variables
export TELEGRAM_BOT_TOKEN="your_bot_token"
export TELEGRAM_CHAT_ID="your_chat_id"

# Run the server
telegram-mcp
Cline との連携

以下を Cline の MCP 設定ファイルに追加します。

{
  "mcpServers": {
    "telegram-mcp": {
      "command": "node",
      "args": ["path/to/telegram-mcp/build/index.js"],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your_bot_token",
        "TELEGRAM_CHAT_ID": "your_chat_id"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}
Claude Desktop との連携

以下を Claude Desktop の設定ファイルに追加します。

{
  "mcpServers": {
    "telegram-mcp": {
      "command": "node",
      "args": ["path/to/telegram-mcp/build/index.js"],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your_bot_token",
        "TELEGRAM_CHAT_ID": "your_chat_id"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

利用可能なツール

send_notification

設定済みの Telegram チャットに通知メッセージを送信します。

パラメーター:

  • message(必須):ユーザーに送信するメッセージ
  • project(必須):LLM が作業しているプロジェクトの名前
  • urgency(任意):緊急度(「low」、「medium」、または「high」)
check_notification_response

以前に送信した通知にユーザーが応答したかどうかを確認します。

パラメーター:

  • message_id(必須):応答を確認するメッセージの ID
  • timeout_seconds(任意):応答を諦めるまで待機する時間(デフォルト:30)

開発

# Clone the repository
git clone https://github.com/CHarrisTech/telegram-mcp.git
cd telegram-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Watch for changes during development
npm run watch

# Test with the MCP Inspector
npm run inspector
ローカルでのテスト

このリポジトリには、サーバーをローカルでテストするためのスクリプトが含まれています。

Windows
# Set environment variables
set TELEGRAM_BOT_TOKEN=your_bot_token
set TELEGRAM_CHAT_ID=your_chat_id

# Run the test script
test-server.bat
macOS/Linux
# Set environment variables
export TELEGRAM_BOT_TOKEN=your_bot_token
export TELEGRAM_CHAT_ID=your_chat_id

# Make the script executable (first time only)
chmod +x test-server.sh

# Run the test script
./test-server.sh

例

examples ディレクトリには、Telegram MCP サーバーの使い方を示すサンプルコードが含まれています。

  • programmatic-usage.js:Node.js アプリケーション内でサーバーをプログラムから使用する方法を示します

例を実行するには:

# Set required environment variables
export TELEGRAM_BOT_TOKEN="your_bot_token"
export TELEGRAM_CHAT_ID="your_chat_id"

# Run the example
node examples/programmatic-usage.js

ライセンス

MIT

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。