mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-02 00:18:17 +00:00
Cloudflare Worker scaffold for the MCP server (Hono, TypeScript strict, pnpm 11 via corepack, wrangler 4, vitest 4 in workerd). - wrangler.toml declares local/preview/production; production alone pins https://api.storyteller.ai. Binding types are generated by `wrangler types`. - src/config.ts parses the bindings and asserts the upstream-host invariant per environment; src/index.ts fails every request with a 500 naming the mismatch if the invariant is violated. - Guardrail tests: config invariant, wrangler.toml environment mapping, MCP_ENVIRONMENT referenced only in config.ts and never branched on, /healthz through the Worker entry. - fake-upstream/: separate Worker (artcraft-api-fake) that will hold the ported fake API routes; eslint forbids imports across the boundary in both directions. - .github/workflows/mcp.yml: typecheck, lint, format, test on mcp/**; production deploy skips with a notice until Cloudflare secrets exist. pnpm check: typecheck, eslint, prettier, 28 tests passing. Claude-Session: https://claude.ai/code/session_01H3gfN2NCx3hBXSrZXYHUQ3