genome

v0.5.1
@flashdsm/genome Checked 2 days ago Published 20 days ago

Flash 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.

ParameterTypeDescription
categorystringOptional token category (e.g. colors, spacing)

get_design_tokens

Read design tokens from the local Flash token file. Optionally filter by category. Read-only.

ParameterTypeDescription
categorystringOptional token category (e.g. colors, spacing)

list_components

List components from the local components.json (optionally filter by category).

ParameterTypeDescription
categorystringOptional 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.

ParameterTypeDescription
name *stringComponent 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).

ParameterTypeDescription
context *stringCode 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).

ParameterTypeDescription
context *stringCode 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.

ParameterTypeDescription
patch *arrayList of upsert/remove operations
confirmbooleanMust 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.

ParameterTypeDescription
name *stringComponent name

check_violations

Lint a source file for hardcoded colors / arbitrary Tailwind values vs design tokens.

ParameterTypeDescription
file *stringAbsolute or cwd-relative path to a source file

list_violations

Lint a source file for hardcoded colors / arbitrary Tailwind values vs design tokens.

ParameterTypeDescription
file *stringAbsolute 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…

ParameterTypeDescription
designSystemIdintegerWith merge and a web sign-in: the system to propose into (default: linked genomeId)
mergebooleanPropose 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…
namestringName for the new design system
workspacestringWorkspace 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.

ParameterTypeDescription
designSystemIdintegerDesign system id (default: linked genomeId)
urlstringPreview URL to capture (default: previewUrl in genome.config.json)
viewportWidthintegerCapture viewport width in px (default: 1280)
workspacestringRepo 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.

ParameterTypeDescription
countsOnlybooleanSend how many files use each component, without any file path or screen name
designSystemIdintegerDesign system id (default: linked genomeId)
dryRunbooleanBuild the report and return it without sending anything
workspacestringRepo 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.

ParameterTypeDescription
accept_renamebooleanWrite 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…
confirmbooleanMust be true to write files. Without it, nothing is written
workspacestringRepo 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.

ParameterTypeDescription
accept_renamebooleanWrite 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…
confirmbooleanMust be true to write files. Without it, nothing is written
workspacestringRepo 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.

ParameterTypeDescription
workspacestringRepo 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.

ParameterTypeDescription
confirmbooleanMust be true to write files. Without it, nothing is written
workspacestringRepo 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.

ParameterTypeDescription
module *stringModule 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.

ParameterTypeDescription
tokenstringToken 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.

ParameterTypeDescription
token *stringToken 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.

ParameterTypeDescription
confirmbooleanMust be true to write files. Without it, nothing is written
workspacestringRepo 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).