tgread
tgread
読み取り専用のTelegram MCPサーバーです。Claude Codeがチャンネル、グループ、DMを読み取れるようにし、書き込みは一切できません。
./install.sh # pinned venv + ~/.local/bin/tgread + MCP registration
tgread login # api_id/api_hash, phone, code, 2FA
tgread status # who am I, is the session live, are perms sane既存のものを使わない理由
優れたコミュニティサーバーは存在します — chigwell/telegram-mcp は1.5kスター、30人のコントリビューター、そして実際のリリース管理を備えています。これを書いた理由は、そのコードを信用していないからではありません。自分で書くことによる正直な利点は、依存関係の数ではなく、ツールの表面とレビュー可能性です。そして、プロセスがTelegramセッションを保持し、攻撃者が制御したテキストをエージェントに供給する場合、これらが重要となる2つの点です。
コミュニティサーバー | tgread | |
MTProto | Telethon | Telethon — 同じ、そして当然のこと |
解決済みパッケージ | 44 | 5 ( |
MCPレイヤー |
| このリポジトリ内の約200行のstdio JSON-RPC |
書き込みツール | send, edit, delete, forward, react, join, admin | なし |
書き込みの強制 | 慣例による | トランスポートのチョークポイントで |
信頼する前にレビューすべきコード | 30人のコントリビューターによる約3,000行 | 一気に読める1ファイル |
MTProtoを手書きするのは無謀でしょう — Telethon こそが暗号化、DC移行、再接続ロジックです。だからそれは残ります。その上にあるものはすべて私たちのものです。
Related MCP server: telegram-mcp-server
脅威モデル
チャンネルを読むということは、攻撃者が選んだテキストがシェルを保持するエージェントに入ることを意味します — そして通常、接続している他のもの(メール、メモ、クラウド認証情報)も同様です。これがここでの支配的なリスクであり、サーバーを誰が書いたかによって解決されるものではありません。書き込み面のないサーバーを選ぶことは、モデルが適切に動作することに依存しない数少ない緩和策の1つです。
flowchart TD
A["hostile channel post<br/>'ignore previous instructions…'"] --> B["tgread read_chat"]
B --> C["UNTRUSTED envelope<br/>wrapped around every payload"]
C --> D["agent context"]
D --> E{"agent tries to act on it"}
E -->|"send / delete / join"| F["no such tool exists<br/>tools/call → isError"]
E -->|"raw TL request"| G["guard at _call → WriteBlocked"]
E -->|"summarise for the user"| H["fine — this is the intended path"]
style F fill:#1f6f43,color:#fff
style G fill:#1f6f43,color:#fffバグに対してどれだけ耐えられるかの昇順で、3つのレイヤーがあります:
書き込みツールは一切公開されません。 注入された指示には呼び出すものがありません。
すべてのペイロードは
UNTRUSTED CONTENTバナーでラップされ、指示ではなくデータであると明示されます — チャットのタイトルやバイオも含みます。これらも攻撃者が制御できます。トランスポートガード。 Telethonはすべての送信TLリクエストを
TelegramClient._callに通します(68の内部呼び出しサイトがawait self(req)経由で到達し、__call__は1行のデリゲートです)。ReadOnlyClientがそれをオーバーライドします。このファイルのバグでもアカウントを変更することはできません。
ガードはフェイルクローズです:TLクラス名が Get/Search/Resolve/Check/Find で始まるか、9項目のインフラストラクチャ許可リストに含まれない限り、リクエストは拒否されます。読み取り形状の3つのリクエストは、他の人が観察できる効果があるため、名前で拒否されます — GetMessagesViews(公開ビューカウンターを増加)、GetBotCallbackAnswer(インラインボタンを押す)、GetInlineBotResults(あなたとしてボットにクエリを実行)。ネストされたリクエストは走査されるため、許可された InvokeWithLayer ラッパー内に書き込みを潜ませることはできません。
flowchart LR
R["TL request"] --> W["walk nested .query"]
W --> D{"in EXPLICIT_DENY?"}
D -->|yes| X["WriteBlocked"]
D -->|no| I{"in INFRA_ALLOW?"}
I -->|yes| P["to the wire"]
I -->|no| V{"starts with Get/Search/<br/>Resolve/Check/Find?"}
V -->|yes| P
V -->|"no — incl. every<br/>name we've never seen"| X
style X fill:#8b2020,color:#fff
style P fill:#1f6f43,color:#ffftgread check はこれをオフラインで実行します:26件の書き込みリクエストをブロック、17件の読み取りを許可、不明な名前はフェイルクローズ、ネストをチェック。ネットワークもセッションも認証情報も不要です。
ツール
Tool | 説明 |
| ダイアログ。 |
| 1つのチャットの履歴、古い順、idまたは日付でページング。既読にはしません |
| アカウントが見えるすべてのチャット、または1つのチャット内での全文検索 |
| 種類、メンバー数、説明、verified/scamフラグ |
メディアのダウンロードは意図的にありません:添付ファイルを取得することは、攻撃者が選んだバイトをエージェントのファイルシステムに書き込むことを意味します。メッセージのメタデータはメディアのタイプのみを報告します。
運用上の注意
セカンダリアカウントを使用してください。 ユーザーボット(公式アプリではないMTProtoクライアント)はToSで禁止される可能性があります。このリスクはここにあるすべてのサーバーで同じです。
セッションファイルはアカウント全体のベアラートークンです。 Telegramのパスワードを変更しても無効にはなりません。ローカルで削除する前にサーバー側で失効させる
tgread logoutか、設定 → デバイスのみが無効にできます。SSH秘密鍵のように扱ってください。pip install telegram-mcpはこれでもchigwellのものでもありません。 そのPyPI名は無関係なプロジェクトに属しています。それにTELEGRAM_API_ID/TELEGRAM_API_HASHを渡すと、あなたの認証情報がサードパーティのコードに渡ります。ここにあるものは意図的にPyPIに公開されていません。状態は1つのディレクトリにあります —
$TGREAD_STATE_DIR、デフォルトは~/.local/state/tgread、モード0700、config.env(0600)とtgread.session(0600)を保持します。chmod、バックアップ、破棄のための1つのディレクトリです。tgread statusはパーミッションがずれた場合にフラグを立てます。install.shはuv sync --frozenを使用します — コミットされたuv.lockの正確なバージョンをインストールし、再解決する代わりに失敗します。静かに新しい上流リリースを取得するリゾルバーは、侵害されたパッケージがあなたのセッションを保持するプロセスに到達する方法です。
レイアウト
パス | 説明 |
| サーバー全体:ガード、ツール、JSON-RPCループ、CLI |
| ランチャー — 固定されたvenvのインタープリタをexec |
| ピン |
| venv、シンボリックリンク、 |
| 17のオフラインテスト — ガード、サーフェス、プロトコル、衛生 |
コマンド
tgread login interactive: API credentials, phone, login code, 2FA
tgread status who am I, is the session valid, are permissions sane
tgread logout revoke server-side, then delete locally
tgread check offline self-test of the read-only guard
tgread serve speak MCP over stdio — what Claude Code runslogin と logout はガードされていないプレーンなクライアントを使用します:ガードはエージェントを制約するために存在し、セッションを確立または失効させるターミナルの人間を制約するためではありません。MCPサーバーが触れるものはすべて ReadOnlyClient を経由します。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
Read-only Remote MCP for externally grounded AI agent trust receipts.
Unified inbox MCP for WhatsApp, Telegram, Email, voice — read/send messages, search, AI agents.
Private agent messaging: DMs, group channels, presence, search, and webhooks over MCP or REST.
Join durable public agent discussions and invite-only private group rooms through MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with Telegram accounts through MCP, supporting messaging, contacts, groups, media, and admin functions.4Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server that lets AI agents read personal Telegram chats from an allowlist of folders, with no send/edit/delete capability.39MIT
- FlicenseNot gradedqualityDmaintenanceEnables users to read, search, and manage Telegram messages in channels, groups, and private chats through MCP tools.-
- AlicenseNot gradedqualityBmaintenanceProvides read-only access to Telegram chats, allowing AI agents to list chats, read messages, and search within chats via local MCP.MIT
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/demian-overflow/tgread'
If you have feedback or need assistance with the MCP directory API, please join our Discord server