# MCP setup

> Connect Claude Code, Cursor or any MCP client to designlang, locally or hosted.

Page: https://designlang.app/docs/mcp

designlang speaks the Model Context Protocol in two ways. A local server comes with the free CLI. The hosted Brand Context server serves a saved project over HTTP.

## Local (free)

The local server exposes your latest extraction as resources and tools over stdio. Run an extraction first, then add the server.

```
npx designlang stripe.com
claude mcp add designlang -- npx designlang mcp
```

For Cursor or another client, use a stdio entry that runs `npx designlang mcp`. The server reads the extraction from `./design-extract-output`, or the folder you pass with `--output-dir`.

## Hosted Brand Context

1. Open a saved project in [your projects](https://app.designlang.app/projects) and go to Connect.
2. Copy the command for your client.

The Connect tab shows the exact URL for your deployment, and ready snippets for Cursor and for a shared `.mcp.json` that reads the token from `DESIGNLANG_KEY`, so a committed file holds no secret.

### Tools

| Tool | What it does |
|---|---|
| `get_brand_rules` | Rules for writing UI with this system. |
| `get_design_md` | Colour, type, scales and motion as DESIGN.md. |
| `get_snapshot_info` | Which snapshot is being served. |
| `find_nearest_token` | The closest token to a value you give. |
| `check_code` | Lint a piece of code against the system. |
| `verify_ui` | Render a page and list every drift from your confirmed brand, with a fix. See [Verify & Fix](https://designlang.app/docs/verify). |

Each key is limited to 60 requests a minute. Revoke a token from the project at any time.

## Brand Check in CI

Lint files on your own machine against a saved project, without sending your code anywhere:

```
DESIGNLANG_KEY=<your project key> npx designlang check src --context https://designlang.app
```
