Files
artcraft/mcp/package.json
T
Tanish Manku adc91b9e57 mcp: generate upstream types and a trimmed spec snapshot from the published OpenAPI document
scripts/gen-api.mjs fetches https://storyteller-docs.netlify.app/api.json
(the source of truth for API shape), trims it to src/upstream/allowlist.json
plus transitively referenced schemas (19 paths / 103 schemas instead of
253 / 859), and emits test/fixtures/api.json and src/upstream/schema.d.ts
via openapi-typescript. Both outputs are committed; `pnpm gen:api`
regenerates them deliberately.

Two discrepancies in the published document are corrected during
generation and recorded in docs/backend-handoff.md:
- path parameters are declared as one object-typed parameter (flattened
  when its properties match the path template);
- POST /v1/login and /v1/accounts/google_sso declare their JSON body a
  second time as a path parameter (dropped as a duplicate of requestBody).
The generator refuses to write anything if it meets a shape it does not
recognise.

Also: .gitattributes normalising to LF, eslint/prettier ignores for the
generated files, Node-script lint block, nested .wrangler ignores.

pnpm check: typecheck, eslint, prettier, 37 tests passing.

Claude-Session: https://claude.ai/code/session_01H3gfN2NCx3hBXSrZXYHUQ3
2026-08-24 20:09:03 -07:00

43 lines
1.2 KiB
JSON

{
"name": "@artcraft/mcp",
"version": "0.0.0",
"private": true,
"description": "Artcraft MCP server — Cloudflare Worker at mcp.getartcraft.com",
"type": "module",
"packageManager": "pnpm@11.23.0",
"engines": {
"node": ">=22"
},
"scripts": {
"dev": "wrangler dev",
"deploy:preview": "wrangler deploy --env preview",
"deploy:production": "wrangler deploy --env production",
"gen:api": "node scripts/gen-api.mjs",
"types": "wrangler types",
"typecheck": "pnpm types && tsc --noEmit -p tsconfig.json",
"lint": "eslint .",
"format": "prettier --check .",
"format:write": "prettier --write .",
"test": "vitest run",
"test:watch": "vitest",
"check": "pnpm typecheck && pnpm lint && pnpm format && pnpm test"
},
"dependencies": {
"hono": "4.13.4",
"openapi-fetch": "0.17.0",
"zod": "4.4.3"
},
"devDependencies": {
"@cloudflare/vitest-pool-workers": "0.22.0",
"@eslint/js": "10.0.1",
"eslint": "10.9.1",
"openapi-typescript": "7.13.0",
"prettier": "3.9.6",
"smol-toml": "1.8.0",
"typescript": "5.9.3",
"typescript-eslint": "8.68.0",
"vitest": "4.1.11",
"wrangler": "4.125.0"
}
}