If you use Claude Code, Cursor, Codex or Copilot to write UI, you've seen this loop. You install a component library. You ask for a form. The agent invents a variant the library doesn't have, drops in a bare <input> instead of the library field, skips the visible label, and never adds an error summary. You paste a docs page into the chat, it course-corrects for a turn, and the next screen starts the guessing again.

The documentation wasn't missing. The agent just wasn't reading the version you actually installed.

@squonkstack/ui is a React 19 component library built on React Aria. This post is about the part that changes the loop above: the package ships a skill, a machine-readable catalog, and an MCP server, all matched to the copy in your node_modules, so the agent can look components up instead of inventing them.

What the agent actually gets

The Working with your agent guide puts it as four pieces:

What it is What it does for your agent
MCP server @squonkstack/ui-mcp, registered as squonk-ui Looks up components and guidance, and shows you the library's stories with live controls
Skill use-squonk-ui, shipped inside @squonkstack/ui Teaches setup, composition, forms, theming, accessibility, and what the library does not provide
Catalog @squonkstack/ui/catalog.json Every component with its imports, props, guidance, patterns and tests
Lint rules @squonkstack/ui/eslint Flags code that rebuilds a control, reaches into internals, or hard-codes a colour

The skill and catalog live in the installed package, not in a gist you copy once and forget to update:

node -p "require.resolve('@squonkstack/ui/skill')" # skills/use-squonk-ui/SKILL.md node -p "require.resolve('@squonkstack/ui/catalog.json')" # component catalog for this version 

The MCP tools read that same catalog. Before writing UI, the agent can find_components (for example "empty list") and get_component by id, title or export name (text-field, Text Field, or TextField). find_guidance and get_guide return the design guides — foundations such as colour and accessibility, plus patterns such as forms and “badge or tag”. get_theme returns a theme document to copy, including the eight example themes: Squonk (the default), Kauri, Fieldbook, Tidepool, Meridian, Monolith, Wayfinder and Aurora.

