genome
v0.5.1Flash Genome - the local MCP server for a Flash design system: give Cursor, Claude and any MCP client your real tokens, component specs and token linting over…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_tokens
Read design tokens from the local Flash token file. Optionally filter by category. Read-only.
| Parameter | Type | Description |
|---|---|---|
category | string | Optional token category (e.g. colors, spacing) |
get_design_tokens
Read design tokens from the local Flash token file. Optionally filter by category. Read-only.
| Parameter | Type | Description |
|---|---|---|
category | string | Optional token category (e.g. colors, spacing) |
list_components
List components from the local components.json (optionally filter by category).
| Parameter | Type | Description |
|---|---|---|
category | string | Optional component category (e.g. actions, forms) |
get_component
Get a single component spec by name from the local components file. After a pull it includes `colors`: the component's saved colour bindings in Light and Dark (token, semantic, base colour, the stack's class string) and what is unbound or not a token. Use exactly these.
| Parameter | Type | Description |
|---|---|---|
name * | string | Component name (e.g. Button) |
get_brand_dna
Read brand DNA from brand-dna.json (sibling of tokens) or tokens['dsm-brand-dna'].
suggest_token
Suggest design tokens for hardcoded colors/spacing found in a context snippet (deterministic, no LLM).
| Parameter | Type | Description |
|---|---|---|
context * | string | Code or design context containing colors/px values |
suggest_token_usage
Suggest design tokens for hardcoded colors/spacing found in a context snippet (deterministic, no LLM).
| Parameter | Type | Description |
|---|---|---|
context * | string | Code or design context containing colors/px values |
apply_token_patch
Upsert/remove tokens in the local design-tokens.json. Dry-run by default; set confirm=true to write.
| Parameter | Type | Description |
|---|---|---|
patch * | array | List of upsert/remove operations |
confirm | boolean | Must be true to write the file (default: dry-run) |
generate_component_prompt
Generate an AI handoff prompt for implementing a named component with Flash tokens.
| Parameter | Type | Description |
|---|---|---|
name * | string | Component name |
check_violations
Lint a source file for hardcoded colors / arbitrary Tailwind values vs design tokens.
| Parameter | Type | Description |
|---|---|---|
file * | string | Absolute or cwd-relative path to a source file |
list_violations
Lint a source file for hardcoded colors / arbitrary Tailwind values vs design tokens.
| Parameter | Type | Description |
|---|---|---|
file * | string | Absolute or cwd-relative path to a source file |
scan_workspace
Read a local project and create a new Flash design system from it: DTCG JSON, every CSS/SCSS stylesheet (custom properties under any selector, Sass variables), CSS inside template literals in JS/TS (`/* css */` or css`...`, e.g. a Shadow DOM widget's stylesheet), Tailwind config and theme modules. Each goes as what it holds, printed again from its parsed rules or literals (never the file); Flash reads colours, radius, spacing, shadows and fonts from them on the server. Components are not read from source: Flash captures them from the running app, through the preview. Authenticates with FLASH_G…
| Parameter | Type | Description |
|---|---|---|
designSystemId | integer | With merge and a web sign-in: the system to propose into (default: linked genomeId) |
merge | boolean | Propose the scan into an existing design system as a change set to review on Sync, instead of creating a new one. With FLASH_GENOME_TOKEN that is the token's system; with a web sign-in, designSystemId… |
name | string | Name for the new design system |
workspace | string | Workspace root (default: cwd) |
capture_project_shell
Capture a reachable project preview URL on this machine (Storybook, Vite, etc.), upload the sanitised HTML+CSS shell to Flash, and attach it to a design system. Localhost is supported because capture runs locally — Flash never fetches the URL. Use after scan_workspace / create so Foundations can show Your project. Defaults: url from genome.config.json previewUrl, designSystemId from genomeId.
| Parameter | Type | Description |
|---|---|---|
designSystemId | integer | Design system id (default: linked genomeId) |
url | string | Preview URL to capture (default: previewUrl in genome.config.json) |
viewportWidth | integer | Capture viewport width in px (default: 1280) |
workspace | string | Repo root for genome.config.json (default: cwd) |
scan_usage
Find where this repository's own components are used in its code - which files import each one and how often it is drawn - and send the report to a Flash design system, where each component's usage panel shows it as In your product. Read-only on disk. A scan by import and tag, not a compile: it follows renamed imports and ignores a library's same-named component, and it does not follow re-export chains or dynamic imports. Defaults: designSystemId from genomeId. Pass dryRun to see the report without sending it, countsOnly to send totals without file paths.
| Parameter | Type | Description |
|---|---|---|
countsOnly | boolean | Send how many files use each component, without any file path or screen name |
designSystemId | integer | Design system id (default: linked genomeId) |
dryRun | boolean | Build the report and return it without sending anything |
workspace | string | Repo root to scan (default: cwd) |
pull_from_web
Write this design system into the repository: the token files and mirrors named by genome.config.json. Returns the plan; writes only with confirm. Refuses, before writing, a pull that would rename variables the app reads: when it does, tell the person what changed and ask whether the change in Flash was intended; do not rename the app's variables to match. Run sync_context as well for the files an agent reads before writing UI.
| Parameter | Type | Description |
|---|---|---|
accept_rename | boolean | Write even when the pull renames variables the app reads (Flash's CSS prefix changed, or names the app uses are gone). Only after the person who owns the app said the change in Flash was intended; nev… |
confirm | boolean | Must be true to write files. Without it, nothing is written |
workspace | string | Repo root (default: cwd) |
sync_to_repo
Write this design system into the repository: the token files and mirrors named by genome.config.json. Returns the plan; writes only with confirm. Refuses, before writing, a pull that would rename variables the app reads: when it does, tell the person what changed and ask whether the change in Flash was intended; do not rename the app's variables to match. Run sync_context as well for the files an agent reads before writing UI.
| Parameter | Type | Description |
|---|---|---|
accept_rename | boolean | Write even when the pull renames variables the app reads (Flash's CSS prefix changed, or names the app uses are gone). Only after the person who owns the app said the change in Flash was intended; nev… |
confirm | boolean | Must be true to write files. Without it, nothing is written |
workspace | string | Repo root (default: cwd) |
detect_drift
Has the repo moved since the last pull, has Flash, and which token values changed. Read-only; every finding is flagged.
| Parameter | Type | Description |
|---|---|---|
workspace | string | Repo root (default: cwd) |
push_to_web
Propose what this repo's code changed to Flash, as one change set a person reviews on the Sync page: the app's own stylesheets (new tokens, light or dark values Flash lacks, aliases re-pointed with var(--step)) and edits to the pulled design-tokens.json. Files the pull wrote are not read as code. Nothing is applied. Returns the plan; proposes only with confirm. Refused while Flash is ahead of the last pull.
| Parameter | Type | Description |
|---|---|---|
confirm | boolean | Must be true to write files. Without it, nothing is written |
workspace | string | Repo root (default: cwd) |
list_modules
Every module, with its part count, the components it is built from, and how many token bindings it carries.
get_module
One module by id or name: its parts in order, each resolved to its component, and its bindings.
| Parameter | Type | Description |
|---|---|---|
module * | string | Module id or name |
get_relations
With a token: what it aliases, what aliases it, and what binds to it directly. Without one: every alias edge, binding and module part.
| Parameter | Type | Description |
|---|---|---|
token | string | Token id or name |
get_impact
What breaks if a token changes: every token that resolves through it, and the components and modules that end up using it. Call before changing a token.
| Parameter | Type | Description |
|---|---|---|
token * | string | Token id or name |
sync_context
Refresh the files an agent reads before writing UI: AGENTS.md (once), the Cursor rule, and the Agent Skill. Returns the plan; writes only with confirm.
| Parameter | Type | Description |
|---|---|---|
confirm | boolean | Must be true to write files. Without it, nothing is written |
workspace | string | Repo root (default: cwd) |
api_health
Check Flash DSM FastAPI /health endpoint.
list_design_systems
List design systems from FastAPI (requires --access-token / FLASH_DS_ACCESS_TOKEN).