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:
@@ -225,7 +225,10 @@ function discoverWorkerDirs(root: string): { tier1: string[]; tier2: string[] }
|
||||
}
|
||||
// self-hosted 也部署自己的 MCP worker(mcp-account-source §5c:codeload 主庫即得 MCP,
|
||||
// .mcp.json 指自己的 mcp 而非官方 mcp.arcrun.dev)。
|
||||
for (const name of ['cypher-executor', 'registry', 'mcp']) {
|
||||
// kbdb:MCP 的 partnerAuthMiddleware 透過 KBDB service binding 打 arcrun-kbdb worker(mcp/wrangler.toml)。
|
||||
// D1 arcrun-kbdb 已由 init/update 建好,但 worker 本體要一併部署,否則 binding 指向不存在的 service
|
||||
// → 每個 MCP 認證請求都 throw(self-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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ workers_dev = true # 對齊 arcrun 部署慣例(rule 05):deploy 掃描
|
||||
services = [
|
||||
{ binding = "COMPONENT_REGISTRY", service = "arcrun-registry" },
|
||||
{ binding = "CYPHER_EXECUTOR", service = "arcrun-cypher-executor" },
|
||||
{ binding = "KBDB", service = "inkstone-kbdb-api" }
|
||||
{ binding = "KBDB", service = "arcrun-kbdb" }
|
||||
]
|
||||
|
||||
# Route — MCP 搬進 arcrun 主庫後改用 arcrun.dev zone(與其他 worker 一致)。
|
||||
|
||||
Reference in New Issue
Block a user