# Install ui-references

ui-references is a private library of real UI (66,846 screens from 192 web and mobile apps,
5,627 curated designs) plus the **ui-references** skill, which turns it into a **Pattern brief**
before Claude Code or Codex builds a UI.

## Who can use it

Collaborators on [github.com/sandrotsurkava/ui-references](https://github.com/sandrotsurkava/ui-references)
who have **accepted the invitation**
([pending invitations](https://github.com/sandrotsurkava/ui-references/invitations)).
You sign in with GitHub in the browser. There is no token or key to copy.

## Install (one line)

```sh
curl -fsSL https://ui-mcp.purispuli.org/install.sh | sh
```

For whichever of `claude` and `codex` is installed, it adds the server, starts the browser sign-in
(**Allow**, then **Authorize** on GitHub) and installs the skill, one `SKILL.md`, into each CLI's
user skills folder:

- Claude Code: `~/.claude/skills/ui-references/SKILL.md`
- Codex: `~/.agents/skills/ui-references/SKILL.md`

It skips what is already set up or up to date, asks for no secrets and stores none. It removes
copies of the skill under its old name, `reference-first-design`, that it wrote itself, and
leaves anything else alone. Read it first if you like: <https://ui-mcp.purispuli.org/install.sh>.
Add `-s -- --no-login` after `sh` to sign in later, `-s -- --skill-only` to only install or
update the skill, or `-s -- --no-skill` to skip it. Then start a new session.

## How to use

- In a prompt: `use ui-references: pricing page with three tiers, web`
- In a project's `CLAUDE.md` or `AGENTS.md`, one line:
  `For UI design or prototyping in this project, use ui-references for real-world references first.`
- Call the skill by name: `/ui-references` in Claude Code, `$ui-references` in Codex.
- It respects your design system: the brief starts with `Design system: …` (found in CLAUDE.md /
  AGENTS.md, the repo's tokens or an attached design tool, or "none found"); say "ignore our
  design system" for a fresh look.

It also suggests itself on clear UI requests ("build a settings screen for iOS"), and leaves
other work alone. When it is used, the agent searches the library, shows a **Pattern brief**
before it builds anything, builds in whatever form it normally uses (another installed design
skill may build from the brief), and ends with **References** (app or creator, source link).

## By hand

Claude Code:

```sh
claude mcp add --transport http --scope user ui-references https://ui-mcp.purispuli.org/mcp
curl -fsSL https://ui-mcp.purispuli.org/install.sh | sh -s -- --skill-only
```

Then start a new Claude Code session, run `/mcp`, pick **ui-references** and choose
**Authenticate**. In the browser: **Allow**, then **Authorize** on GitHub.
(From a terminal instead: `claude mcp login ui-references`.)
Check: `claude mcp list` shows `ui-references: https://ui-mcp.purispuli.org/mcp (HTTP) - ✔ Connected`.

Codex:

```sh
codex mcp add ui_references --url https://ui-mcp.purispuli.org/mcp
codex mcp login ui_references
curl -fsSL https://ui-mcp.purispuli.org/install.sh | sh -s -- --skill-only
```

The browser opens: **Allow**, then **Authorize** on GitHub. Recent Codex versions start this
sign-in already during `codex mcp add` and wait for it; then the login command just confirms it.
Over SSH: `codex mcp login ui_references --no-browser`, and paste the redirect URL back.
Check: `codex mcp list` shows `ui_references`, and in a new Codex session `/skills` lists
`ui-references`.

The Claude Code plugin (`ui-references@ui-references`) is optional and ships the same skill. You
don't need it with the steps above; if you have it, uninstall it
(`claude plugin uninstall ui-references@ui-references`) or update it to 0.6.0, so there is one
copy of the skill.

## For agents

Don't clone, pip install or run anything; the server is hosted. Run the commands above, then
ask the user to finish the browser sign-in.

The commands edit the user's own config (`~/.claude.json`, `~/.codex/config.toml`) and skills
folders (`~/.claude/skills`, `~/.agents/skills`). If your sandbox can't write there, ask the user
to run them. All are safe to run again. `codex mcp add` may open the browser and wait until the
user has signed in: tell the user to click Allow and Authorize while it waits. If it was cut off,
run `codex mcp login ui_references`.

## If it doesn't work

**The browser says "… is not a collaborator".** The GitHub account you signed in with has no
access yet. Check which account the page names (work vs personal: sign out of GitHub or use a
private window), accept the invitation at
<https://github.com/sandrotsurkava/ui-references/invitations>, or ask Sandro to add you. Then
sign in again.

**"Needs authentication" (Claude Code) or "not logged in" / 401 (Codex).** The sign-in hasn't
happened or has lapsed. Claude Code: `/mcp` → ui-references → Authenticate, or
`claude mcp login ui-references`. Codex: `codex mcp login ui_references`. Then start a new
session.

**"Could not check access".** The server couldn't reach GitHub. Try again in a minute; if it
keeps happening, tell Sandro.

**The skill isn't used.** Check it is installed (`/skills` in Codex; `/ui-references` in Claude
Code), run the `--skill-only` line again, start a new session, and say "use ui-references" in the
prompt or put the line above in the project's `CLAUDE.md` / `AGENTS.md`.

**"Failed to connect".** Open <https://ui-mcp.purispuli.org/healthz>: it should say
`{"status": "ok", "db": true}`. If not, the server is down: tell Sandro.

## Remove

```sh
claude mcp remove ui-references -s user
codex mcp remove ui_references
rm -r ~/.claude/skills/ui-references ~/.agents/skills/ui-references
```
