telegram-mcp
telegram-mcp
mtcuteを使用してTelegramと対話するためのModel Context Protocol (MCP) サーバーです。
機能
チャットへのテキストメッセージ送信
特定のチャットでの受信メッセージ待機
チャットからのメッセージ読み取り
メッセージ検索
ダイアログ(チャット)の一覧表示および情報取得
すべてのチャットにわたる最近のメッセージの取得
アカウントおよびチャンネルの絵文字ステータスIDの設定と確認
Related MCP server: io.github.daedalus/mcp-telegram-bot
セットアップ
インストール
オプション1: ビルド済みバイナリのダウンロード
リリースページから、お使いのプラットフォーム向けの最新リリースをダウンロードしてください:
macOS (Apple Silicon):
telegram-mcp-darwin-arm64.tar.gzmacOS (Intel):
telegram-mcp-darwin-x64.tar.gzLinux:
telegram-mcp-linux-x64.tar.gzWindows:
telegram-mcp-win-x64.exe.zip
アーカイブを解凍し、バイナリを実行可能にします(Unixシステムの場合):
tar -xzf telegram-mcp-*.tar.gz
chmod +x telegram-mcpオプション2: ソースからのビルド
リポジトリをクローンし、依存関係をインストールします:
git clone git@github.com:zhigang1992/telegram-mcp.git
cd telegram-mcp
bun install実行ファイルをビルドします:
bun run build初期設定(初回のみ)
https://my.telegram.org からTelegram API認証情報を取得します。
初期設定を実行してTelegramで認証します:
export API_ID=your_api_id
export API_HASH=your_api_hash
./telegram-mcpサーバーは以下の動作を行います:
電話番号の入力を求めます
Telegram経由で認証コードを送信します
認証コードの入力を求めます
絶対ストレージパスを表示します(MCP設定で必要になります)
出力に表示されたストレージパスを控えておいてください。以下のような形式になります:
Storage path: /Users/username/telegram-mcp/bot-data/session使用方法
MCPサーバーとして
初期設定で取得したストレージパスを使用して、Claude Desktopの設定に追加します:
{
"mcpServers": {
"telegram": {
"command": "/path/to/telegram-mcp",
"env": {
"API_ID": "your_api_id",
"API_HASH": "your_api_hash",
"TELEGRAM_STORAGE_PATH": "/absolute/path/from/initial/setup"
}
}
}
}重要: TELEGRAM_STORAGE_PATH は、初期設定時に表示された絶対パスである必要があります。これにより、MCPサーバーが認証済みセッションを使用できるようになります。
利用可能なツール
メッセージツール
messages_sendText- チャットにテキストメッセージを送信するchatId(必須): チャット/ユーザーIDまたはユーザー名text(必須): 送信するメッセージテキストreplyToMessageId: 返信先のメッセージID(オプション)
messages_getHistory- チャットからメッセージ履歴を取得するchatId(必須): チャット/ユーザーIDまたはユーザー名limit: メッセージ数(デフォルト: 100, 最大: 100)offsetId: ページネーション用のメッセージID
messages_search- メッセージを検索するquery(必須): 検索クエリchatId: 検索対象の特定のチャット(オプション)limit: 結果の数(デフォルト: 50)
messages_getRecent- すべてのチャットから最近のメッセージを取得するlimit: チャット数(デフォルト: 10)messagesPerChat: チャットごとのメッセージ数(デフォルト: 10)
インタラクティブツール
wait_for_reply- チャット内の次のメッセージを待機するchatId(必須): メッセージを待機するチャット/ユーザーIDまたはユーザー名timeoutSeconds: タイムアウト(秒)(デフォルト: 60, 最大: 300)
ステータスツール
status_getCurrent- ピアの現在の絵文字ステータスを取得するpeerId: 対象のピア、デフォルトはself
status_setEmoji- 絵文字ステータスを設定またはクリアするpeerId: 対象のピア、デフォルトはselfemojiId: カスタム絵文字ドキュメントID(clear=trueでない限り必須)isCollectible:emojiIdが収集可能IDである場合にtrueに設定until: ISO-8601タイムスタンプまたはUnixタイムスタンプ文字列(オプション)clear: ステータスを設定する代わりに現在のステータスをクリアする
status_listAvailable- 利用可能なデフォルトの絵文字ステータスIDを一覧表示するscope:selfまたはchannel(デフォルト:self)limit: 返すIDの最大数(デフォルト: 100)
status_listCollectibles- 自己絵文字ステータスとして使用可能な所有中の収集可能IDを一覧表示するowner: 確認するピア、デフォルトはselflimit: 返す収集可能アイテムの最大数(デフォルト: 100)
ダイアログツール
dialogs_list- すべてのダイアログを一覧表示するlimit: ダイアログの最大数(デフォルト: 50)filter: フィルタオプション(onlyUsers, onlyGroups, onlyChannels)
dialogs_getInfo- 詳細なダイアログ情報を取得するchatId(必須): チャット/ユーザーIDまたはユーザー名
開発
開発モードで実行:
bun run devサーバーはセッションデータを bot-data/ ディレクトリに保存します。
This server cannot be deployed
Maintenance
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Unofficial Telegram MCP server — read, search, reply and react in your own Telegram account.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- FlicenseBqualityDmaintenanceAn MCP server that enables interaction with Telegram messaging platform, allowing users to retrieve unread messages, fetch entity information, and send messages through natural language interfaces.610-
- AlicenseAqualityCmaintenanceMCP server that exposes a Telegram bot, enabling sending messages and retrieving updates through natural language.31MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for sending and receiving Telegram messages via a bot, enabling AI assistants to interact directly through Telegram by sending messages, reading recent messages, and sending photos.39 npmMIT
- FlicenseNot gradedqualityCmaintenanceMCP server that enables interaction with the Telegram Bot API, allowing users to send messages, retrieve updates, and access chat information through natural language.-