# How to use Claude Code with a reference library

Connect your reference library to Claude Code as an MCP server, tell it in CLAUDE.md to search references before UI work, then compare screenshots.

Published 2026-12-02 by Jeffrey Li · https://supertaster.me/blog/claude-code-with-a-reference-library

To use Claude Code with a reference library, connect the library as an MCP server, add a few lines to `CLAUDE.md` telling it to search your references before any visual work, and have it check a screenshot of the result against the references it used. If the library has no MCP server, put the images in the repository and point to them.

## How do I give Claude Code visual references?

There are three ways to give Claude Code visual references, from quickest to most durable.

1. **Paste or drag an image into the prompt.** Good for a single reference in a single session. It is gone when the conversation ends.
2. **Keep images in the repository.** Put them in a folder such as `design/references/` and tell Claude Code to read them. It can open image files by path. This lasts, but the references live in one project only, and the folder has no notes unless you write them.
3. **Connect a library over MCP.** MCP is the open standard agents use to connect to tools. The [MCP documentation](https://modelcontextprotocol.io/docs/getting-started/intro) gives building from a Figma design as an example of what Claude Code can do through a server. A reference library with an MCP server lets Claude Code search your saved references, look at the images and read your notes, in every project.

The third option is the one this post walks through. The general case for giving a model your references is in [how to give Claude your design taste](/blog/give-claude-your-design-taste) and the [guide to designing with AI from your own references](/guides/ai-design).

## How do I add a remote MCP server to Claude Code?

Add a remote server from your terminal with `claude mcp add`. The form below is from Anthropic's [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp), checked on 13 November 2026.

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

Replace `references` with any name you like and the URL with the one your library gives you, or let the [MCP server setup tool](/tools/mcp-server-setup) write the command for you.

1. Run the command in your project folder.
2. Start Claude Code and type `/mcp`.
3. Select the server and follow the sign-in steps in the browser.
4. Run `claude mcp list`, or look at the server's row in `/mcp`, to confirm it is connected.

By default the server is available in the current project only. To use it in all your projects, add `--scope user`:

```bash
claude mcp add --transport http references --scope user https://example.com/mcp
```

For a reference library, user scope is usually what you want, because your taste does not change from one repository to the next. Command syntax can change between versions, so check the documentation if the command is rejected.

## What should I put in CLAUDE.md so it checks references first?

Put a short, specific instruction in `CLAUDE.md` that says when to search, what to do with the results, and what to report. Claude Code reads this file at the start of a session.

```markdown
## Visual work

Before designing or restyling any UI, page, component or graphic:

1. Search my reference library for the kind of thing being made.
2. Look at the images, not only the titles and notes.
3. Pick two to four references and say what you take from each
   (type, spacing, color, layout). Say what you are not taking.
4. Build.
5. Tell me which references shaped the result.

If nothing in the library fits, say so and ask before inventing a style.
Do not copy a reference. Borrow its decisions.
```

Three details make this work:

- **Name the trigger.** "Before designing or restyling" tells it when the rule applies. A vague "use my references" gets skipped on small tasks.
- **Ask for a statement.** Step 3 forces a choice you can read and correct before any code is written.
- **Give it an exit.** The line about nothing fitting stops it from stretching an unrelated reference to cover the task.

Keep the section short. A long style guide in `CLAUDE.md` competes with the references themselves. More on that balance is in [how to stop AI coding agents from producing generic UI](/blog/stop-generic-ai-ui).

## What does a build look like?

Here is an illustrative session, not a record of a real one. Say the task is a pricing page.

You ask for the page. Claude Code searches the library for pricing pages, tables and landing pages, then opens the closest images. It replies with something like this: reference A for the oversized headline and tight line spacing, reference B for the single accent color used once, reference C for the plain three-column table with no card borders. It says it is not taking the dark background from B.

You correct one thing: the table from C is right, but the headline should be smaller. Then it builds. The correction took ten seconds because the plan was stated in terms of things you had both looked at.

## How do I have it compare a screenshot of its work with the reference?

Ask for the comparison explicitly, and give Claude Code a way to see the result.

1. **Get a screenshot.** If you have a browser tool connected, such as a Playwright MCP server, ask Claude Code to open the local page and capture it. Otherwise take a screenshot yourself and drag it into the prompt, or save it into the repository and give the path.
2. **Ask for a side-by-side review.** For example: "Compare this screenshot with references A and C. List the differences in type size, spacing, color and alignment. Do not fix anything yet."
3. **Choose what to fix.** Some differences are intended. Tell it which ones to close.
4. **Repeat once or twice.** Two rounds usually catch the obvious gaps. After that, your own eye is faster.

Asking for the list before the fixes matters. If you say "make it match", you get changes you cannot evaluate. If you get a list first, you decide.

## Which library to connect

Any reference library with a remote MCP server works with the steps above. [Supertaster](/) is one: it is an archive of your saved references that agents reach over MCP, where each item has the original image, a note on why you like it, tags and one theme. Connected agents search it before they design and tell you which references shaped the result.

If your references live in a tool with no MCP server, the repository folder works. Add a short text file beside the images saying what each one is for.
