garn-mcp
Your agent asks the design system.
Copying components in gives your agent the source. The metadata that ships with them — what each of the 86 components is for, the 154 accessibility contracts they have to keep, which ones compose — is the judgment layer, and this server is how an agent queries it.
Install
garn-mcp is a standalone package — no clone, no build. It bundles a metadata snapshot of the garn version it was published against, so it runs straight from npx. Install the version matching the source you copied in.
The garn CLI writes the config for you, version-matched to what is in your project:
npx garn-ui mcp installOr register it by hand — Claude Code:
claude mcp add garn -- npx -y garn-mcpCursor and every other client take the same command as a JSON entry:
{ "mcpServers": { "garn": { "command": "npx", "args": ["-y", "garn-mcp"] } } }Point the server at a newer or custom metadata directory with GARN_INFO_DIR=/path/to/out in its env.
What it answers
garn_searchFind components by keyword, pattern or category. Ranked — this is where a task starts.
garn_viewThe full reference for one component. `sections` slices it so a lookup costs a few hundred tokens, not thousands.
garn_get_examplesType-checked example code, filterable by role — ask for the canonical one and paste it.
garn_match_recipeAn intent in, the best-fit compositions out, each with the accessibility it requires.
garn_relationsWhat pairs with, composes with, or replaces what — the graph behind every roster page.
garn_auditLint a composition against the a11y contracts, token discipline and the do/don'ts before you ever see it.
Try it
The tools are called by the agent, not by you — there is nothing to memorise. Once the server is registered, ask in plain words:
- Add a filterable data table with pinned columns and row selection.
- Which garn component should I use for a multi-step form?
- Audit this dialog against garn's accessibility contracts.
- Show me the canonical combobox example with async loading.
No MCP client?
The same corpus is served flat, for tools that only read text. The agents page covers llms.txt, the per-component markdown, and what to put in a project's rules file.