ticket: add mcp cli inspection

This commit is contained in:
Keisuke Hirata 2026-06-20 22:30:19 +09:00
parent 7f06e6567a
commit a8f058c792
No known key found for this signature in database
4 changed files with 124 additions and 0 deletions

View File

@ -0,0 +1,45 @@
{
"version": 1,
"relations": [
{
"ticket_id": "00001KVJKHAFE",
"kind": "related",
"target": "00001KVHR3WRF",
"note": "CLI inspection reads resolved MCP server config/trust policy",
"author": "yoi ticket",
"at": "2026-06-20T13:30:15Z"
},
{
"ticket_id": "00001KVJKHAFE",
"kind": "related",
"target": "00001KVHR3WRY",
"note": "CLI inspection reports lifecycle/client initialization diagnostics",
"author": "yoi ticket",
"at": "2026-06-20T13:30:15Z"
},
{
"ticket_id": "00001KVJKHAFE",
"kind": "related",
"target": "00001KVHR3WS6",
"note": "CLI tools output reports provider-discovered ToolRegistry registration eligibility",
"author": "yoi ticket",
"at": "2026-06-20T13:30:16Z"
},
{
"ticket_id": "00001KVJKHAFE",
"kind": "related",
"target": "00001KVHR3WSN",
"note": "CLI resources/prompts output reports explicit operation eligibility",
"author": "yoi ticket",
"at": "2026-06-20T13:30:16Z"
},
{
"ticket_id": "00001KVJKHAFE",
"kind": "related",
"target": "00001KVHR3WSW",
"note": "CLI shows list_changed refresh/reinitialize diagnostics",
"author": "yoi ticket",
"at": "2026-06-20T13:30:16Z"
}
]
}

View File

@ -0,0 +1,55 @@
---
title: 'MCP: add yoi CLI inspection commands'
state: 'ready'
created_at: '2026-06-20T13:29:16Z'
updated_at: '2026-06-20T13:30:16Z'
assignee: null
---
## 背景
MCP local stdio integration は server config / lifecycle client / ToolRegistry registration / tools-call / resources-prompts explicit operations / list_changed diagnostics まで進んだ。一方で、ユーザーが `yoi` CLI から MCP の設定・解決結果・接続状態・discovered capabilities を確認する read-only inspection surface がまだ整理されていない。
Plugin には `yoi plugin list/show` があるが、MCP は plugin model そのものではなく protocol-bound bridge/runtime kind として扱う決定になっている。そのため MCP には専用の CLI namespace を用意し、設定済み server と provider-discovered tools/resources/prompts、起動/初期化/refresh diagnostics を確認できるようにする。
## 要件
- `yoi mcp ...` もしくは同等の top-level CLI namespace を追加する。
- 初期 scope は read-only inspection とし、MCP server process の起動・Tool 実行・resources/prompts の content fetch は通常 runtime/tool path を迂回して行わない。
- 最低限のコマンドを提供する。
- `yoi mcp list` または `yoi mcp server list`: resolved MCP server の一覧。
- `yoi mcp show <server>`: server config/ref、transport、trust policy、resolved status、diagnostics、capability summary。
- `yoi mcp tools [<server>]`: provider-discovered MCP tools と Yoi 側 stable tool name / registration eligibility / diagnostics。
- `yoi mcp resources [<server>]`: discovered resources/resource templates の summary と explicit operation eligibility。
- `yoi mcp prompts [<server>]`: discovered prompts の summary と explicit operation eligibility。
- 各コマンドは human-readable output と `--json` を持つ。
- `--workspace <PATH>``--profile <REF>` を Plugin CLI と同じ感覚で扱い、resolved Profile/config から MCP server configuration を読む。
- 出力は bounded / content-safe にする。
- resource contents、prompt full text、secret values、environment secret refs の解決結果は表示しない。
- external server 由来の descriptions/schema/annotations は untrusted data として扱い、必要なら truncate する。
- 接続済み live Pod state が必要な情報と static config inspection だけで得られる情報を区別する。
- static mode では config/resolution/package-less diagnostics を表示する。
- live state が未実装または unavailable の場合は、silent stale state ではなく `not live / unavailable` を明示する。
- `notifications/*/list_changed` 由来の restart/reinitialize-required diagnostics がある場合は CLI で見えるようにする。
- CLI help に MCP namespace を追加する。
## Non-goals
- MCP tool を CLI から直接実行すること。
- MCP resources/prompts の content を CLI から直接取得して表示すること。
- MCP server の install/update/distribution。
- Streamable HTTP / remote auth / OAuth の実装。
- sampling / elicitation の実行または approval flow。
- Plugin CLI に MCP を混ぜること。
## 受け入れ条件
- `yoi --help` に MCP CLI namespace が表示される。
- `yoi mcp list --json` が resolved MCP server の bounded structured report を返す。
- `yoi mcp show <server> --json` が server identity、transport kind、trust policy summary、capabilities summary、diagnostics を返す。
- `yoi mcp tools [<server>] --json` が Yoi stable tool name と MCP server/tool identity、schema availability、registration status/diagnostics を返す。
- `yoi mcp resources [<server>] --json``yoi mcp prompts [<server>] --json` が content を取得せず summary/eligibility を返す。
- Human-readable output は empty/missing/invalid/unavailable を区別して表示する。
- Secrets and resource/prompt contents are not printed in normal or JSON output.
- Focused CLI tests cover list/show/tools/resources/prompts, missing server, invalid config, and JSON output.
- Validation before completion includes `cargo fmt --check`, focused MCP/CLI tests, `cargo check`, `git diff --check`, `yoi ticket doctor`, and `nix build .#yoi --no-link`.

View File

@ -0,0 +1,24 @@
<!-- event: create author: "yoi ticket" at: 2026-06-20T13:29:16Z -->
## 作成
LocalTicketBackend によって作成されました。
---
<!-- event: intake_summary author: hare at: 2026-06-20T13:30:16Z -->
## Intake summary
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-06-20T13:30:16Z from: planning to: ready reason: cli_state field: state -->
## State changed
Marked ready by `yoi ticket state`.
---