Skip to main content
Glama
Cozy UI MCP Server

Cozy UI MCP Server

README.md
<p align="center">
  <a href="https://0xtrou.github.io/cozy-ui/">
    <img src="public/logo-badge.svg" alt="Cozy UI" height="88" />
  </a>
</p>

<p align="center"><b>Cozy 3D components for shadcn/ui.</b><br />
Chunky, toy-like React components you can press: a plastic face, a solid wall and a soft shadow,<br />
springy motion and five palettes. Built on Radix UI and Tailwind CSS v4.</p>

<p align="center">
  <a href="https://0xtrou.github.io/cozy-ui/"><img alt="Docs" src="https://img.shields.io/badge/docs-0xtrou.github.io%2Fcozy--ui-C65A3A?style=flat-square" /></a>
  <a href="https://github.com/0xtrou/cozy-ui/actions/workflows/pages.yml"><img alt="Deploy" src="https://img.shields.io/github/actions/workflow/status/0xtrou/cozy-ui/pages.yml?branch=main&style=flat-square&label=deploy" /></a>
  <a href="https://www.npmjs.com/package/@0xtrou/cozy-ui"><img alt="npm" src="https://img.shields.io/npm/v/@0xtrou/cozy-ui?style=flat-square&color=C65A3A&label=npm" /></a>
  <a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-4F7330?style=flat-square" /></a>
  <a href="https://github.com/0xtrou/cozy-ui/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/0xtrou/cozy-ui?style=flat-square&color=E2A93A" /></a>
  <a href="https://ui.shadcn.com/docs/registry"><img alt="shadcn registry" src="https://img.shields.io/badge/shadcn-registry-3B2618?style=flat-square" /></a>
  <img alt="React 19" src="https://img.shields.io/badge/React-19-2D6A92?style=flat-square" />
  <img alt="Tailwind CSS v4" src="https://img.shields.io/badge/Tailwind_CSS-v4-2D6A92?style=flat-square" />
</p>

<!-- Trendshift: once the repo is listed on https://trendshift.io, replace REPO_ID and uncomment.
<p align="center">
  <a href="https://trendshift.io/repositories/REPO_ID" target="_blank"><img src="https://trendshift.io/api/badge/repositories/REPO_ID" alt="0xtrou/cozy-ui | Trendshift" width="250" height="55" /></a>
</p>
-->

## 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.

<!-- agent-prompt:start -->
```text
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"] }
```
<!-- agent-prompt:end -->

<p align="center">
  <a href="https://0xtrou.github.io/cozy-ui/"><img src="public/og.png" alt="Cozy UI buttons, switch, badges, progress bar and a card" width="820" /></a>
</p>

**Contents:** [Install](#install) · [Guide](#guide) · [Examples](#examples) · [Components](#components) · [Contributing](#contributing) · [License](#license)

## Install

Pick one. All three give you the same look.

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

```bash
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`):

```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`:

   ```json
   { "registries": { "@cozy": "https://0xtrou.github.io/cozy-ui/r/{name}.json" } }
   ```

2. Add the theme and components, and install the font:

   ```bash
   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:

   ```css
   @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.

```html
<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](https://0xtrou.github.io/cozy-ui/docs/installation/). Each docs page also has a Markdown version for agents: add `.md` to the path, for example [`docs/components/button.md`](https://0xtrou.github.io/cozy-ui/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
<html data-palette="meadow">   <!-- village · meadow · lotus · river · lantern (dark) -->
```

