fix(mcp-self-hosted): KBDB binding 指向不存在的 service + kbdb worker 未部署

self-hosted MCP failed 根因(壓測 2026-06-10):
1. mcp/wrangler.toml: KBDB service binding 綁 'inkstone-kbdb-api'(全 repo 僅此一處,
   不存在的舊名)→ 改成實際 worker 名 'arcrun-kbdb'(官方+self-hosted 共用)。
2. deploy.ts: self-hosted 部署清單漏了 kbdb worker(只有 cypher/registry/mcp)→
   D1 arcrun-kbdb 有建但 worker 本體沒部署 → KBDB binding 指向不存在 service →
   partnerAuthMiddleware 每個 MCP 認證請求都 throw。加 'kbdb' 進部署清單。
D1 id 注入已涵蓋(injectWranglerConfig 跑 tier2,kbdb 現在在 tier2)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
uncle6me-web
2026-06-11 00:08:25 +08:00
parent eba87b9ea9
commit 1af7655ac6
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -225,7 +225,10 @@ function discoverWorkerDirs(root: string): { tier1: string[]; tier2: string[] }
}
// self-hosted 也部署自己的 MCP workermcp-account-source §5ccodeload 主庫即得 MCP
// .mcp.json 指自己的 mcp 而非官方 mcp.arcrun.dev)。
for (const name of ['cypher-executor', 'registry', 'mcp']) {
// kbdbMCP 的 partnerAuthMiddleware 透過 KBDB service binding 打 arcrun-kbdb workermcp/wrangler.toml)。
// D1 arcrun-kbdb 已由 init/update 建好,但 worker 本體要一併部署,否則 binding 指向不存在的 service
// → 每個 MCP 認證請求都 throwself-hosted MCP failed 根因,2026-06-10)。
for (const name of ['cypher-executor', 'registry', 'kbdb', 'mcp']) {
const dir = join(root, name);
if (existsSync(join(dir, 'wrangler.toml'))) tier2.push(dir);
}