# Install the Weir skill / MCP server

Weir's product surface is a set of `weir_*` tools an agent calls — not a GUI. This page registers
those tools in your agent host and verifies they loaded. Do this once per workspace, before
[Quickstart](/docs/quickstart/).

## Install

The toolkit ships as the npm package **`weir-toolkit`**. No account, no API key, no repo access:

```bash
npm install -g weir-toolkit
```

> **Note:** These docs describe the v4 toolkit, which needs `weir-toolkit >= 0.4.4` (the current
> published release). Run `weir --version` to check your installed version; do not copy a
> changing "latest" number from prose. The 0.4.0 release
> added `weir experiment-ship-winner` and the `weir components-sync --check` preflight; a toolkit
> older than 0.4.0 cannot run them. 0.4.5 is pending publish and will fix the package's bin alias
> so that `npx -y weir-toolkit init` works without the `-p` flag. If validation demands
> `specVersion: 3` or rejects `specVersion: 4` or a `custom` screen type, your toolkit is pre-v4.
> Upgrade it with `npm install -g weir-toolkit@latest`.

Or run it ad hoc with npx (no global install): `npx -y -p weir-toolkit weir init` is the
canonical cold-start command for one-off verbs. From weir-toolkit 0.4.5 onward, `npx -y
weir-toolkit init` works directly (no `-p` flag needed) once the bin-alias fix (roadmap 6.2) is
published.

The package provides two commands: `weir` (the CLI — every tool as a subcommand) and `weir-mcp`
(the MCP server — the identical tools over stdio for an agent host). The full tool list is on
[Reference → MCP tools](/docs/reference/#mcp-tools-cli-verbs). `weir walk`, `weir conform`, and
`weir release` drive a real headless Chromium via Playwright — install the browser binary once:

```bash
npx playwright install chromium
```

## Register the MCP server

### Claude Code / any `.mcp.json` host

Add a server entry to `.mcp.json` at the workspace root:

```json
{
  "mcpServers": {
    "weir": { "command": "npx", "args": ["-y", "-p", "weir-toolkit@latest", "weir-mcp"] }
  }
}
```

Restart the agent host so it re-reads `.mcp.json`. The `-p` flag is required — the package has
two executables, and `npx` needs it to resolve `weir-mcp`.

### Cursor / other MCP clients

Use the client's MCP-server config UI or file: command `npx`, args
`["-y", "-p", "weir-toolkit@latest", "weir-mcp"]`. The transport is stdio.

## Verify the toolset loaded

Ask the host to list its tools. You must see the `weir_*` tools (`weir_dev`, `weir_walk`,
`weir_conform`, `weir_embed`, `weir_release`, and the rest). If the list is empty, the server did
not register — run `npx -y -p weir-toolkit@latest weir-mcp` by hand; it should sit silently
waiting for a client (Ctrl-C to stop). If it errors instead, that error is the problem.

The CLI gives the same check without an agent host:

```
weir list
```

This prints every subcommand with its one-line description, straight from each tool's own
`description` field. If you see the verb list (`dev`, `walk`, `conform`, `embed`, `release`, …),
the toolkit is installed and current. That list is generated from the same source as the MCP
tools, so it can never drift from what the server exposes.

## Use the CLI as the fallback surface

Every MCP tool maps to one CLI verb: the tool name with the `weir_` prefix stripped and
underscores turned to dashes (`weir_app_status` becomes `app-status`). Run any verb like this:

```
weir <verb> --fieldName value
```

Flags are `--fieldName value`, parsed against the same schema as the MCP tool. Array fields need a
repeated flag, not space-separated values — pass `--personas "" --personas "purchase=cancel"`, not
`--personas "" "purchase=cancel"`. Exit code is 0 on success, 1 on a tool error, so the CLI is safe
in CI and `&&` chains.

## React Native / Expo

> **Warning:** Expo Go cannot load the required third-party native module. Use a development or release build.

## Next

- Scaffold a new app in one command: [weir init — scaffold a new app](/docs/init/).
- Author your first flow spec: [Author your first flow](/docs/first-flow/).
- Run the whole loop with no account and no server URLs: [Run everything locally](/docs/local/).
- The full command loop: [Quickstart](/docs/quickstart/).
