Telegram MCP
Telegram MCP — AIエージェント向けローカル読み取り専用アクセス
ローカルMCPサーバーは、Codex、Claude、その他のMCPクライアントに3つのツールを提供します:
ツール | 説明 |
| チャットの一覧と未読数 |
| 選択したチャットの最近のメッセージ |
| 選択したチャット内のテキストを検索 |
サーバーは読み取り専用でのみ動作します。コードにはメッセージの送信、編集、削除ツールはありません。サーバーはSTDIO経由でローカルに起動し、意図的にネットワークHTTP/SSEアクセスを提供しません。
対応クライアント
ChatGPT/Codex Desktop;
Codex CLI および IDE extension;
Claude Code;
Claude Desktop;
STDIOをサポートする任意のローカルMCPクライアント。
ローカルサーバーは chatgpt.com、claude.ai、携帯電話、その他のコンピューターでは直接動作しません。これらの環境では、お使いのマシン上でプロセスを起動できないためです。
Related MCP server: tdl-mcp
必要なもの
Windows 10/11、macOS、または Linux;
Git;
サポートされているMCPクライアントが少なくとも1つ。
初心者向けインストール
1. ターミナルを開く
macOS:
Command + Space→Terminalと入力 → Enter。Windows: スタートメニュー →
PowerShellと入力 → PowerShell を開きます。Linux:
Ctrl + Alt + Tを押すか、ターミナルアプリを開きます。
2. プロジェクトをダウンロード
macOS/Linux:
git clone https://github.com/iamalexzatcepin/telegram-mcp-template.git ~/telegram-mcp
cd ~/telegram-mcpWindows PowerShell:
git clone https://github.com/iamalexzatcepin/telegram-mcp-template.git "$env:USERPROFILE\telegram-mcp"
cd "$env:USERPROFILE\telegram-mcp"GitHub がリポジトリが見つからないと報告する場合、お使いのアカウントにプライベートリポジトリへのアクセス権がまだありません。
3. Telegram API ID と API Hash を取得
my.telegram.org を開きます。
電話番号でログインします。
API development tools を開きます。
アプリケーションを作成します(例:
Local Telegram MCP)。api_idとapi_hashを保存します。
api_hash、ログインコード、クラウドパスワードをAIチャットに送信しないでください。
ローカルの .env を作成します。
macOS/Linux:
cp .env.example .env
nano .envNano での保存: Ctrl + O → Enter → Ctrl + X。
Windows PowerShell:
Copy-Item .env.example .env
notepad .envファイルをローカルで記入します:
TELEGRAM_API_ID=ваш_api_id
TELEGRAM_API_HASH=ваш_api_hash4. 依存関係をインストールして Telegram にログイン
macOS/Linux:
bash setup.shWindows PowerShell:
powershell -ExecutionPolicy Bypass -File setup.ps1スクリプトが Python 3.10+ を自動的に見つけ、.venv を作成し、依存関係をインストールして、電話番号、Telegram のコード、有効になっている場合はクラウドパスワードを要求します。これらは自分のターミナルにのみ入力してください。
エージェントへの接続
すべての例で、セットアップスクリプトが出力する絶対パスを使用してください。コマンドは .venv 内の Python で、引数は telegram_mcp_server.py です。
Codex CLI と ChatGPT/Codex Desktop
macOS/Linux:
codex mcp add telegram -- "$HOME/telegram-mcp/.venv/bin/python" "$HOME/telegram-mcp/telegram_mcp_server.py"
codex mcp get telegramWindows PowerShell:
codex mcp add telegram -- "$env:USERPROFILE\telegram-mcp\.venv\Scripts\python.exe" "$env:USERPROFILE\telegram-mcp\telegram_mcp_server.py"
codex mcp get telegramChatGPT/Codex Desktop では、Settings → MCP servers → Add server を開き、STDIO を選択して、同じ Command と Arguments を指定することもできます。保存後、Restart をクリックします。同じ Codex ホストのローカルクライアントは、~/.codex/config.toml 設定を共有します。
Claude Code
macOS/Linux:
claude mcp add --transport stdio --scope user telegram -- "$HOME/telegram-mcp/.venv/bin/python" "$HOME/telegram-mcp/telegram_mcp_server.py"
claude mcp get telegramWindows PowerShell:
claude mcp add --transport stdio --scope user telegram -- "$env:USERPROFILE\telegram-mcp\.venv\Scripts\python.exe" "$env:USERPROFILE\telegram-mcp\telegram_mcp_server.py"
claude mcp get telegram新しい Claude Code セッションを開始し、/mcp と入力します。user スコープにより、そのユーザーのさまざまなローカルプロジェクトでサーバーを利用できるようになります。
Claude Desktop
Developer/MCP 設定を開き、ローカル STDIO サーバーを追加します。お使いの Claude Desktop のバージョンが JSON 設定を使用している場合は、他のサーバーを保持したままオブジェクトを追加します:
{
"mcpServers": {
"telegram": {
"command": "/absolute/path/to/telegram-mcp/.venv/bin/python",
"args": ["/absolute/path/to/telegram-mcp/telegram_mcp_server.py"]
}
}
}ファイルの一般的な場所:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json;Windows:
%APPDATA%\Claude\claude_desktop_config.json。
Claude Desktop を完全に再起動し、新しいチャットを開きます。
その他の STDIO MCP クライアント
同等の設定を使用します:
{
"mcpServers": {
"telegram": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["/absolute/path/to/telegram_mcp_server.py"]
}
}
}最終確認
エージェントに依頼します:
telegram の
list_chatsを limit=10 で使用し、名前、タイプ、未読メッセージの数を表示してください。
エージェントが実際にチャットのリストを返すまで、インストールは完了と見なさないでください。
複数アカウント
サーバーは default、work、personal などの個別のローカルセッションをサポートしています。手順は docs/MULTI_ACCOUNT.md にあります。
AIエージェント向け手順
Codex、Claude、または別のエージェントがインストールを実行する場合は、docs/AGENT_SETUP.md を完全に読み、それに従うように依頼してください。このファイルには、セキュリティルールとさまざまな OS 向けの分岐が記載されています。
セキュリティと制限
.envとsessions/は Git から除外されています。.sessionファイルはアカウントへのアクセスを許可します。コピーしたり公開したりしないでください。メディアファイルはダウンロードされず、
has_mediaフラグのみが返されます。Telegram へのリクエストはお使いのアカウントの代わりに実行され、Telegram の制限に従います。
同じ
.sessionで 2 つの操作を同時に実行しないでください。このサーバーをインターネットに公開しないでください。
詳細: SECURITY.md。
うまくいかない場合
docs/TROUBLESHOOTING.md を参照してください。
開発
.venv/bin/python -m unittest discover -s tests -vプロジェクト構成:
ファイル | 説明 |
| 3つの読み取り専用MCPツール、STDIOのみ |
| Telethon の設定とローカルセッションの読み込み |
| 名前付きセッションへのログインと作成 |
| macOS/Linux へのインストール |
| Windows へのインストール |
| AIエージェント向けのステップバイステップ手順 |
| 複数アカウントの接続 |
| 一般的な問題の診断 |
ライセンス
MIT — 著作権表示とライセンス文を保持する限り、プロジェクトの使用、変更、再配布が可能です。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with Telegram accounts through MCP, supporting messaging, contacts, groups, media, and admin functions.4Apache 2.0
- AlicenseAqualityCmaintenanceRead-only Telegram access for Claude and other MCP hosts. Provides tools to list chats, read recent messages, and download media from your own Telegram account without needing an api_id/api_hash.5MIT
- AlicenseNot gradedqualityCmaintenanceA read-only MCP server that lets AI agents read personal Telegram chats from an allowlist of folders, with no send/edit/delete capability.35MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with a user's Telegram account: list chats, read history, search, and send messages through Telegram's MTProto API.1MIT
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Read-only Remote MCP for externally grounded AI agent trust receipts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/iamalexzatcepin/telegram-mcp-template'
If you have feedback or need assistance with the MCP directory API, please join our Discord server