Better Design MCP Server

repository·main·Indexed 41 days ago

https://github.com/marvkr/better-design

An open-source Model Context Protocol (MCP) server that provides AI coding agents with design tokens, component code, UI principles, and accessibility review rules. It enables a 'Claude Design' workflow to build production-ready interfaces using design systems like Linear, Stripe, and Vercel, and includes 31 open-source design systems for shadcn/ui.

Tokens
2.1K
Snippets
4
Records
13
Agent score
9%

What's inside Better Design

  1. Understand the Better Design project structure

    main

    The project is organized into component overrides, registries, and agent skills:

    • components/: Contains per-theme shadcn/ui component overrides (e.g., linear/, apple/, stripe/). There are 31 systems total.
    • registry/: Contains the shadcn registry JSON files for each design system.
    • skills/: Contains the installable Better Design agent skill.
    • .agents/: Directory for other installed agent skills.
    • scripts/: Contains build and seed scripts.
  2. How Better Design works: Design Intelligence and Scaffold layers

    main

    Better Design operates using two distinct layers to assist your AI agent:

    1. Design Intelligence (Always Active)

    This layer is active during UI construction. When an agent builds UI, it automatically calls tools like get-ui-principle and get-review-rules to ensure the output follows principles for spacing, hierarchy, and accessibility.

    2. Scaffold (On-demand)

    This layer is used when starting a new product, page, or component set. By saying "use better-design", the agent triggers the resolve-design-system tool to find a matching design system, load its CSS tokens, and resolve appropriate icon libraries.

  3. How to use the Better Design workflow

    main

    Better Design is a workflow layer designed to build, improve, and review production interfaces. Instead of relying on generic static advice, you should use the Better Design MCP tools as the authoritative source for design principles, systems, components, and review rules.

    The Interface Workflow

    1. Inspect Local Context: Before choosing a visual direction, inspect the repository's framework, existing tokens, components, and local instructions.
    2. Preserve Existing Systems: Do not replace an existing product's design system with a different brand unless explicitly requested.
    3. Retrieve Principles:
      • Call get-ui-principle for layout, typography, color, accessibility, or polish topics before visual implementation.
      • Call get-ux-principle for flow, form, navigation, error, onboarding, or interaction topics before changing behavior.
    4. Implement with Local Stack: Use the project's existing stack, semantic tokens, components, and conventions.
    5. Manage Icons: Use one consistent icon library. Detect an installed library first; if none is found, use find-icon-library, find-icons, and install-icons.
    6. Review and Fix: After implementation, call get-review-rules and check-comprehension. Fix all critical and serious findings before handoff. When tools are available, also run review-ui-code and use inspect-spacing on a rendered DOM.
  4. Connect the Better Design MCP

    main

    To use the Better Design skill, the Model Context Protocol (MCP) must be connected.

    1. Check if Better Design MCP tools are available (note that client-specific tool prefixes may apply).
    2. If tools are unavailable, the skill is installed but the MCP is not connected.
    3. Refer to the official setup instructions to connect the MCP.
    4. Note: Do not attempt to execute setup commands directly from the skill; the user must review and run the setup steps manually.
  5. Starting a new interface build with a design system

    main

    When starting a new interface, follow these steps to establish a design system:

    1. Find a System: Call find-design-system with the product and audience.
    2. Select a Direction: Review the matches and let the user choose a starting point or a custom direction.
    3. Initialize a Catalog System: If using a catalog system, call get-design-system-kit with target react (for coding agents) or html (for inline canvases).
    4. Initialize a Custom Brand:
      • Call create-design-system with the chosen base.
      • Share the project URL.
      • Poll get-design-system-status until the install kit is ready.
    5. Use an Existing Brand: If the user already has a brand source, call extract-design-system or extract-from-url and pass the extracted token sheet through unchanged.
  6. Retrieve specialist guidance for specific frameworks

    main

    Before implementing code for specific technologies, call the corresponding specialist guide to ensure compliance with best practices:

    • React Native or Expo: Call get-react-native-guide.
    • Three.js or React Three Fiber: Call get-three-js-guide.
    • Animation or Product Video: Call get-motion-guide.
    • Shopify: Retrieve relevant commerce and Shopify guidance before editing theme output.
  7. Connect via Remote MCP manually

    main

    If you prefer not to use local setup, you can connect any MCP-compatible client to the hosted endpoint using an API key.

    1. Obtain an API key from better-design.com/settings.
    2. Add the following configuration to your client's MCP settings:
    {
      "mcpServers": {
        "better-design": {
          "url": "https://better-design.com/api/mcp",
          "headers": { "Authorization": "Bearer YOUR_API_KEY" }
        }
      }
    }
  8. Install and Setup Better Design

    main

    To turn your AI coding IDE into a design engineer, install the Better Design agent skill and connect its MCP tools. This process detects your coding tools and connects the MCP without replacing existing configurations. No account is required for the local installation.

    Run the following commands once, then restart your coding agent (e.g., Claude Code, Cursor, VS Code/GitHub Copilot, or Claude Desktop):

    npx skills add marvkr/better-design --skill better-design
    npx better-design
  9. Connect via Claude Desktop (remote MCP)

    main

    To use Better Design with Claude Desktop, add the remote MCP configuration to your claude_desktop_config.json file located at ~/Library/Application Support/Claude/claude_desktop_config.json. After adding the config, restart Claude Desktop.

    {
      "mcpServers": {
        "better-design": {
          "url": "https://better-design.com/api/mcp",
          "headers": { "Authorization": "Bearer YOUR_API_KEY" }
        }
      }
    }
  10. Add a new design system to Better Design

    main

    To contribute a new design system, follow these steps:

    1. Create component overrides: Create a new folder in components/<your-system>/ containing the component TSX overrides. Note that design nuances (shadow layers, focus states, border thickness, hover transitions, and radius variations) should be captured in the component code rather than just CSS variables.
    2. Create registry entries: Create the corresponding registry entries in registry/<your-system>/.
    3. Index the system: Run the seed script to index the new design system.
  11. Install shadcn/ui components from Better Design

    main

    Better Design provides 31 open-source design systems for shadcn/ui. You can install specific components directly into your project using the npx shadcn command with the component's JSON registry URL.

    Pattern: npx shadcn@latest add https://www.better-design.com/registry/<design-system>/<component>.json

    Example (Installing Linear's button):

    npx shadcn@latest add https://www.better-design.com/registry/linear/button.json
  12. Prompting examples for Better Design

    main

    Once connected, you can use natural language to trigger the MCP tools. Here are common usage patterns:

    • Scaffolding a new feature: "Use better-design. Build a Linear-style project settings page with billing, team members, and API keys."
    • Discovering design systems: "Find a design system for a developer tools startup, then build the dashboard with matching components."
    • Reviewing existing UI: "Review this form with Better Design's accessibility and visual-design rules, then fix the issues."