Skip to main content
Glama
Cozy UI MCP Server

Cozy UI MCP Server

Install with an AI agent

Paste this prompt into Claude Code, Cursor or GitHub Copilot. The agent detects your stack, picks the npm package, the shadcn registry or CSS only, installs it, adds the imports, renders one sample button and runs your build.

Install Cozy UI in this project. Cozy UI is an MIT React UI kit with shadcn/ui component APIs, built on Radix UI. Docs: https://0xtrou.github.io/cozy-ui/ (plain text: https://0xtrou.github.io/cozy-ui/llms.txt). Do the steps in order. Use the project's package manager (from the lock file: pnpm, yarn, bun or npm) for every install. Do not change unrelated code.

1. Detect the stack. Read package.json, the lock file and the config files, then tell me:
   - React version ("react" in package.json), or "no React".
   - Framework or bundler: Next.js (App Router or Pages Router), Vite, Remix / React Router, Astro, or other.
   - Tailwind CSS v4: yes if "tailwindcss" is version 4 or later, or a CSS file has @import "tailwindcss".
   - shadcn/ui: yes if components.json exists at the project root.

2. Pick exactly one path and tell me which and why:
   - A. shadcn registry: components.json exists AND Tailwind CSS v4 is used. The source is copied into the repo.
   - B. npm package: React 18 or 19, every other React case (no Tailwind, Tailwind v3, or no components.json).
   - C. CSS only: no React (Vue, Svelte, plain HTML, server templates).
   If React is older than 18, stop and tell me.

3. Install.
   - A. In components.json, add this key next to the existing ones:
       "registries": { "@cozy": "https://0xtrou.github.io/cozy-ui/r/{name}.json" }
     Then run: npx shadcn@latest add @cozy/cozy-theme @cozy/button
     Then install @fontsource/nunito.
   - B. Install @0xtrou/cozy-ui.
   - C. Nothing to install.

4. Add the styles once, at the app root.
   - A. In the global CSS file that imports Tailwind (for example app/globals.css or src/index.css), after the shadcn theme variables:
       @import "@fontsource/nunito/400.css";
       @import "@fontsource/nunito/200.css";
       @import "<relative path to the cozy.css the CLI wrote, usually styles/cozy.css>";
   - B. In the root entry file (Next.js App Router: app/layout.tsx; Pages Router: pages/_app.tsx; Vite: src/main.tsx; Remix / React Router: app/root.tsx):
       import "@0xtrou/cozy-ui/fonts.css";
       import "@0xtrou/cozy-ui/styles.css";
     If Tailwind CSS v4 is used, import "@0xtrou/cozy-ui/cozy.css" instead of "@0xtrou/cozy-ui/styles.css", so utilities are not shipped twice.
   - C. In the <head> of the main HTML template:
       <link rel="stylesheet" href="https://unpkg.com/@0xtrou/cozy-ui/dist/fonts.css" />
       <link rel="stylesheet" href="https://unpkg.com/@0xtrou/cozy-ui/dist/cozy.css" />
   In every path, give the page the kit's background and type in the global CSS:
       body { background: var(--cz-page); color: var(--cz-text); font-family: var(--cz-font-family); }

5. Palette (only if I asked for one). Set data-palette on the <html> element: village, meadow, lotus, river or lantern (dark). With no attribute the page follows the system: Village in light mode, Lantern in dark mode. For Liquid Glass, also set data-material="glass".

6. Verify with one sample. Add one button to an existing page:
   - A. import { Button } from "@/components/ui/button" (use the "ui" alias from components.json), then <Button variant="reward">Harvest</Button>
   - B. import { Button } from "@0xtrou/cozy-ui", then <Button variant="reward">Harvest</Button>
   - C. <button class="cz-button cz-button--reward">Harvest</button>
   If the app uses toast: mount <Toaster /> once at the root (B: import { Toaster, toast } from "@0xtrou/cozy-ui"; A: run npx shadcn@latest add @cozy/sonner, then import { Toaster } from "@/components/ui/sonner" and toast from "sonner").
   If the app uses Tooltip: wrap the root in <TooltipProvider> (B: from "@0xtrou/cozy-ui"; A: from "@/components/ui/tooltip").

