Data formats

Docs

Every route answers JSON. The shapes below are the ones a client reads; a version field heads each manifest so a client can refuse one it does not know.

Canonical token JSON

GET /api/figma/canonical and the canonical field of the snapshot. Every token resolved into one record:

{
  "version": 1,
  "themes": ["light", "dark"],
  "tokens": [
    {
      "path": "semantic.primary",
      "tier": "semantic",
      "category": "color",
      "name": "primary",
      "component": null,
      "$type": "color",
      "$value": { "light": "oklch(0.55 0.2 260)", "dark": "oklch(0.75 0.16 260)" },
      "ref": { "light": "design.color.brand.600", "dark": "design.color.brand.400" }
    }
  ]
}

path is design.<category>.<name>, semantic.<name> or component.<component>.<name>. $type follows the category, with typography split by its name prefix (fontFamily, fontWeight, lineHeight, dimension). $value is the resolved value per theme; ref the token each theme resolves through, or null for a design token.

A gradient direction (category gradient, a design token such as design.gradient.diagonal) has $type gradientDirection and a value in whole degrees, 135deg. A project holds up to three gradients, one per role: semantic.primary-gradient, semantic.accent-gradient and semantic.surface-gradient (the page wash). Each one, and each component token that paints it (component.button.gradient, component.badge.gradient, component.card.gradient, component.cta-band.gradient or component.hero.gradient), has $type gradient, a $value that is the composed linear-gradient(...) for each theme, and a gradient field holding its direction and its stops' paths in order (semantic.accent-gradient-from, optionally -via, then -to). The stops are ordinary colour semantics. A gradient missing one of its stops has no gradient field, and the CSS exports leave it out.

Snapshot

GET /api/snapshot and GET /api/agent/projects/<id>/snapshot: everything the MCP server serves, computed once.

Field Holds
version The snapshot version; an older command line refuses a newer one.
project name, radiusStrategy, tokenCount, hasMockup, fonts (family slot to CSS stack).
canonical The canonical token JSON above.
cssVars The plain CSS variables stylesheet.
shadcnTheme The shadcn theme stylesheet for Tailwind v4.
kit.sources Component name to React source, plus utils and preview-portal.
kit.variables Component name to the CSS variables its source reads.
mockup { spec, renderer } when the project has a generated page, else null.
blocks { index, sources, header }: the block index and every block file.
guide The integration guide, as get_integration_guide returns it.
screens The screen index list_screens prints: { slug, title, kind, updatedAt } per screen, marketing pages only with pages; never a plan or code.

Kit manifest

GET /api/kit and GET /api/agent/projects/<id>/kit: what designsource add writes.

Field Holds
version, kind 1, "kit".
name The project's display name.
theme { css, fontImports }: the shadcn theme with its font @imports split off.
components { name, file, contents, kitImports, packages } per component.
utils, utilsPackages The cn helper's source and the libraries it imports.
packages, devPackages Library to pinned version, for what the components and the theme need.
section The /design-system section: files, themeCss, blockGroups, packages, blockPackages, mockupSpec.
screens Only with a screens query: { slug, title, component, files, parts } per screen asked for.
screenParts The screen parts those screens import, each with the kit components it uses.
screenIndex Every saved screen as { slug, title, kind, available }, so the command line can name an unknown one.

Starter manifest

GET /api/starter?framework=<framework>: what designsource create and integrate write.

Field Holds
version 1.
framework next, vue, svelte, angular or css.
name The project's name.
files { path, contents } per file, paths relative to the target folder.
nextSteps Which of install, dev and prompt to print.

For next the files are a whole app, with components/screens/, /app and /app/<name> when the request carried screens and the project has some, and app/(site)/ when it also carried pages and has a marketing page; for the other four, a design-system/ folder with tokens.css, tokens.json, page.json when there is a mockup, PROMPT.md and reference/.

Recipe

POST /api/agent/projects takes a recipe in the compact shape: ramps as { "hue", "chroma" }, semantics as { "light", "dark" } references, a radius, fonts and a shadow level. The full shape and every list a field draws from are on Recipe shape.