telegram-mcp

by chaindead
Verified
MIT License
27
  • Apple
  • Linux

hybrid server

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

Integrations

  • Provides a bridge to the Telegram API, allowing retrieval of user data, listing of dialogs (chats, channels, groups), and access to messages within those dialogs.

Telegram MCP サーバー

サーバーは、Telegram API と AI アシスタント間のブリッジであり、モデルコンテキストプロトコルに基づいています。

[!重要] このサーバーをご利用になる前に、 Telegram APIの利用規約を必ずお読みください。Telegram APIを不正に使用した場合、アカウントが停止される可能性があります。

目次

MCPとは何ですか?

モデルコンテキストプロトコル(MCP)は、Claude DesktopやCursorなどのAIアプリが外部ツールやデータソースに接続できるようにするシステムです。これにより、AIアシスタントはユーザーの制御を維持しながら、ローカルサービスやAPIを明確かつ安全に操作できるようになります。

このサーバーは何をしますか?

機能

  • [x] 現在のアカウント情報を取得する( tool: tg_me
  • [x] オプションの未読フィルター付きのダイアログを一覧表示する( tool: tg_dialogs
  • [x] ダイアログを既読にする ( tool: tg_read )
  • [x] 特定のダイアログからメッセージを取得する ( tool: tg_dialog )
  • [x] 下書きメッセージを任意のダイアログに送信する ( tool: tg_send )

プロンプトの例

AI アシスタントで使用できるプロンプトの例を次に示します。

メッセージ管理

  • 「Telegramに未読の重要なメッセージがないか確認してください」
  • 「未読のTelegramメッセージをすべて要約する」
  • 「未読メッセージを読んで分析し、必要に応じて返信の下書きを準備する」
  • 「重要でない未読メッセージを確認し、簡単な概要を教えてください」

組織

  • 「Telegramのダイアログを分析してフォルダ構造を提案してください」
  • 「Telegramのチャットを重要度別に分類するのを手伝ってください」
  • 「仕事関連の会話をすべて見つけて、整理する方法を提案します」

コミュニケーション

  • [トピック]に関する最新情報については特定のチャットを監視する」
  • [チャット]の最後のメッセージに対する丁寧な返信を作成してください」
  • 「チャットに未回答の質問がないか確認してください」

インストール

自家製ビール

brew を使用して macOS/Linux にバイナリリリースをインストールできます。

# Install brew install chaindead/tap/telegram-mcp # Update brew upgrade chaindead/tap/telegram-mcp

NPX

npx を使用して最新バージョンを直接実行できます (macOS、Linux、Windows をサポート)。

npx -y @chaindead/telegram-mcp

NPX を使用する場合は、標準のコマンドと構成を次のように変更します。

npx -y @chaindead/telegram-mcp auth ...
{ "mcpServers": { "telegram": { "command": "npx", "args": ["-y", "@chaindead/telegram-mcp"], "env": { "TG_APP_ID": "<your-api-id>", "TG_API_HASH": "<your-api-hash>" } } } }

完全なセットアップ手順については、 「承認クライアント構成」を参照してください。

リリースから

macOS

**注:**以下のコマンドは/usr/local/binにインストールされます。他の場所にインストールする場合は、 /usr/local/bin PATH 内の任意のディレクトリに置き換えてください。

まず、アーキテクチャ用のアーカイブをダウンロードします。

# For Intel Mac (x86_64) curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Darwin_x86_64.tar.gz # For Apple Silicon (M1/M2) curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Darwin_arm64.tar.gz

次にバイナリをインストールします。

# Extract the binary sudo tar xzf telegram-mcp.tar.gz -C /usr/local/bin # Make it executable sudo chmod +x /usr/local/bin/telegram-mcp # Clean up rm telegram-mcp.tar.gz

リナックス

**注:**以下のコマンドは/usr/local/binにインストールされます。他の場所にインストールする場合は、 /usr/local/bin PATH 内の任意のディレクトリに置き換えてください。

まず、アーキテクチャ用のアーカイブをダウンロードします。

# For x86_64 (64-bit) curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Linux_x86_64.tar.gz # For ARM64 curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Linux_arm64.tar.gz

次にバイナリをインストールします。

# Extract the binary sudo tar xzf telegram-mcp.tar.gz -C /usr/local/bin # Make it executable sudo chmod +x /usr/local/bin/telegram-mcp # Clean up rm telegram-mcp.tar.gz

ウィンドウズ

ウィンドウズ

  1. ご使用のアーキテクチャの最新リリースをダウンロードしてください。
  2. .zipファイルを解凍する
  3. 抽出したディレクトリをPATHに追加するか、 telegram-mcp.exe PATH内のディレクトリに移動します。

ソースから

要件:

  • Go 1.24以降
  • PATHのGOBIN
go install github.com/chaindead/telegram-mcp@latest

構成

承認

サーバーを使用する前に、Telegram API に接続する必要があります。

  1. Telegram APIからAPI IDとハッシュを取得する
  2. 次のコマンドを実行します。

    注: 2FA が有効になっている場合は、 --password <2fa_password> を追加してください。

    **注:**既存のセッションを上書きする場合は、--new を追加してください。

    telegram-mcp auth --app-id <your-api-id> --api-hash <your-api-hash> --phone <your-phone-number>
    📩 Telegram から受け取ったコードを入力して API に接続します。
  3. 完了しました!このプロジェクトの開発をサポートするために、⭐️ を付けてください。

クライアント構成

Claude Desktop を Telegram MCP サーバーを認識するように構成する例。

  1. Claude Desktop 構成ファイルを開きます。
    • MacOSでは、設定ファイルは~/Library/Application Support/Claude/claude_desktop_config.jsonにあります。
    • Windowsでは、構成ファイルは%APPDATA%\Claude\claude_desktop_config.jsonにあります。

    注: claude_desktop_config.json は Claude Desktop アプリの設定内にもあります。

  2. サーバー構成を追加するクロードデスクトップの場合:
    { "mcpServers": { "telegram": { "command": "telegram-mcp", "env": { "TG_APP_ID": "<your-app-id>", "TG_API_HASH": "<your-api-hash>", "PATH": "<path_to_telegram-mcp_binary_dir>", "HOME": "<path_to_your_home_directory" } } } }
    カーソルの場合:
    { "mcpServers": { "telegram-mcp": { "command": "telegram-mcp", "env": { "TG_APP_ID": "<your-app-id>", "TG_API_HASH": "<your-api-hash>" } } } }

スターの歴史

-
security - not tested
A
license - permissive license
-
quality - not tested

ユーザー データへのアクセス、ダイアログ (チャット、チャンネル、グループ) の管理、メッセージの取得、既読ステータスの処理を行う Telegram API 統合。

  1. Table of Contents
    1. What is MCP?
      1. What does this server do?
        1. Capabilities
        2. Prompt examples
      2. Installation
        1. Homebrew
        2. NPX
        3. From Releases
        4. From Source
      3. Configuration
        1. Authorization
        2. Client Configuration
      4. Star History
        ID: evp8xtmfsy