How agents use a design system

Docs

A coding agent reads a design system the way a teammate would: the tokens, every component's source, the blocks, your mockup page and a guide that says in what order to wire them in. All of it comes over MCP from the designsource command line, which the agent's app starts for it. Reading and adding the kit change your app, not the design system; only an agent you signed in with login can add to your account, a new design system or a screen.

How to use it

Pick the way in by what the agent should be able to do:

You want the agent to Run Entry in the app's config
Use one design system you made npx designsource connect in the project npx -y designsource@latest mcp --project <id>, no token
Create a design system for this app, or pick one of yours npx designsource login in the project npx -y designsource@latest mcp, no token, no project
Use a client connect does not cover Copy a config snippet from Connect an agent → Other apps npx -y designsource mcp with DS_SYNC_TOKEN in its env

Then restart the coding app and ask. In Claude Code, /mcp__designsource__integrate-design-system runs the guide; in any client, "integrate the design system using the designsource MCP" does the same. DS source supports React apps only for now. The order is: if the folder has no design system, create_design_system or use_design_system; then add_ui_kit, which your client asks you to allow; then restyle the app with the components it added, and check_design_system to see what still bypasses the kit. add_ui_kit also leaves the kit's rules in the app's AGENTS.md, so the next agent working there reads them. In an app that is not React the agent tells you it is not supported yet and stops. See For coding agents.

How it works

The server is the mcp verb of the command line: plain MCP over stdin and stdout, so every client takes the same command and only the config file's shape differs. It starts without touching the network. The first tool call fetches a snapshot of the project (tokens, the two stylesheets, the kit sources with the variables each reads, the blocks, the mockup page and the guide), cached for 60 seconds, so a Save in the workbench reaches the agent on its next call.

With connect, the entry names the project and the token lives in this computer's private store; the settings file holds no secret and is safe to commit. A teammate runs connect once for their own token.

With login, the entry names nothing: the server uses your account sign-in, and only when the folder it was started in is exactly one you signed in. Four more tools appear: list_design_systems, create_design_system, use_design_system and generate_screen. Each folder links to one design system, the one the agent last created or picked there, and the other tools read that one.

With a snippet, the token sits in the entry's env, so keep that file out of version control.

The server states that order to the agent when it connects, in its instructions. The readers (get_tokens, get_css_variables, get_shadcn_theme, get_component_source) still answer, and add one line when the folder is not ready: a React app without the kit is told to call add_ui_kit, and an app that is not React is told it is not supported yet. No agent should copy those values into the app by hand.

Every tool is listed with its inputs on MCP tools and prompts. Reading the tokens and adding the kit need the project's account on Pro; creating a design system is free, and making a screen runs on any plan on credits or the account's own key.

What can go wrong

  • The agent says the computer is not signed in, or asks you to run connect: run the verb it names, in the project folder, in your own terminal, then restart the app. An agent cannot run login for you, since it cannot show you the code.
  • Every tool answers with one line about the free plan: exports need Pro on the project owner's account.
  • add_ui_kit reports files it would replace: it never overwrites a component you edited, and replaces other existing files only when told to.