# Connect your AI coding tool (MCP)

> Let Claude Code, Codex, Cursor or VS Code find and install designs for you. How to connect, what each permission allows, how installs work, troubleshooting and disconnecting.

Canonical page: <https://aymu.dev/docs/mcp>

## How it works

MCP (Model Context Protocol) is an open standard for connecting AI tools to outside services. The Aymu MCP server lets an
AI coding tool, like Claude Code, Codex or Cursor, search the design library, read the details of a template or
section and, with your permission, prepare an install. You ask in plain words; the tool does the searching and
setup.

The server never writes to your computer. Files are written only by the command-line installer that runs in your own
terminal, after it has checked the download and shown you every file it will add.

You only need this for Astro projects in tools that can run commands. In Lovable, Bolt, Replit or any other AI
builder, copy the AI prompt from the design's page instead.

## Connecting

Add the server to your AI tool with the command or configuration on the [MCP page](/mcp), then start a session. The
tool opens a browser page where you sign in and choose what it may do. No API key or password goes into any
configuration file. Each connection is listed in your dashboard, where you can disconnect it.

## Permissions

| Permission    | What it allows                                                                                                         |
| ------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `mcp:read`    | Search templates and sections, read product details, list categories and recent releases, read your favorites and plan |
| `mcp:write`   | Create a selection board of candidate products for you to review, and add or remove favorites                          |
| `mcp:install` | Prepare an install of designs your purchase or plan covers, as a short-lived single-use grant for the installer        |

You can leave `mcp:install` unticked. The tool can then still search and suggest designs, but not prepare installs.

## Search

Search is keyword search over titles, summaries, tags and categories, with a fixed list of synonyms. When nothing
matches, the server says so and returns popular products instead, marked as a fallback.

## Selection boards

When your AI tool suggests several designs, it creates a selection board. You open the board's link, tick the items
you want and submit it. Only the items you selected can be installed together.

## Installing

1. Your AI tool runs the installer with `--begin` to create a one-time challenge on your machine.
2. It asks the server to prepare the install for the designs you chose. The server checks your access for each
   item and returns a single-use grant.
3. The installer redeems the grant and downloads each release (the published, versioned files of a design). It
   checks the signature and every file's checksum, shows the planned file changes and writes them only if nothing
   would be overwritten.

Hosted chat apps cannot run commands on your computer. There you run the installer yourself in a terminal, paste the
printed challenge into the chat, and pipe the returned grant back to the installer.

## What the server can and cannot see

The server records tool calls, access decisions, grants and downloads, and the installer's own report of the result.
It cannot see your files, your project, whether a build succeeded, or your conversation with the agent.

## Testing the connection

The official MCP Inspector lists the tools a server offers. Without signing in it shows the authorization challenge,
which is the expected first response. Replace `<server-url>` with the address on the [MCP page](/mcp).

```sh
npx @modelcontextprotocol/inspector --cli <server-url> --transport http --method tools/list
```

In your client, ask: "List the Astro section categories you can search."

## Troubleshooting

- **The client says it is not authorized.** Start the client's sign-in again (for example `/mcp` then
  Authenticate). Connections also end when you disconnect them from the dashboard.
- **An item is refused.** The reason is returned for each item: for example the design is not part of your
  purchases or plan, your email is not verified, or the daily fair-use limit was reached.
- **The installer refuses to write.** It found an existing file at a target path, an unexpected or unsafe archive
  entry, or a checksum that does not match the manifest (the signed list of files that ships with every release).
  Nothing has been written. Read the message, then retry.

## Disconnecting

Disconnect a client from **Dashboard → Connections**. Its tokens stop working, and installs it prepared but did not
finish are canceled.
