# MCP server and agent setup

> Give Claude Code, Cursor, Windsurf and Copilot the Patine UI docs through an MCP server, llms-full.txt and an AGENTS.md snippet, so coding agents write React Native UI with the right props.

Patine is built to be written by coding agents. Pick one or more of these; they all serve the same docs.

## 1. The MCP server

`@patine-ui/mcp` is a tiny [Model Context Protocol](https://modelcontextprotocol.io) server with zero dependencies. It reads `llms-full.txt` from the `patine-ui` installed in your project, so answers match your version and work offline.

Claude Code:

```bash
claude mcp add patine -- npx -y @patine-ui/mcp
```

Cursor, Windsurf, VS Code and other clients (`mcp.json`):

```json
{
  "mcpServers": {
    "patine": { "command": "npx", "args": ["-y", "@patine-ui/mcp"] }
  }
}
```

It gives the agent three tools:

| Tool | Does |
| --- | --- |
| `list_components` | Every docs page with a one-line summary |
| `get_component_docs` | One page as Markdown, e.g. `{ "name": "DatePicker" }`: props, examples, platform notes |
| `search_docs` | The best pages for a query, e.g. "min nights date range"; then matching Pro charts, blocks and app templates, tagged Pro |
| `search_icons` | Icons in the free set ([`@patine-ui/icons`](../components/icons#free-icons)) by name or meaning, e.g. `{ "query": "notification" }`, then matching Pro icons and brand logos, tagged Pro |

Set `PATINE_DOCS=/path/to/llms-full.txt` to read another copy. Without `patine-ui` installed it fetches this site's copy.

## 2. An AGENTS.md line

Agents read `AGENTS.md` (or `CLAUDE.md`, `.cursor/rules`) before writing code. Add:

```md
## UI
Build screens with patine-ui. Before writing UI code, read
node_modules/patine-ui/llms-full.txt (or use the patine MCP server) for components and props.
Use shadcn-style props: variant, size, value + onValueChange, checked + onCheckedChange.
```

## 3. The files

| File | Contents |
| --- | --- |
| [`/llms.txt`](pathname:///llms.txt) | Index of every page with a one-line summary |
| [`/llms-full.txt`](pathname:///llms-full.txt) | The whole docs in one Markdown file |
| `node_modules/patine-ui/llms-full.txt` | The same, matched to your installed version |
| `/docs/**/*.md` | Each page as plain Markdown |

The compact cheat sheet is on [For AI assistants](./ai).

## Why agents get it right

- **Names they already know.** Props follow shadcn/ui and Radix, so models have seen them thousands of times.
- **Types that fail the build.** A wrong prop is a TypeScript error, not a broken screen.
- **One package, no setup.** No native modules, Babel plugins or Tailwind config for the agent to get wrong.
- **Screens to copy.** [Pro templates](/templates) use only public `patine-ui` exports, so an agent can adapt them line by line.
