codebuddy-matrix-channel
codebuddy-matrix-channel
Matrix チャットを CodeBuddy Code のローカルセッションにブリッジする Channel プラグイン(MCP サーバー)。
効果は CodeBuddy 内蔵の Telegram / Discord / 微信 channel と同等です:
Matrix ルームでメッセージを送信 →
#matrix · @alice:matrix.org: こんにちはの形式で CodeBuddy セッションに表示されますCodeBuddy の返信は
replyツール経由で Matrix ルームに送り返されますオプション:CodeBuddy の権限リクエスト通知を「コントロールルーム」に転送し、スマホでツール呼び出しを承認/拒否できます
本プラグインは CodeBuddy の Channel 拡張メカニズム(docs/cn/cli/channels.md と channels-reference.md を参照)に基づいており、CodeBuddy 本体の変更は不要です。
1. 動作原理
Matrix 房间 ──(matrix-js-sdk 收消息)──▶ matrix-channel (本插件)
│ notifications/claude/channel
▼
CodeBuddy Code 会话
│ reply 工具 / 权限请求
▼
matrix-channel ──(sendText)──▶ Matrix 房间プラグインは子プロセスとして CodeBuddy から stdio で起動され、MCP プロトコルで通信します。
Related MCP server: mcacp
2. インストール
cd matrix-channel
npm install
npm run build # 编译到 dist/(也可直接用 tsx 运行,无需构建)実行時には Node >= 20 が必要です。
2.1 クイックスタート(デジタルアバター)
インストール / ビルド
cd matrix-channel && npm install && npm run build.envを記入(最小構成、詳細は第 3 節)MATRIX_HOMESERVER=https://im.yiq.pub MATRIX_ACCESS_TOKEN=<从 Element:设置 → 帮助 → 高级 → 访问令牌 复制> MATRIX_USER_ID=@evlon-ai:im.yiq.pub MATRIX_ALLOWLIST=@evlon:im.yiq.pub # 防 prompt 注入,必填 MATRIX_OWNER_ID=@evlon:im.yiq.pub # 分身管理者=你,审批权只认此身份 MATRIX_CONTROL_ROOM_ID=!<控制室房间ID>:im.yiq.pub MATRIX_MENTION_REQUIRED=true # 群里只响应 @分身 # 可选:MATRIX_TRUSTED_SENDERS / MATRIX_TRUSTED_ROOMS / MATRIX_AUTHORIZED_WORKセルフチェック(
.envを変更するたびに最初に実行)npm run doctor # 期望:连接 ✅、账号 ✅、E2EE ✅CodeBuddy に接続:プロジェクトの
.mcp.jsonに登録(絶対パス)して起動codebuddy --channels server:matrix --dangerously-load-development-channels日常利用
グループで @アバター に仕事を依頼 → 信頼できる送信元/承認済みの作業は自動実行;未知の作業は先に計画を出し、コントロールルームで
approveを待ちます。高リスクツール(Bash/ファイル書き込みなど)は常にコントロールルームで承認を求めます。
コントロールルームでのコマンド(
MATRIX_OWNER_IDのみ有効):approve(run/go、ルーム ID を指定可)→ そのルームのタスクを承認yes <id>/no <id>→ 待機中の高リスク権限リクエストを許可 / 拒否
暗号化グループには
MATRIX_E2EE=trueが必要です;MATRIX_DEVICE_IDを空にすると/devicesから自動選択され、エラーが出たら「設定 → デバイス」のデバイス ID を入力してください。
3. 設定
.env.example を .env にコピーして記入します:
cp .env.example .env変数 | 説明 |
| ホームサーバーアドレス、例: |
| アカウントの access_token(推奨;Element の「設定 → ヘルプ」からコピー) |
| 任意。「自分のメッセージ」を識別するために使用、例: |
| 代替認証方式。起動時に |
| メッセージ送信を許可する送信者のユーザー ID、カンマ区切り(必ず設定) |
| リッスンするルーム ID、カンマ区切り(空 = すべて) |
| 権限中継コントロールルームのルーム ID(任意。ただしデジタルアバターモードでは必須) |
| アバター管理者(owner)の Matrix ユーザー ID(必須)。承認権限はこの ID のみ有効 |
| 信頼できる同僚のユーザー ID、カンマ区切り。彼らからの作業は自動実行(安全なツール) |
| 信頼できるグループ ID、カンマ区切り。これらのルーム内のすべての作業は自動実行 |
| 承認済みの通常作業の説明(自由テキスト)。アバターが「よくある作業 vs 未知の作業」を判断するために使用 |
| グループ内で @ メンションされたメッセージのみに応答するか(デフォルト true;複数アバター共存時は有効推奨) |
| 高リスクツールのリスト、カンマ区切り。デフォルト |
| 画像/ファイルをローカルにダウンロードし |
| メディアのダウンロードディレクトリ(デフォルト |
| エンドツーエンド暗号化を有効にするか(デフォルト false、下記第 6 節参照) |
| matrix-js-sdk 42.x では無効(第 6 節参照):Rust crypto は wasm + |
⚠️ セキュリティ:
MATRIX_ALLOWLISTを必ず設定してください(送信者単位で検証し、ルーム単位ではないため、グループ内の任意のメンバーによるセッションへの注入を防ぎます)。空のままにすると全員が許可され、ローカルテスト専用です。
4. CodeBuddy への接続
方法 A:開発期間(マーケットのホワイトリストを回避)
本プラグインを CodeBuddy プロジェクトの .mcp.json に登録します:
{
"mcpServers": {
"matrix": {
"command": "npx",
"args": ["tsx", "/绝对路径/matrix-channel/src/index.ts"]
}
}
}その後 CodeBuddy を起動します:
codebuddy --channels server:matrix --dangerously-load-development-channelsビルド後に
nodeで実行する場合は次のように変更できます:"args": ["node", "/绝对路径/matrix-channel/dist/index.js"]
方法 B:プラグインとしてパッケージ化(公式マーケットに提出後)
npm run buildcodebuddy-matrix-channel をプラグインとして公開し、その後次のように使用します:
codebuddy --channels plugin:matrix-channel@<你的市场>5. 使用方法
起動後、許可された Matrix ルームでメッセージを送信すると、CodeBuddy セッションに
#matrix · @あなた: ...が表示されますCodeBuddy の処理が完了すると、返信が Matrix ルームに表示されます
MATRIX_CONTROL_ROOM_IDを設定している場合:CodeBuddy が承認が必要なツール(Bash / Write など)を呼び出すと、コントロールルームに通知が届きます(m.noticeシステム通知として送信され、未読/通知は発生しません)。yes <id>で許可 /no <id>で拒否
reply ツールのパラメータ
パラメータ | 説明 |
| Matrix ルーム ID(セッション内のメッセージラベルの |
| 送信するテキスト |
| 任意。HTML 本文( |
| 任意。 |
例:CodeBuddy に
m.noticeでステータス通知を返させる:reply({ chat_id: "!abc:server", text: "処理完了", msgtype: "m.notice" })。
health_check ツール
CodeBuddy セッション内で直接呼び出すか、/mcp ヘルスチェックでトリガーできます。npm run doctor の接続性/E2EE 部分と同等で、JSON を返します:
{ "ok": true, "userId": "@alice:matrix.org", "e2ee": true, "cryptoReady": true }ok=false の場合、error フィールドに失敗理由(接続/認証/E2EE 初期化)が含まれます。
6. 制限と注意事項
エンドツーエンド暗号化(E2EE)ルーム:デフォルトでは暗号化されていないルームのみサポートします。暗号化ルームをブリッジするには
MATRIX_E2EE=trueを設定します。プラグインは matrix-js-sdk 付属の Rust crypto(initRustCrypto)を再利用し、SDK が「受信時の復号、送信時の暗号化」を自動で処理します——暗号化プロトコルを自分で実装する必要はありません。有効にすると:暗号化メッセージは
m.room.encryptedとして到着し、SDK が復号完了(Event.decrypted)後に実際のタイプに変換され、プラグインがセッションにプッシュします;暗号化ルームへの返信は SDK が自動的に暗号化します;
鍵の保存(重要、バージョン関連):matrix-js-sdk 42.x では、Rust crypto バックエンドは wasm/IndexedDB 実装のみ(
@matrix-org/matrix-sdk-crypto-wasm)で、Node ネイティブバックエンドはありません。Node で動作させるため、プラグインは起動時にfake-indexeddb/autoを使用して Node にグローバルなindexedDBシムを注入します——このシムは純粋にメモリ内のため:鍵は実際にはプロセスのメモリにのみ存在し、
MATRIX_CRYPTO_DBはこのバージョンでは実際の SQLite ディスクファイルを生成しません。プロセス再起動後は鍵の再ネゴシエーションが必要です(送受信には影響しませんが、鍵の転送/デバイス検証をやり直す必要があります)。実際のディスク永続化には、
@matrix-org/matrix-sdk-crypto-nodejsネイティブバックエンドを内蔵した matrix-js-sdk バージョンへのアップグレード、または将来 nodejs エントリをサポートするバージョンが必要です(その場合はfake-indexeddbシムを削除し、ネイティブバックエンドに切り替えます)。注意:依存関係にインストール済みの
@matrix-org/matrix-sdk-crypto-nodejsは現在の 42.2.0 では SDK から呼び出されません。将来のアップグレード用の予備としてのみ存在します。現在の暗号化コアは wasm +fake-indexeddbメモリシムで動作します。
新しいデバイスが初めて暗号化ルームに入る際は、Matrix クライアントでこの bot のデバイスを検証することをお勧めします(そうしないと相手に「未検証デバイス」の表示が出る可能性がありますが、メッセージの送受信は正常に行えます)。
メディア:デフォルトではメッセージテキストのみをセッションにブリッジします。
MATRIX_DOWNLOAD_MEDIAを有効にすると、画像/ファイルをローカルにダウンロードし[file: パス]として注入するため、Agent が読み取れます。権限中継は CodeBuddy の
claude/channel/permission機能に依存します。CodeBuddy のバージョンがサポートしていない場合、コアのチャットブリッジには影響しません。
7. デジタルアバター:管理者承認モデル(コアシナリオ)
アバターを「グループ内の同僚」として扱い、自由に @ で仕事を依頼できる一方、管理者が同意するまで実際には何も変更しません。
シナリオ
同僚が複数のグループ(例:
#プロジェクトA、#カスタマーサポート)を作成し、グループ内に複数のアバター bot が存在する場合があります。同僚はグループで @あなたのアバター に仕事を依頼します;@ された時のみ応答します(直接 DM では常に応答)。仕事を受け取った後:
よくある / 承認済みの作業(
MATRIX_TRUSTED_SENDERS/MATRIX_TRUSTED_ROOMSからのもの、またはMATRIX_AUTHORIZED_WORKの説明範囲に該当するもの)→ 自動実行(安全なツール)。未知の作業(承認範囲外)→ アバターは先に計画を出し、
request_approvalを呼び出してコントロールルームにエスカレーションします。あなたがapproveと返信して初めて実行されます。高リスク操作(
MATRIX_HIGH_RISK_TOOLS、例:Bash / ファイル書き込み)→ 送信元に関わらず、常にあなたに確認します。
アーキテクチャの階層
MCP プラグイン = 安全な転送 + ハードゲート(コードで強制、モデルを信頼しない):
@フィルタリング、権限判定allow/denyは検証可能な事実のみに基づきます(owner かどうか、信頼できる送信元かどうか、高リスクツールかどうか)。コントロールルームの承認はMATRIX_OWNER_IDのみ有効です。SKILL = ポリシー脳(意味判断、Agent に委任):
skills/matrix-avatar/SKILL.mdはアバターが「よくある vs 未知」を判断するためのガイドで、未知の場合は計画モードに入りrequest_approvalを呼び出します。Agent は承認を申請するだけで、自分で許可することは決してありません。許可は「管理者の信頼できる送信元のプリセット」または「管理者のapprove」からのみ来ます。
プラグイン内蔵の channel
instructionsにはこのポリシーがインライン化されているため、SKILL を追加インストールしなくても動作します。skills/matrix-avatar/SKILL.mdは CodeBuddy で再利用/微調整するためのものです。
3 層のタスク状態(ルーム単位)
状態 | 意味 | 安全なツール | 高リスクツール |
| 信頼できる送信元 / すでに | 自動実行 | 管理者に確認(コントロールルームで |
| エスカレーション済み・審査待ち( | ブロック | ブロック |
| 未知の送信元・未承認 | ブロック | ブロック( |
コントロールルームのコマンド(管理者 MATRIX_OWNER_ID のみ有効)
approve(またはrun/go、ルーム ID を指定可、例:approve !projectA:server)→ そのルームの現在のタスクを承認し、アバターが実行を開始します。yes <id>/no <id>→ 待機中の高リスク権限リクエストを許可 / 拒否。他の人のコントロールルームへの返信はすべて無視されます。
設定例(.env)
MATRIX_OWNER_ID=@you:matrix.org
MATRIX_TRUSTED_SENDERS=@alice:matrix.org,@bob:matrix.org
MATRIX_TRUSTED_ROOMS=!projectA:server
MATRIX_AUTHORIZED_WORK=回答产品问题、总结会议纪要、起草文档
MATRIX_MENTION_REQUIRED=true
MATRIX_HIGH_RISK_TOOLS=Bash,Write,Edit,MultiEdit,NotebookEdit8. セルフチェック(doctor)
.env を記入したら、CodeBuddy を起動する前にセルフチェックを実行して、設定・接続性・E2EE 状態を確認できます:
npm run doctorセルフチェックは現在の設定(トークンはマスク表示)を出力し、homeserver の到達可能性と資格情報の有効性を検証し、MATRIX_E2EE=true の場合は Rust crypto の初期化を試みます。いずれかの項目が失敗すると、明確な理由が表示され、非 0 の終了コードで終了します。
9. ディレクトリ構造
matrix-channel/
├── src/
│ ├── config.ts # 环境变量 / 白名单 / 授权配置读取与校验
│ ├── matrix.ts # Matrix 客户端封装(连接、@提及过滤、收/发、下载媒体、E2EE、自检)
│ ├── index.ts # MCP 服务:channel 通知、授权硬闸、reply / request_approval 工具、控制室审批
│ └── doctor.ts # `npm run doctor` 自检入口
├── skills/
│ └── matrix-avatar/
│ └── SKILL.md # 分身行为策略(语义判断:常用 vs 陌生)
├── package.json
├── tsconfig.json
├── .gitignore
├── .env.example
└── README.mdAvailable Tools
6 toolshealth_checkA
运行连接/E2EE 自检(等价于 npm run doctor),返回 Matrix 连接与加密状态。可在 /mcp 健康检查中调用。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the tool performs a diagnostic self-check and returns connection and encryption status, which implies a read-only probe. It does not explicitly say it has no side effects, but the self-check framing makes the behavior sufficiently transparent for a zero-parameter tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one compact sentence that front-loads the action and scope, then adds the return value and invocation context. Every clause earns its place; there is no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple zero-parameter diagnostic tool with no output schema, the description covers purpose, method, return value, and invocation context. Nothing essential is missing for an agent to select and call the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has no parameters and schema description coverage is 100%, so there is nothing for the description to clarify. Baseline for zero parameters is 4, and the description adds no conflicting or misleading parameter information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource: it runs a connection/E2EE self-check equivalent to 'npm run doctor' and returns Matrix connection and encryption status. It also distinguishes this health-check tool from the messaging/approval-oriented sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear usage context by stating it can be invoked during /mcp health checks and is for checking connection/encryption status. It does not explicitly name when-not-to-use conditions, but the sibling tools are clearly different in purpose, so the distinction is implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_roomsA
列出本分身已加入的所有 Matrix 房间(room_id + 标题),用于了解「我在哪些房间 / 群」。当不知道该回哪个房间时,可据此找到与管理者(owner)的私聊房间。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and discloses the scope (only rooms the avatar has joined) and the output content (room_id + title). For a read-only, zero-parameter listing tool this is adequate, though it omits minor traits like ordering, pagination, and whether the owner room is guaranteed to exist.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with zero filler. The first sentence front-loads the core purpose and output fields; the second adds a practical decision aid without repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 0-parameter list tool with no output schema, the description covers what is listed, what fields come back, and when to use it. Minor gaps (e.g., behavior when no rooms exist, pagination) are low-stakes for a read-only listing, so nothing critical is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so schema coverage is trivially 100% and there is nothing to document. The baseline of 4 applies because no parameter semantics are needed; the description appropriately spends its effort on output and scope instead.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb (列出/list) and resource (all Matrix rooms this avatar has joined), and explicitly states the returned fields (room_id + title). The scope '本分身已加入' clearly separates it from per-room siblings like room_info and room_members, so an agent can tell them apart without opening another schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides a concrete usage scenario: when unsure which room to reply to, use this tool to locate the owner's private chat room. It does not, however, name alternatives or state when not to use it (e.g., room_info for a single room's details), so it lacks explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
replyA
通过 Matrix 把回复发送到指定房间(chat_id)。省略 chat_id 时回复发往最近一次转发进来的房间(原路返回)。发送会按配置自动重试;若多次仍发不回来源房间,则改用默认回复(MATRIX_DEFAULT_REPLY)发往控制室/owner 私聊兜底。
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | 可选,HTML 格式正文(与 text 同时发送) | |
| text | Yes | 要发送的文本 | |
| chat_id | No | Matrix 房间 ID,例如 !abc:server。省略时回复发往最近一次转发进来的房间。 | |
| msgtype | No | 消息类型:m.text 普通消息;m.notice 系统提示(不触发未读/提醒) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
没有 annotations,因此描述承担了全部行为披露责任。描述主动说明了自动重试机制、失败后的默认回复兜底行为(发往控制室/owner 私聊),以及原路返回的逻辑,这些都是非显而易见的关键行为。
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
描述短小精悍,三句话分别说明核心操作、chat_id 省略行为和重试/兜底机制,信息密度高且没有冗余。关键行为前置,结构清晰。
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
对于发送消息类工具,描述配合完整 schema 已覆盖调用所需信息:目标房间、默认回退行为、重试和失败兜底。没有输出 schema 也不影响理解,整体上下文完整。
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema 描述覆盖率为 100%,所有参数在 schema 中已有说明。描述额外强调了 chat_id 省略时的行为,但 schema 中同样包含该信息,因此描述在参数语义上未显著超出 schema 提供的价值。
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
描述明确说明该工具通过 Matrix 发送回复到指定房间,并解释了省略 chat_id 时的原路返回行为。动词和资源都很具体,与 list_rooms、room_info 等只读查询类兄弟工具形成清晰区分。
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
描述清晰说明了何时使用该工具(发送回复)以及省略 chat_id 时的行为,但未明确提及何时不应使用或列举替代工具。整体使用场景清楚,只是缺少显式的排他性说明。
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
request_approvalA
当判断当前任务来自陌生来源或含高风险时调用,把任务升级到管理者控制室等待审批。管理者回复 approve 后任务会被重放并执行。
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | 需要审批的原因/计划摘要 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It explains that the task is escalated, that it waits for approval, and that it will be replayed and executed after the manager replies 'approve'. It does not mention rejection behavior, but the core lifecycle is clearly disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one concise sentence that front-loads the trigger condition, then states the action and outcome. Every part is informative and there is no redundant wording.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with a single required parameter and no output schema, the description covers the key context: when to call, what happens, and what triggers execution. It does not specify behavior on rejection, but the overall guidance is sufficient for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already covers the single parameter 'reason' with 100% coverage, including its meaning as the approval reason or plan summary. The description adds no further parameter-level detail, so the baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies a specific action: escalating the current task to a manager control room for approval. It also gives the triggering condition ('unfamiliar source or high risk'), which distinguishes it from the sibling tools like reply, health_check, and list_rooms.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use this tool: when the task is from an unfamiliar source or carries high risk. It does not explicitly list alternatives or exclusions, but the condition is clear enough that an agent can decide appropriately.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
room_infoA
获取指定 Matrix 房间(群/私聊)的可读信息:名称、主题、成员昵称与 ID。用于配置与检查「房间 ID ↔ 名称」映射。chat_id 省略时取最近一次转发进来的房间。
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | No | Matrix 房间 ID,例如 !abc:server。省略时取最近对话房间。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the behavioral disclosure burden. It does disclose that the operation retrieves readable info and defines the default behavior when chat_id is omitted, which is useful. However, it does not explicitly state that the operation has no side effects, what happens on invalid room IDs, or any permission requirements — gaps that matter for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no filler. The first sentence states the tool's purpose and outputs, the second gives the use case and default behavior. Critical information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple getter with one optional parameter, the description is mostly complete: it lists return fields, the use case, and the fallback behavior. Since there is no output schema, describing the expected fields is important and done here. Minor omissions around error/not-found behavior prevent a 5.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds value beyond the schema by clarifying that 'recent conversation' specifically means the most recently forwarded room, and by explaining why chat_id is optional in terms of the mapping use case.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description specifies a clear verb ('获取' / get) and resource ('指定 Matrix 房间'), and lists the exact data returned (name, topic, member nicknames and IDs). It does not explicitly contrast itself with siblings such as list_rooms or room_members, but the resource scope and output fields are specific enough to distinguish it without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states a concrete use case: configuring and checking the 'room ID ↔ name' mapping. It also explains the optional chat_id behavior (fallback to the most recently forwarded room), which guides when to call the tool without an argument. No alternatives or when-not-to-use conditions are mentioned, hence not a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
room_membersA
获取指定 Matrix 房间(群聊)的在场成员列表,返回每个成员的 user_id 与 display_name,用于了解「谁在场」。chat_id 省略时取最近一次转发进来的房间。
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | No | Matrix 房间 ID,例如 !abc:server。省略时取最近对话房间。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
无 annotations,描述承担行为说明职责。它说明了工具是只读查询、返回成员列表并解释 chat_id 缺省行为,但未披露任何可能的权限要求、失败情形或数据即时性等行为特征。
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
两句话完整说明用途、返回值与缺省行为,信息密度高且无冗余,属于精炼的合格描述。
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
对单参数只读列表工具,描述已说明返回字段、缺省行为和使用场景;缺少输出结构样例或错误条件,但整体足以让 agent 正确调用。
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
参数仅有 chat_id,schema 已包含描述;描述额外说明了省略 chat_id 时的默认行为(取最近对话房间),为参数语义增加了超出 schema 的价值。
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
描述使用明确动词「获取」与资源「指定 Matrix 房间(群聊)的在场成员列表」,并具体说明返回 user_id 与 display_name,足以与 siblings 如 list_rooms、room_info 区分。
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
描述说明 chat_id 省略时取最近转发进来的房间,提供了明确的使用上下文;但未明确说明何时不使用本工具(例如需要房间详情时用 room_info),因此未达满分。
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
health_check - First observed
list_rooms - First observed
reply - First observed
request_approval - First observed
room_info - First observed
room_members
TDQS
Scored across 6 tools
The tools are mostly distinct: reply, health_check, request_approval, list_rooms, room_members, and room_info each target a different action or resource. The only mild overlap is between room_info and room_members, since room_info also includes member names/IDs, but the descriptions are clear enough to guide selection.
All names are lowercase snake_case, but the semantic pattern is mixed: reply is a bare verb, list_rooms and request_approval are verb+noun, while room_members and room_info are noun+noun descriptors. This is readable but not consistently a verb_noun convention.
Six tools is a tight, well-scoped set for a Matrix channel bridge. Each tool supports a distinct part of the workflow—responding, verifying health, escalating approval, and discovering rooms and participants—without redundancy or bloat.
The set covers the core bot workflow on a Matrix channel: replying, understanding room context, checking connection health, and handling approval escalation. Minor gaps like joining/leaving rooms or reading message history exist, but they are outside the apparent core purpose and do not create dead ends.
Maintenance
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
BridgeApp workspace over MCP: tasks, chats, threads, pages, and projects.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Discover MCP servers and A2A agents; verify, message, post, follow, react, and receive webhooks.
Related MCP Servers
- AlicenseAqualityCmaintenanceBridges OpenAI Codex CLI to any MCP client, allowing headless Codex sessions via tools like codex and codex-reply.215 npm1MIT
- AlicenseAqualityDmaintenanceBridges any MCP client (like Claude Code, Zed, VS Code) to any ACP coding agent, enabling multi-agent orchestration from a single chat interface.24126 npm11Apache 2.0
- AlicenseNot gradedqualityDmaintenanceBridges a Matrix room with Claude Code's claude/channel feature, enabling chat from Matrix to interact with a running Claude Code session.GPL 3.0
- AlicenseNot gradedqualityCmaintenanceMCP server for Matrix that lets Claude list rooms, search/read messages, send messages and files, react, create rooms, and invite users, with multi-homeserver support and safe-by-default writes; no end-to-end encryption.MIT