API Reference

Fetch variable Jar variables from anywhere — iOS/Android apps, CI pipelines — over REST. Read-only, using the same token as the MCP server.

Issuing a token

  1. variablejar.com/app → a project card’s ⋯ menu → Properties → the API tokens (MCP) section
  2. Enter a token name and press Issue — the token (vjt_…) is shown only once, right after issuing. Store it somewhere safe.
  3. A token grants access to that one project only. If it leaks, revoke it immediately on the same screen.

Endpoint

GET https://iwjtqtsyztgjcovovgly.supabase.co/functions/v1/variables-api/v1/variables
Authorization: Bearer vjt_...
curl -H "Authorization: Bearer vjt_..." \
  "https://iwjtqtsyztgjcovovgly.supabase.co/functions/v1/variables-api/v1/variables"

Response

Values are final, with aliases ({Collection/key}) resolved. Only cells that couldn’t be resolved appear in unresolved with a reason (broken · cycle · inline), keeping their original value.

{
  "apiVersion": "v1",
  "project": { "id": "…", "name": "My Variables" },
  "collections": [
    { "id": "…", "name": "Color", "modes": ["light", "dark"] }
  ],
  "tokens": [
    {
      "key": "color/primary",
      "collection": "Color",
      "type": "COLOR",
      "valuesByMode": { "light": "#3B82F6", "dark": "#60A5FA" }
    }
  ]
}

Platform code output

Add ?format= to receive generated platform code instead of JSON:

formatOutputContent-Type
cssCSS custom properties — default mode in :root, other modes in [data-theme="<mode>"]text/css
swiftSwiftUI — one type per collection, one static instance per modetext/plain
composeJetpack Compose (Kotlin) — same structure as Swifttext/plain
curl -H "Authorization: Bearer vjt_..." \
  "https://iwjtqtsyztgjcovovgly.supabase.co/functions/v1/variables-api/v1/variables?format=css" \
  > variables.css

Output is deterministic — identical tokens always produce identical bytes, so ETag/If-None-Match caching works the same as the JSON response. Aliases are always resolved to final values; unresolved references are emitted as comments, never as fabricated values. An unknown format returns 400 { "error": "unknown_format" }.

Polling and ETag

Responses include an ETag header. Send it back as If-None-Match and you’ll get 304 (no body) when nothing changed — saving bandwidth for periodic checks from mobile apps and CI. Use the received ETag value as-is (it may include W/).

curl -i -H "Authorization: Bearer vjt_..." \
  -H 'If-None-Match: "sha256-…"' \
  "https://iwjtqtsyztgjcovovgly.supabase.co/functions/v1/variables-api/v1/variables"
# HTTP/2 304

Errors

StatusMeaning
401Missing / malformed / revoked token
404Wrong path, or the project was deleted
405Method other than GET or OPTIONS (OPTIONS answers CORS preflight with 204)
500Server error — if it persists after retrying, contact support@variablejar.com

MCP server (IDE / AI agents)

From IDEs and AI coding agents, the @variablejar/mcp MCP server is more convenient than REST — the same token works for both. You can hand this page to an AI agent and ask it to set the integration up for you.

Add to your MCP configuration:

{
  "mcpServers": {
    "variablejar": {
      "command": "npx",
      "args": ["-y", "@variablejar/mcp"],
      "env": { "VARIABLEJAR_TOKEN": "vjt_your_token_here" }
    }
  }
}

Where the file lives depends on the client:

ClientConfig file
Claude Code.mcp.json in the project root
Cursor.cursor/mcp.json
Other MCP clientsSee the client’s MCP server settings

Available tools:

ToolDescription
list_tokensAll design tokens in the project, with aliases resolved to final values
get_tokenA single token by key (e.g. color/primary)
list_collectionsCollections and their modes
get_tokensThe whole project as generated platform code (format: css | swift | compose)

Environment variables:

VariableRequiredDescription
VARIABLEJAR_TOKENProject API token (vjt_…) — one token, one project
VARIABLEJAR_API_URLOverride the API URL (defaults to production)

The server is read-only — the token cannot write or delete anything.

Notes

  • Don’t call this directly from a browser (web frontend) — the token would be exposed in client code. Use it from servers, apps, or CI, where the token stays hidden.
  • Write APIs and delta (changes-only) queries are not available yet.
  • For LLM context, the full documentation is available as /llms.txt (index) and /llms-full.txt (everything in one file).