From aeb87581f05990595201638fa30d1eb5847667be Mon Sep 17 00:00:00 2001 From: Claude Lin & Lay Date: Fri, 24 Apr 2026 18:36:04 +0900 Subject: [PATCH] fix(mcpb): sync mcp-server bridge type enum to match Worker (9 values) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mcp-server/server/index.js is the stdio bridge installed via .mcpb into Claude Desktop / Claude Code. It carries its own JSON inputSchema that the client validates against before any request is proxied to the Worker. PR #107 expanded Worker-side zod enum to 9 values (adding issue_comment / pr_review / pr_review_comment), but the bridge's enum was not updated, so requests with the new types were rejected client-side long before reaching the Worker. This was the real root cause of #109 (search_issues type=issue_comment being stuck on the 6-value enum). Yesterday's RagMcpAgent -> V2 rename migration (PR #110 / #112) updated the Worker side but the bridge-side validation still blocked requests, so the effect was not visible. V2 deployment is retained; this fix does not roll back that work. Update: - inputSchema.type.enum -> 9 values matching src/mcp.ts - enum description clarifies the three comment-level types - tool-level description widens to mention comments, PR reviews, and inline review comments #109 の真因は DO init() cache ではなく bridge 側の JSON schema が 6 値に 停まっていたこと。PR #107 で Worker 側は 9 値に拡張済みだったが bridge が更新されておらず、client validation でリクエストが弾かれていた。本修正 で bridge を同期する。 Closes #114 Refs #109 --- mcp-server/server/index.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/mcp-server/server/index.js b/mcp-server/server/index.js index 406ec12..ad29700 100644 --- a/mcp-server/server/index.js +++ b/mcp-server/server/index.js @@ -420,7 +420,8 @@ const TOOLS = [ name: "search_issues", title: "Search Issues", description: - "Unified search across GitHub issues, PRs, releases, documentation, and commit diffs. Three modes: " + + "Unified search across GitHub issues, PRs, releases, documentation, commit diffs, " + + "issue/PR top-level comments, PR reviews, and PR inline review comments. Three modes: " + "(1) hybrid semantic search — dense BGE-M3 + sparse BM25 over D1 FTS5 fused via RRF, then re-scored " + "by @cf/baai/bge-reranker-base (toggle with rerank: false); " + "(2) time-ordered activity scan — omit or empty query with sort=\"updated_desc\" / \"created_desc\", " + @@ -460,9 +461,23 @@ const TOOLS = [ }, type: { type: "string", - enum: ["issue", "pull_request", "release", "doc", "diff", "all"], + enum: [ + "issue", + "pull_request", + "release", + "doc", + "diff", + "issue_comment", + "pr_review", + "pr_review_comment", + "all", + ], description: - "Filter by type (default: all). Use \"diff\" to search per-file commit diffs (judgment history).", + "Filter by type (default: all). " + + "\"diff\" = per-file commit diffs. " + + "\"issue_comment\" = top-level comments on issues and PRs. " + + "\"pr_review\" = PR review bodies (approve / request_changes / comment). " + + "\"pr_review_comment\" = inline per-line review comments on PR diffs.", }, top_k: { type: "number",