> ## Documentation Index
> Fetch the complete documentation index at: https://reikon.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Run MCP Without the Desktop App

> Host Reikon's MCP server from the rei CLI — for headless installs, CI, and terminal-first setups.

# Run MCP Without the Desktop App

The [`rei` CLI](https://www.npmjs.com/package/@reikondev/cli) ships the same MCP server
the desktop app does, and can host it directly. This is the path for a headless install,
a CI box, or anyone who works in the terminal — no app, no GUI, no account.

## 1. Install the CLI

```bash theme={null}
npm install -g @reikondev/cli
```

This gives you the `rei` command, which runs the same analyzers as the desktop app, fully
on your machine.

## 2. Warm the context (recommended)

```bash theme={null}
cd your-project
rei analyze
```

`rei analyze` writes a cached analysis the MCP server reads, so health and complexity
tools answer instantly. It's optional — see [Cold start](#cold-start) — but running it
once means the first agent call returns real data immediately.

## 3. Register the server

`rei mcp` runs the MCP server over stdio, scoped to whatever git repo it's launched in —
no "active project" file needed.

**Claude Code:**

```bash theme={null}
claude mcp add reikon -- rei mcp
```

**Cursor, Windsurf, or any MCP client** — point the agent's MCP config at the command:

```json theme={null}
{
  "mcpServers": {
    "reikon": { "command": "rei", "args": ["mcp"] }
  }
}
```

This is the standard MCP stdio config; only the `command`/`args` differ from the
desktop-app setup (which points at the app binary with `--mcp-server`).

## Cold start

If you skip `rei analyze`, the first **context-dependent** tool call
(`get_project_health`, `get_complexity_hotspots`, …) returns a short "run `rei analyze`"
hint and warms the context in the background — a retry a moment later succeeds. The
**diff and annotation tools** (`get_annotated_diff`, `list_annotations`,
`add_annotation_comment`, …) work immediately regardless, because they read live git and
your annotation file, not the cached analysis.

So the review loop is usable the instant the server connects; only the analysis-derived
tools need a warm-up.

## Shared state with the app

The CLI and the desktop app read and write the same on-disk state. Annotations an agent
writes through the CLI-hosted server show up in the app's Review tab, and replies you
make in the app are visible to the agent — whichever one is running.

## Next

See the [MCP tool reference](../reference/mcp-tools) for what each tool returns, or the
[Claude Code guide](./mcp-claude-code) for the automated desktop-app setup.
