# Server & watch: serve, watch, mcp

Run repowise serve for the API and local dashboard, repowise watch to auto-update on file save, or repowise mcp to expose the MCP server to your editor.

## `repowise serve`

Start the API server **and** the local web dashboard. The Next.js UI
is downloaded and cached on first run (~50 MB). Use `--no-ui` for
API-only mode.

```bash
repowise serve [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--port` | number | `7337` | API server port |
| `--host` | string | `127.0.0.1` | Host to bind to |
| `--workers` | number | `1` | Number of uvicorn workers |
| `--ui-port` | number | `3000` | Web UI port |
| `--no-ui` | boolean | `false` | Start the API server only |
| `--no-open` | boolean | `false` | Don't open the web UI in a browser. Env: REPOWISE_NO_OPEN |
| `--refresh-ui` | boolean | `false` | Force re-download of the web UI tarball, ignoring any cache |

```bash
repowise serve
repowise serve --port 8000 --ui-port 3001
repowise serve --no-ui                # headless / CI
repowise serve --refresh-ui           # bypass cache, pull latest UI tarball
```

The web UI needs Node >= 20; without it, `serve` falls back to API-only.
Once the UI answers, `serve` opens it in your browser, only in an interactive
terminal outside CI. `--no-open` or `REPOWISE_NO_OPEN=1` keeps it closed.

The dashboard exposes the chat, graph view, hotspots, ownership,
dead code, generated wiki, decision records, and cost tracking. It also shows
the running version in the sidebar footer, a dismissible "update available"
banner, and a what's-new view.

`serve` prints a one-line, non-blocking notice when a newer release is
available. See [Upgrading](https://docs.repowise.dev/upgrading) for the full upgrade flow.

---

## `repowise watch`

Filesystem watcher that triggers `update` on file changes. Debounced:
several rapid edits collapse into a single update cycle.

```bash
repowise watch [PATH] [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--provider` | string |  | LLM provider name |
| `--model` | string |  | Model identifier override |
| `--debounce` | number | `2000` | Debounce delay in milliseconds |
| `--workspace / -w` | boolean | `false` | Watch every repo in the workspace |
| `--no-workspace` | boolean | `false` | Force single-repo mode even when invoked from a workspace |
| `--index-only` | boolean | `false` | Skip LLM page regeneration on every trigger; keeps index, graph, and health current for free. Workspace mode is index-only either way. |
| `--verbose / -v` | boolean | `false` | Show debug logs from the pipeline |

```bash
repowise watch
repowise watch --debounce 1500
repowise watch --workspace
```

> **Note**
>
> For passive auto-sync, prefer the [post-commit hook](https://docs.repowise.dev/cli/hook).
> `watch` is best when you're actively coding and want the wiki current
> between commits.

---

## `repowise mcp`

Start the MCP server for editor integration. Exposes the
[ten flagship tools](https://docs.repowise.dev/mcp/overview) by default, plus `list_repos` in
workspace mode. Supports `stdio` (Claude Code,
Cursor, Cline), `streamable-http` (HTTP clients), and `sse` (legacy).

```bash
repowise mcp [PATH] [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--transport` | string | `stdio` | Transport: stdio (editors), streamable-http (HTTP clients), or sse (legacy) |
| `--port` | number | `7338` | Port for the HTTP/SSE transports |
| `--tools` | string |  | Override which tools are exposed. Comma-separated is an explicit allowlist; prefix names with +/- to adjust the default set, e.g. "+get_execution_flows,-get_dead_code" |
| `--all` | boolean | `false` | Expose every available tool, including opt-in and workspace tools |

```bash
repowise mcp                                    # stdio
repowise mcp /path/to/repo
repowise mcp --transport streamable-http
repowise mcp --transport sse --port 7338        # legacy
repowise mcp --tools "+get_execution_flows,-get_dead_code"
repowise mcp --all
```

`repowise init` writes a working `.mcp.json` for you, so you usually
don't run this command directly; your editor spawns it.