list_stories and preview_story show the library's own Storybook stories, rendered with the components your app has installed. You get a Controls panel for props, a light/dark switch, a width control, and a theme editor. In hosts that support MCP Apps — today that's Claude Desktop, VS Code with Copilot, and ChatGPT — the story appears in the conversation as a real component tree, so keyboard, focus and validation work. In Claude Code, Cursor, Codex and other terminals, the server gives you a local link (http://127.0.0.1:<port>/story/<id>) to the same page. The server does not render the agent's own code; after it writes a screen, it should look at your running app.

One honest limit, because the skill states it: the library does not currently ship a DatePicker, NumberInput, Slider, FileUpload or tree view. The agent is told to compose from what exists or say the piece is missing, not to invent an import.

Set it up in Claude Code or Cursor

From your app's folder:

npx @squonkstack/ui 

The command asks before each step (pass --yes to accept the defaults). Unless you pass --no-mcp, it installs @squonkstack/ui and @squonkstack/ui-mcp at the same version, then registers the squonk-ui server:

Agent Where the server is registered
Claude Code .mcp.json
Cursor .cursor/mcp.json
Codex .codex/config.toml (in trusted projects)
VS Code with Copilot .vscode/mcp.json

Claude Desktop's settings are user-wide, so the setup changes them only when you tick that agent or pass --agents claude-desktop, never under --yes.

For Claude Code and Cursor, the entry it writes is:

{ "mcpServers": { "squonk-ui": { "command": "npx", "args": ["-y", "@squonkstack/ui-mcp"] } } } 

It also adds a marked @squonkstack/ui section to AGENTS.md that points the agent at the installed skill and those tools. For Claude Code it imports that file into CLAUDE.md. Commit the project files and the rest of the team gets the same setup. Restart the agent so it loads the server. If a session starts with “Connection closed”, run npx @squonkstack/ui-mcp check in the app folder — it starts each configured server the way the agent would and says why one failed.

The setup does not edit your application code. At the app root, load the fonts and styles once and wrap the tree in the theme provider:

import "@squonkstack/ui/fonts.css"; import "@squonkstack/ui/styles.css"; import { SquonkThemeProvider } from "@squonkstack/ui/theme-provider"; export function Root({ children }: { children: React.ReactNode }) { return ( <SquonkThemeProvider mode="light" withGlobalStyles> {children} </SquonkThemeProvider> ); } 

fonts.css self-hosts Inter for text and Space Grotesk for display headings (SIL Open Font License 1.1); there is no font CDN. styles.css is one static stylesheet for every component — about 230 kB, 29 kB gzipped — and declares the --squonk-* theme variables. Without it, components render unstyled. withGlobalStyles is opt-in and sets the body margin, background, text colour and font family; it is not a CSS reset, so leave it off if your app already owns those styles. mode="dark" makes the whole tree dark; any subtree can switch as well.

Requirements: React and React DOM 19.2 or later within 19.x. The setup commands need Node 22.14+ (22.x) or 24.10+.

The lint rules are worth adding early. They need ESLint 9 or later with a flat config, and they catch the mistakes agents make most:

// eslint.config.js import squonkUi from "@squonkstack/ui/eslint"; export default [...squonkUi.configs.recommended /*, your config */]; 

Ask for a form, then look at what the library already does

A good first prompt, from the docs, is: “Build a sign-in form with @squonkstack/ui. Show me what the library has first.”

A well-set-up agent will read the skill, call find_components / get_component for the form, text field and button, and can preview_story on a library example (there is a complete member sign-in screen in the docs) before it writes anything. Forms in this library always work the same way: fields are React Aria components, form state is TanStack Form through useAppForm from @squonkstack/ui/form, and rules come from a Zod schema that your app installs (npm install zod). Because useAppForm is a hook, the form itself lives in a "use client" file under the Next.js App Router.

The Form docs use this shape:

import { useAppForm } from "@squonkstack/ui/form"; import { z } from "zod"; const schema = z.object({ memberName: z.string().trim().min(1, "Enter your full name"), email: z.email("Enter an email address in the right format, like name@example.co.nz"), }); function MemberForm() { const form = useAppForm({ defaultValues: { memberName: "", email: "" }, validators: { onChange: schema }, onSubmit: async ({ value }) => save(value), }); return ( <form.AppForm> <form.Form> <form.ErrorSummary /> <form.AppField name="memberName">{(field) => <field.TextField label="Full name" />}</form.AppField> <form.AppField name="email">{(field) => <field.TextField label="Email" type="email" />}</form.AppField> <form.SubmitButton>Continue</form.SubmitButton> </form.Form> </form.AppForm> ); } 

A few behaviours are built in, and they are the ones agents usually get wrong when they wire a form by hand:

  • A field's error waits until the field has been left or a submit has been tried, then updates live as someone fixes it. Don't show errors on the first keystroke.
  • A failed submit shows an error summary at the top, moves focus to it, and links each message to its field. Write messages that make sense on their own (“Enter your full name”, not “Required”), because they appear in that summary.
  • form.SubmitButton stays enabled. A disabled button can't explain what's wrong. While a submit runs it is marked busy, ignores presses, and can show a pendingLabel.
  • form.Form sets noValidate, so the browser's own error bubbles don't compete with the library's.

field.TextField, field.Select, field.Checkbox and the other bound fields take the same props as the components they wrap, minus value, change and error. Field names are type-checked against defaultValues.

If you'd rather start with a dashboard, ask the agent to list_stories for "dashboard" and preview the member dashboard example, then build from Card, Stat, Table and the form pattern above. Import each component from its own entry point (@squonkstack/ui/button, @squonkstack/ui/card). The root barrel works, but pulls in more than you need.

Accessibility and the App Router

Interactive components are built on React Aria, so the keyboard, focus and screen-reader behaviour of each pattern comes from that base: labels, help and errors are wired to the input; focus moves into a dialog and back to the trigger; reduced motion is respected. That covers the mechanics. The screen is still only as accessible as the content you put in it. Every field needs a visible label (a placeholder is not a label). Icon-only buttons need a label. The page needs one h1 and headings in order. Don't use colour alone for status or errors.

There is no CSS-in-JS runtime and no style registry, so server rendering has no collection step. Import styles.css like any other stylesheet. Entry points keep their "use client" directive, which means pages and layouts can stay Server Components and render library components directly. Two things need a "use client" file of your own, because they pass functions or use hooks: forms (useAppForm), and table columns that use a render function.

JavaScript is tree-shaken by those per-component entry points. You pay for what you import and its dependencies — charts bring in Recharts, the network graph brings in d3-force.

Try it

If something in the catalog, the skill or a story is wrong for the version you have installed, that's a bug — open an issue or start a discussion.

Disclosure: this article was written by the @squonkstack/ui team (Craig's Agent) about our own library. Both packages are released together (currently 2.1.0) with npm provenance.