docs(mcp_hook): document v0.11.3 decision-JSON wrap as precondition (patch)#1168
Merged
liplus-lin-lay merged 1 commit intoApr 25, 2026
Conversation
`type: "mcp_tool"` UserPromptSubmit hook output reaches the AI prompt context only when the tool returns a value matching a Claude Code hook decision JSON schema (docs literal at https://code.claude.com/docs/en/hooks). Generic JSON parses successfully but is silently discarded. `get_pending_status` returned generic `{pending_count, types, latest_received_at}` until github-webhook-mcp v0.11.3, which wraps the result on the local bridge side into the canonical `hookSpecificOutput.hookEventName= "UserPromptSubmit"` + `additionalContext` shape. Prior to v0.11.3 the `mcp_hook` mode silently drops every hook invocation. Document the version precondition in three surfaces: - adapter/claude/hooks-settings.md (Optional: mcp_tool delivery section) - docs/B.-Configuration.md (LI_PLUS_WEBHOOK_DELIVERY mcp_hook 行 + 注記) - skills/operations-foreground-webhook-intake/SKILL.md (mcp_hook 行) これにより PR #1164 本文と hooks-settings.md 旧記述の見かけ上の矛盾も解消する (両者は v0.11.3 以降では両立する: Claude が tool call を発行しない = 往復消失、 bridge が decision JSON で返す = AI 文脈注入)。 Closes #1167
liplus-lin-lay
commented
Apr 25, 2026
Member
Author
liplus-lin-lay
left a comment
There was a problem hiding this comment.
AI 自己レビュー (semi_auto, patch)
仕様適合
- #1167 の target_files 3 ファイルすべて触っている (hooks-settings.md / B.-Configuration.md / SKILL.md)。constraint 通り C / 6 / Li+bootstrap.md は B 参照のみなので無修正
- patch 判定根拠: docs/spec rule の整合のみ、user/system observable な挙動変化なし。version precondition の明文化であり behavior 変更ではない
- semi_auto patch ルール: AI self-review pass → AI 直接 merge (no human review)
内容整合
- v0.11.3 (実 release 済み, 2026-04-25) を precondition として参照。架空 version ではない
- bridge wrap 仕様は github-webhook-mcp PR #216 / docs/0-requirements F3.1 と一致
- Claude Code docs literal (https://code.claude.com/docs/en/hooks) の文言を引用、impression ではない
- 旧 hooks-settings.md 末尾の「injected into the prompt context」記述は維持しつつ「decision JSON shape を返す tool に限る」を追記する形にした (削除ではなく precision 追加)
自己リスク申告
- 後方互換: v0.11.2 以前のユーザーが
mcp_hookを opt-in 中の場合、本 docs 改訂で initial setup の前提条件が増えるが、振る舞い自体は変わらない (元から silent discard していた) - 表記ゆれ: "github-webhook-mcp >= v0.11.3" を3ファイルでそれぞれ書いたが、表記揺れなし (>= で統一)
- patch 判定が semi_auto の auto-merge 対象。--auto flag は use しない (semi_auto patch は AI 直接 merge)
判定
self-review 承認、gh pr merge --squash で進める。
This was referenced Apr 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
LI_PLUS_WEBHOOK_DELIVERY=mcp_hookモードの実機検証で判明した「mcp_toolhook 戻り値が AI 文脈に注入されない」事象 (#1167) について、根本原因がget_pending_statusの戻り値 shape が Claude Code UserPromptSubmit decision schema にマッチしないことだったと判明。bridge 側修正 (Liplus-Project/github-webhook-mcp#216 → v0.11.3) で
get_pending_statusを canonical decision shape にラップする対応が完了したため、本 PR では Li+ 各 docs に github-webhook-mcp >= v0.11.3 をmcp_hookモードの前提条件として明記する。変更内容
adapter/claude/hooks-settings.mddocs/B.-Configuration.mdLI_PLUS_WEBHOOK_DELIVERY表のmcp_hook行に version 注記を追加。注意書きを箇条書き化して前提条件 4 項目を整理skills/operations-foreground-webhook-intake/SKILL.mdmcp_hook行に Precondition 行を追加影響範囲
docs/C.-Bootstrap.md/docs/6.-Adapter.md/Li+bootstrap.mdのmcp_hook言及は B への参照のみで本文修正は不要設計上の整理
PR #1164 本文の「
tool_use/tool_result往復が消える」と旧hooks-settings.md末尾の「injected into the prompt context」は、v0.11.3 以降では両立する状態:additionalContextを prompt context に注入 (旧 hooks-settings.md の主張)#1167 当初 body の3案 (A:往復削減のみ / B:AI に届ける / C:upstream 待ち) は実質 B が成立した形。
関連