No attribute: Village by day, Lantern at night (follows the system). [Palettes](https://0xtrou.github.io/cozy-ui/docs/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](https://0xtrou.github.io/cozy-ui/docs/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](https://0xtrou.github.io/cozy-ui/docs/motion/)

**Hand off to design.** `@0xtrou/cozy-ui/tokens.json` holds radius, depth, shadows, spacing, type, motion and palettes; CSS variables are `--cz-*`. [Tokens](https://0xtrou.github.io/cozy-ui/docs/tokens/)

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

```bash
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](https://github.com/openai/mcpfs). Plain text: [`llms.txt`](https://0xtrou.github.io/cozy-ui/llms.txt) and [`llms-full.txt`](https://0xtrou.github.io/cozy-ui/llms-full.txt). [MCP server](https://0xtrou.github.io/cozy-ui/docs/mcp/)

[![0xtrou/cozy-ui MCP server](https://glama.ai/mcp/servers/0xtrou/cozy-ui/badges/score.svg)](https://glama.ai/mcp/servers/0xtrou/cozy-ui)

Try it before installing: the [Glama listing](https://glama.ai/mcp/servers/0xtrou/cozy-ui) shows the server's tools and quality score, and you can call them online with the [MCP Inspector](https://glama.ai/mcp/inspector).

**Use the same look in a Unity game.** Tokens become USS variables; class names stay. [Unity UI Toolkit](https://0xtrou.github.io/cozy-ui/docs/unity/)

## Examples

**A reward button with a toast**

```tsx
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**

```tsx
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**

```tsx
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](https://0xtrou.github.io/cozy-ui/docs/components/data-table/).

### Games and blocks built only from Cozy UI

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

| [Tiny Farm](https://0xtrou.github.io/cozy-ui/demos/tiny-farm/) | [Memory Match](https://0xtrou.github.io/cozy-ui/demos/memory-match/) |
|---|---|
| [<img src=".github/readme/tiny-farm.png" alt="Tiny Farm: plots of rice ready to harvest" width="400" />](https://0xtrou.github.io/cozy-ui/demos/tiny-farm/) | [<img src=".github/readme/memory-match.png" alt="Memory Match: a grid of cards to flip" width="400" />](https://0xtrou.github.io/cozy-ui/demos/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**](https://0xtrou.github.io/cozy-ui/demos/bop-the-mole/) | [**Village HUD** (block)](https://0xtrou.github.io/cozy-ui/blocks/village-hud/) |
| [<img src=".github/readme/bop-the-mole.png" alt="Bop the Mole: holes with a timer bar" width="400" />](https://0xtrou.github.io/cozy-ui/demos/bop-the-mole/) | [<img src=".github/readme/village-hud.png" alt="Village HUD: resource chips over a village scene" width="400" />](https://0xtrou.github.io/cozy-ui/blocks/village-hud/) |
| 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](https://0xtrou.github.io/cozy-ui/docs/components/button/) · [Input](https://0xtrou.github.io/cozy-ui/docs/components/input/) · [Textarea](https://0xtrou.github.io/cozy-ui/docs/components/textarea/) · [Label](https://0xtrou.github.io/cozy-ui/docs/components/label/) · [Checkbox](https://0xtrou.github.io/cozy-ui/docs/components/checkbox/) · [Radio Group](https://0xtrou.github.io/cozy-ui/docs/components/radio-group/) · [Switch](https://0xtrou.github.io/cozy-ui/docs/components/switch/) · [Slider](https://0xtrou.github.io/cozy-ui/docs/components/slider/) · [Select](https://0xtrou.github.io/cozy-ui/docs/components/select/) · [Toggle Group](https://0xtrou.github.io/cozy-ui/docs/components/toggle-group/) · [Calendar](https://0xtrou.github.io/cozy-ui/docs/components/calendar/) |
| Layout | [Card](https://0xtrou.github.io/cozy-ui/docs/components/card/) · [Tabs](https://0xtrou.github.io/cozy-ui/docs/components/tabs/) · [Accordion](https://0xtrou.github.io/cozy-ui/docs/components/accordion/) · [Separator](https://0xtrou.github.io/cozy-ui/docs/components/separator/) |
| Overlays | [Dialog](https://0xtrou.github.io/cozy-ui/docs/components/dialog/) · [Sheet](https://0xtrou.github.io/cozy-ui/docs/components/sheet/) · [Popover](https://0xtrou.github.io/cozy-ui/docs/components/popover/) · [Dropdown Menu](https://0xtrou.github.io/cozy-ui/docs/components/dropdown-menu/) · [Tooltip](https://0xtrou.github.io/cozy-ui/docs/components/tooltip/) |
| Feedback | [Alert](https://0xtrou.github.io/cozy-ui/docs/components/alert/) · [Toast](https://0xtrou.github.io/cozy-ui/docs/components/toast/) · [Progress](https://0xtrou.github.io/cozy-ui/docs/components/progress/) · [Skeleton](https://0xtrou.github.io/cozy-ui/docs/components/skeleton/) |
| Data display | [Table](https://0xtrou.github.io/cozy-ui/docs/components/table/) · [Data Table](https://0xtrou.github.io/cozy-ui/docs/components/data-table/) · [Badge](https://0xtrou.github.io/cozy-ui/docs/components/badge/) · [Avatar](https://0xtrou.github.io/cozy-ui/docs/components/avatar/) |
| Navigation | [Breadcrumb](https://0xtrou.github.io/cozy-ui/docs/components/breadcrumb/) · [Pagination](https://0xtrou.github.io/cozy-ui/docs/components/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](https://x.com/_trou3).

## Contributing

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

## License

[MIT](LICENSE). Nunito is under the SIL Open Font License 1.1.