Files
Arcrun/mcp/wrangler.toml
T
uncle6me-web 222a382d49 fix(#12): MCP service binding 用 [[services]] array-of-tables(修 self-hosted CYPHER_EXECUTOR 缺失)
根因(非總管原假設的 strip 誤清):mcp/wrangler.toml 用 inline `services = [...]` 且在
[vars] table 之後 → TOML 把它吸成 `vars.services`(普通 env var 陣列)而非頂層 service
bindings → wrangler 看不到 CYPHER_EXECUTOR/KBDB/COMPONENT_REGISTRY binding。
self-hosted 部署 injectMultiTenant 往 [vars] 注入 MULTI_TENANT 後此問題暴露
(MCP 報 "CYPHER_EXECUTOR service binding not configured")。

修法:inline → [[services]] array-of-tables(獨立頂層 table,不受 [vars] 影響,
對齊官方 cypher-executor/wrangler.toml 慣例)。

本地驗證(wrangler deploy --dry-run,模擬 self-hosted 注入 MULTI_TENANT):
- 修法後:env.CYPHER_EXECUTOR/COMPONENT_REGISTRY/KBDB 三 binding 都在 
- 對照舊 inline:binding 全消失、變成 env.services(一個 JSON env var) 坐實根因

⚠️ 端到端待 leo21c acr update 重部 MCP(CC 跑不了 leo21c 部署)。修好後
MCP validate/recipe_search 不再報 binding not configured;連帶解鎖 #11 self-hosted
u6u_list/search_workflows + mira #6 門鈴 + acr push 端到端。#12 留 open 待端到端。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 23:32:16 +08:00

44 lines
2.6 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name = "arcrun-mcp" # 2026-06-06 搬進主庫 arcrun/mcp/,對齊 arcrun-* 命名(SDD mcp-account-source.md §5
main = "src/index.ts"
compatibility_date = "2024-11-27"
compatibility_flags = [ "nodejs_compat" ]
workers_dev = true # 對齊 arcrun 部署慣例(rule 05):deploy 掃描自動啟用 workers.dev URL
# ── 租戶模式(self-hosted fork 必看)─────────────────────────────────────────────
# 官方 SaaS[vars] 不含 MULTI_TENANT(預設多租戶)→ MCP 走 partner-key 驗證(pk_live)。
# self-hosted 單租戶:acr init/update 部署時 **自動注入** MULTI_TENANT="false" 進此 [vars]
# cli/src/lib/deploy.ts injectMultiTenant,依 config.mode='self-hosted')→ MCP 接受 Bearer =
# namespace 明碼,不打 KBDB partner 驗證,直接當 org_namespace(與 cypher 的 MULTI_TENANT=false 對齊)。
# 用戶零填寫(不必手動取消註解)。手動 fork 不走 CLI 者,自行在此加 MULTI_TENANT = "false"。
# SDD: sdk-and-website/mcp-account-source.md §5.5HANDOFF §3b。
[vars]
# Service Bindingsissue #12:用 [[services]] array-of-tables,不用 services=[...] inline
# ⚠️ 為何不能用 inline `services = [...]`:它在 [vars] table 之後 → TOML 會把它吸成
# `vars.services`(普通 var 陣列)而非頂層 service bindings → wrangler 看不到 binding。
# self-hosted 部署注入 MULTI_TENANT 進 [vars] 後此問題暴露(MCP 報 CYPHER_EXECUTOR not configured)。
# array-of-tables `[[services]]` 是獨立頂層 table,不受 [vars] 影響(對齊官方 cypher-executor/wrangler.toml)。
# 2026-05-07COMPONENT_REGISTRY 從 inkstone-component-registry 改為 arcrun-registry(現役)。
[[services]]
binding = "COMPONENT_REGISTRY"
service = "arcrun-registry"
[[services]]
binding = "CYPHER_EXECUTOR"
service = "arcrun-cypher-executor"
[[services]]
binding = "KBDB"
service = "arcrun-kbdb"
# Route — MCP 搬進 arcrun 主庫後改用 arcrun.dev zone(與其他 worker 一致)。
# 舊的 studio.finally.click 是 inkstone 平台 zonearcrun 帳號沒有該 zone → 部署 route 失敗。
# 對外正式 MCP URL = mcp.arcrun.dev;對內 / fork 仍可走 workers_dev=true 的 arcrun-mcp.<sub>.workers.dev。
[[routes]]
pattern = "mcp.arcrun.dev/*"
zone_name = "arcrun.dev"
# [alias] 移除:之前是 Zod 4 的 compat shim,但 MCP SDK 1.x 用的是 Zod 3 介面,
# shim 讓 SDK 拿到 Zod 4 內部結構,introspect schema 時報 _zod undefined。
# 降到 Zod 3.x 後不需要 shimpackage.json)。