Connect a coding agent

Docs

Connect an agent on the breadcrumb row is the dialog for coding agents: one command that sets up Claude Code, Cursor, VS Code, Codex and Gemini CLI on this computer, the project token to give it, and the sentence to say to the agent afterwards. A closed Other apps fold holds config snippets for clients the command does not cover. DS source supports React apps only for now, and the dialog carries a Coding agent? note saying so.

How to use it

  1. Run this in your project folder: npx designsource connect, with a copy button. It asks for the token, then writes each app's settings.
  2. Copy your project token, shown read-only.
  3. Ask your agent: restart the coding app and ask it to add the UI kit; in Claude Code, /mcp__designsource__integrate-design-system.

Other apps offers the same server in three config shapes, mcpServers JSON (Claude Code, Cursor, Windsurf, Cline, Gemini CLI), Codex's TOML and VS Code's servers, each with a placeholder where the token goes.

Without MCP, the Export dialog's Prompt for your coding agent asks the agent to run npx designsource add --yes in your React app. The agent's add finds the token in one of two safe ways: you ran npx designsource or npx designsource connect in a terminal in the folder once, or DS_SYNC_TOKEN is set in the shell profile or secret store the agent runs from. Never paste the token into a chat, a prompt or a command; see For coding agents.

How it works

The agent gets the design system over MCP from the command line's mcp verb, and is told the order when it connects: a design system for the folder first, then add_ui_kit, then restyling with the components it added. It gets the tokens, the two stylesheets, every component's source with the variables it reads, the blocks, your generated page and the integration guide, plus a tool that adds the UI kit to a React app with the same setup as designsource add. connect saves the token in this computer's private store and writes each app's entry with no token in it, so the files are safe to commit and a teammate runs connect once for their own.

The snippets in Other apps carry the token in the entry's env, since those clients have no saved-token path; keep such a file out of version control.

To let an agent create a design system rather than read one, designsource login hands it your account instead; see Letting an agent create design systems.

On the free plan the dialog shows the plan panel; the palette's Connect an agent item is never locked, since the dialog explains.

What can go wrong

  • The agent's tool list is empty after connect: restart the app; Codex and Gemini CLI also need the folder trusted.
  • A tool answers with the free-plan line: exports need Pro on the project owner's account.