7. Run the project's build and type check: the "build" and "typecheck" scripts in package.json if they exist, otherwise npx tsc --noEmit. Fix any error you caused.

8. Report the path you chose, every file you changed and the command results. Then suggest the Cozy UI MCP server, so you can look up components and props from the real docs:
   Claude Code: claude mcp add cozy-ui -- npx -y @0xtrou/cozy-ui-mcp
   Cursor, VS Code, Claude Desktop (mcpServers config): "cozy-ui": { "command": "npx", "args": ["-y", "@0xtrou/cozy-ui-mcp"] }

Contents: Install · Guide · Examples · Components · Contributing · License

Related MCP server: mcp-llm

Install

Pick one. All three give you the same look.

npm package: React 18 or 19, no Tailwind needed.

npm install @0xtrou/cozy-ui

Import the styles once, in your root entry file (Vite: src/main.tsx; Next.js App Router: app/layout.tsx; Pages Router: pages/_app.tsx; Remix / React Router: app/root.tsx):

import "@0xtrou/cozy-ui/fonts.css";  // Nunito
import "@0xtrou/cozy-ui/styles.css"; // tokens, palettes, components, motion
// Already on Tailwind CSS v4? Import "@0xtrou/cozy-ui/cozy.css" instead of styles.css.

import { Button } from "@0xtrou/cozy-ui"; // or: import { Button } from "@0xtrou/cozy-ui/button";

Using toast? Mount <Toaster /> once at the root. Using Tooltip? Wrap the app in <TooltipProvider>. Both come from @0xtrou/cozy-ui.

shadcn registry: the source is copied into your repo, so you own and edit it. Needs shadcn/ui (components.json) with Tailwind CSS v4.

  1. Add the registry to components.json:

    { "registries": { "@cozy": "https://0xtrou.github.io/cozy-ui/r/{name}.json" } }
  2. Add the theme and components, and install the font:

    npx shadcn@latest add @cozy/cozy-theme @cozy/button @cozy/card
    npm install @fontsource/nunito
  3. In your global CSS file (for example app/globals.css), after the shadcn variables. cozy-theme writes styles/cozy.css; use the relative path to it:

    @import "@fontsource/nunito/400.css";
    @import "@fontsource/nunito/200.css";
    @import "./styles/cozy.css";

CSS only: Vue, Svelte or plain HTML. You get the look and motion; behaviour is yours.

<link rel="stylesheet" href="https://unpkg.com/@0xtrou/cozy-ui/dist/fonts.css" />
<link rel="stylesheet" href="https://unpkg.com/@0xtrou/cozy-ui/dist/cozy.css" />
<button class="cz-button cz-button--reward">Harvest</button>

Every path: give the page the kit's background and type with body { background: var(--cz-page); color: var(--cz-text); font-family: var(--cz-font-family); }.

Full steps for each: Installation. Each docs page also has a Markdown version for agents: add .md to the path, for example docs/components/button.md.

Guide

Match your brand with a palette. Five palettes share one set of colour roles; every text pair passes WCAG AA. Set it on the page or any section:

<html data-palette="meadow">   <!-- village · meadow · lotus · river · lantern (dark) -->

No attribute: Village by day, Lantern at night (follows the system). Palettes

Go Liquid Glass. Add data-material="glass" to the page or a section. Following Apple's guidance, the layer that floats over content (buttons, tabs, toggles, menus, dialogs, sheets) turns into clear glass capsules and boards, while cards and inputs keep the cozy plastic. Text passes WCAG AA in every palette, and glass turns solid under prefers-reduced-transparency. Materials

