# Use with your agent

Claude Code, Cursor, VS Code and Codex can install PixilUI items by name. One line sets up the project; the MCP server lets the agent search, read and install without leaving the chat.

## One line

Paste this into your agent. It checks the project first (React 19, Tailwind v4, your package manager), stops on Tailwind 3 instead of upgrading without asking, and ends with every file it changed.

```text
Set up PixilUI in this project by following https://pixilui.com/setup.md
```

| File | What it holds |
| --- | --- |
| `components.json` | the @pixilui registry |
| `components/pixilui/foundation.css` | tokens and motion, once |
| `AGENTS.md, .cursor/rules` | rules it reads every session |
| `.mcp.json` | the MCP server |

It never asks for a Pro key. If you have Pro, it tells you to run `npx pixilui@latest login` yourself. [setup.md](https://pixilui.com/setup.md) is written for the agent, step by step, if you want to read it first.

The rules are short on purpose: search the MCP server and read the item before building approval, run, tool call, thinking or streaming UI by hand; tokens only, never hex, `oklch()` or palette classes; one primary action per surface; restyle through `className` and data attributes; pending work through promises or `loading`, never `disabled`; motion from the `motion-*` utilities. The rest of `AGENTS.md` is never touched. Claude Code reads `CLAUDE.md`: if yours does not mention `AGENTS.md`, add a line `@AGENTS.md`.

## Connect the MCP server

Free items need no account. With Pro or Team, the Pro address opens the PixilUI login once and installs Pro items like free ones.

### Claude Code

Free:

```bash
claude mcp add --transport http pixilui https://mcp.pixilui.com/mcp
```

Pro or Team:

```bash
claude mcp add --transport http pixilui https://mcp.pixilui.com/mcp/pro
# then run /mcp in a session to log in
```

With Pro or Team, run `/mcp` in a session (or `claude mcp login pixilui`) to log in. Claude Code keeps the login for every session. `claude -p` and Agent SDK runs cannot open a browser: log in once in an interactive session first, or use a token.

### Cursor

Free:

```json .cursor/mcp.json
{
  "mcpServers": {
    "pixilui": { "url": "https://mcp.pixilui.com/mcp" }
  }
}
```

Pro or Team:

```json .cursor/mcp.json
{
  "mcpServers": {
    "pixilui": { "url": "https://mcp.pixilui.com/mcp/pro" }
  }
}
```

Put it in `.cursor/mcp.json` in the project, or `~/.cursor/mcp.json` for every project. Cursor starts the login when it connects; Settings, MCP shows the server waiting until you finish it in the browser.

### VS Code

Free:

```json .vscode/mcp.json
{
  "servers": {
    "pixilui": { "type": "http", "url": "https://mcp.pixilui.com/mcp" }
  }
}
```

Pro or Team:

```json .vscode/mcp.json
{
  "servers": {
    "pixilui": { "type": "http", "url": "https://mcp.pixilui.com/mcp/pro" }
  }
}
```

Copilot agent mode reads `.vscode/mcp.json`. Start the server; VS Code asks to allow the login and opens the browser.

### Codex

Free:

```toml ~/.codex/config.toml
[mcp_servers.pixilui]
url = "https://mcp.pixilui.com/mcp"
```

Pro or Team:

```toml ~/.codex/config.toml
[mcp_servers.pixilui]
url = "https://mcp.pixilui.com/mcp"
bearer_token_env_var = "PIXILUI_TOKEN"
```

Or run `codex mcp add pixilui --url https://mcp.pixilui.com/mcp`. Without `PIXILUI_TOKEN` set, Codex gets every free item.

## Logging in

The first time a client connects to the Pro address, three things happen. There is nothing to copy and no token in a config file.

- **The login opens.** Your browser opens the PixilUI login: Google, GitHub or an emailed code.
- **You allow the client.** A [consent screen](https://pixilui.com/account/consent) names it and what it can do.
- **The client keeps it.** Pro items install like free ones from then on.

Without a login or token the server answers every question about every item, and returns source and install commands for free items. For a Pro item it returns the description, props and notes, says it needs a license, and offers the free item closest to the job. A login without a license still gets every free item.

## Tokens for CI

Headless agents and CI cannot open a browser. Create an access token on [your account](https://pixilui.com/account#tokens), keep it in a secret, and send it to `/mcp`.

```bash
claude mcp add --transport http pixilui https://mcp.pixilui.com/mcp --header "Authorization: Bearer $PIXILUI_TOKEN"
```

In Cursor add `"headers": { "Authorization": "Bearer ${env:PIXILUI_TOKEN}" }` next to the `url`. The shadcn CLI reads `PIXILUI_TOKEN` from `.env.local`; `npx pixilui@latest login` writes it for you. A revoked token, or one whose license has ended, falls back to free items.

## What the agent can do

| Tool | Does |
| --- | --- |
| `search_items` | Finds items by what the UI has to do ("ask before the agent sends an email") |
| `list_items` | Every item, by category and tier |
| `get_item` | When to use it and when not, props, keyboard, accessibility, motion and notes for AI |
| `get_install_command` | One shadcn command for every item you need, with the `components.json` entry |
| `get_source` | The files with their paths, for projects that cannot run the CLI |
| `get_skill` | The PixilUI agent skill |

Agents that start local servers can run it from the CLI instead: `claude mcp add pixilui -- npx -y pixilui@latest mcp`. It forwards every request to the remote server and adds two tools that change your project, `init` and `add`. Tools that cannot use MCP can read the same data over HTTP: [`/openapi.json`](https://pixilui.com/openapi.json) describes the catalog and the registry, and none of it needs a key.

## Files agents read

Rebuilt with the registry on every release, so they never drift from the code.

| File | What it holds | Copy |
| --- | --- | --- |
| [`pixilui.com/llms.txt`](https://pixilui.com/llms.txt) | the index, by job | https://pixilui.com/llms.txt |
| [`pixilui.com/llms-full.txt`](https://pixilui.com/llms-full.txt) | every page in one file | https://pixilui.com/llms-full.txt |
| `pixilui.com/components/<item>/markdown` | each page as markdown | https://pixilui.com/components/approval-card/markdown |
| [`pixilui.com/setup.md`](https://pixilui.com/setup.md) | the setup, written for the agent | Set up PixilUI in this project by following https://pixilui.com/setup.md |
| `.claude/skills/pixilui/` | the agent skill | npx pixilui@latest skill |

Each item page also has Copy prompt, which copies instructions for a coding agent followed by the item's full markdown with every file, and Open in Claude or ChatGPT. Docs pages have the same markdown twin at `/docs/<page>/markdown`. The skill teaches the find, read, install, wire and review loop and every item by job; `npx shadcn@latest add @pixilui/skill` installs the same files.

## Try a prompt

```text
Find a PixilUI component that asks before the agent sends an email, read it, and install it.
```

```text
Add a PixilUI run timeline to the agent page and wire it to our run events. Read the item first.
```

Name the item, ask the agent to read the item's markdown page before writing code, and ask it to keep the semantic utilities (`bg-surface`, `text-secondary`, `rounded-control`).

## What it records

**The item, its tier, that it came through MCP, and the time.** With a login or token, your account and token id, so installs count against your license. No prompts, no searches, no project names, no file paths, no IP address. Requests are limited to 120 a minute; the limit reads your IP address and does not store it. The [privacy policy](https://pixilui.com/privacy) says the same.

## Questions

### Which component library works best with Claude Code?

One the agent can read and install without guessing: a shadcn registry for installs, a rules file it loads every session, an MCP server to search, and plain-text docs per item. PixilUI ships all four, and so do several other libraries; compare what their items cover and how they look.

### Does the MCP server need an account?

No, not for free items. Pro and Team log in from the browser through the `/mcp/pro` address, or use an access token in CI.

### Does it work with Codex and VS Code?

Yes. `AGENTS.md` is read by Codex, and the MCP setup above covers Codex and VS Code.

## Next steps

- [Theming](https://pixilui.com/docs/theming): style, accent, light and dark.
- [Browse components](https://pixilui.com/components): approval cards, run timelines, tool calls, streaming text and the basics every app needs, each finished.
- [License](https://pixilui.com/license): what the free and Pro licenses cover. Pro opens at launch.