Keep bundles small. Each component is its own ES module, so you ship only what you import. A Button-only app adds about 11 KB gzip. Import one directly if you like: import { Button } from "@0xtrou/cozy-ui/button".

Already on Tailwind CSS v4? Import @0xtrou/cozy-ui/cozy.css instead of styles.css so utilities are not shipped twice.

Respect motion settings. Presses squash, sheets slide, rewards bounce (80–360 ms), all off under prefers-reduced-motion. Add motion to your own elements with cz-motion-* classes. Motion

Hand off to design. @0xtrou/cozy-ui/tokens.json holds radius, depth, shadows, spacing, type, motion and palettes; CSS variables are --cz-*. Tokens

Let your AI assistant write it right. The MCP server gives Claude, Cursor or VS Code the real docs, props and install commands:

claude mcp add cozy-ui -- npx -y @0xtrou/cozy-ui-mcp

Other clients (Cursor, VS Code, Claude Desktop): "cozy-ui": { "command": "npx", "args": ["-y", "@0xtrou/cozy-ui-mcp"] } under mcpServers. Also works with mcpfs. Plain text: llms.txt and llms-full.txt. MCP server

0xtrou/cozy-ui MCP server

Try it before installing: the Glama listing shows the server's tools and quality score, and you can call them online with the MCP Inspector.

Use the same look in a Unity game. Tokens become USS variables; class names stay. Unity UI Toolkit

Examples

A reward button with a toast

import { Button, Toaster, toast } from "@0xtrou/cozy-ui";

export function Harvest() {
  return (
    <>
      <Toaster />
      <Button variant="reward" onClick={() => toast.success("Harvested!", { description: "+14 coins" })}>Harvest</Button>
    </>
  );
}

A card with progress

import { Card, CardHeader, CardTitle, CardDescription, CardContent, Progress } from "@0xtrou/cozy-ui";

export function Field() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Rice field</CardTitle>
        <CardDescription>Ready in 2 minutes</CardDescription>
      </CardHeader>
      <CardContent><Progress value={70} tone="success" aria-label="Growth" /></CardContent>
    </Card>
  );
}

A confirm dialog

import { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@0xtrou/cozy-ui";

export function RemoveCoop() {
  return (
    <Dialog>
      <DialogTrigger asChild><Button variant="destructive">Remove coop</Button></DialogTrigger>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>Remove the chicken coop?</DialogTitle>
          <DialogDescription>The plot becomes empty again.</DialogDescription>
        </DialogHeader>
        <DialogFooter>
          <DialogClose asChild><Button variant="secondary">Keep it</Button></DialogClose>
          <DialogClose asChild><Button variant="destructive">Remove</Button></DialogClose>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}

A data table with sort, search, filters, selection and paging: Data Table.

Games and blocks built only from Cozy UI

Play them in the browser; the source is one file each.

Tiny Farm

Memory Match

Plant, wait, harvest, buy upgrades in a sheet, pick a reward when you level up.

Flip cards to find pairs; a dialog scores you with stars.

Bop the Mole

Village HUD (block)

30-second rounds, three difficulties, a timer bar and a score dialog.

Resource chips, a floating harvest button and a level-up sheet.

Components

30 components with shadcn APIs, on Radix UI. Each page has live previews, props and source.

Group

Components

Forms

Button · Input · Textarea · Label · Checkbox · Radio Group · Switch · Slider · Select · Toggle Group · Calendar

Layout

Card · Tabs · Accordion · Separator

Overlays

Dialog · Sheet · Popover · Dropdown Menu · Tooltip

Feedback

Alert · Toast · Progress · Skeleton

Data display

Table · Data Table · Badge · Avatar

Navigation

Breadcrumb · Pagination

Customize it for your brand

Need Cozy UI in your own colours, type and material, or components your product needs? DM @_trou3 on X.

Contributing

Bug reports, component ideas and pull requests are welcome. Setup, project layout, component rules and releases: CONTRIBUTING.md.

License

MIT. Nunito is under the SIL Open Font License 1.1.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers