# Coding agents and MCP

> The skill for agents with a shell, and the read-only MCP server for agents without one.

Source: https://warmbuild.dev/docs/agents/

**What you do**

1. Install the skill, for Claude Code, Codex, Cursor and other agents.

   ``` title="Terminal"
   npx skills add warmbuild/action
   ```
2. No shell (Claude on the web, cloud agents)? Add the read-only MCP server instead.

   ``` title="MCP server URL"
   https://mcp.warmbuild.dev/mcp
   ```
3. Ask the agent to set up Warmbuild. It follows [these steps](#agent-setup) and hands you the two that need a person.

**What you get**

Agents start and check the cache, run the tests a change reaches, and read the CI report: slow and flaky tests, findings, why a target missed.

## Coding agents: the skill

Tells coding agents what the warmbuild commands do: status, start/stop, hits and misses, test selection, and the CI report commands (builds, report, findings, why-miss, tests --slow/--flaky).

- For one repository, use `.claude/skills/warmbuild/` instead.
- Any agent: `npx skills add warmbuild/action` (the open skills CLI) finds the skill in the Action's repository and installs it for Claude Code, Codex, Cursor and others.
- For other agents (Codex, Cursor), paste [the AGENTS.md snippet](https://github.com/warmbuild/action/blob/v1.14.2/skills/warmbuild/AGENTS-snippet.md) into AGENTS.md.
- No shell (Claude on the web, cloud agents)? Add the MCP server `https://mcp.warmbuild.dev/mcp` ([how](https://warmbuild.dev/docs/agents/#mcp)).

``` title="Claude Code"
mkdir -p ~/.claude/skills/warmbuild && curl -fsSL \
  https://raw.githubusercontent.com/warmbuild/action/v1.14.2/skills/warmbuild/SKILL.md \
  -o ~/.claude/skills/warmbuild/SKILL.md
```

## Set it up from an agent

An agent can follow these steps in order. Two need a person, and the agent hands them over: installing the GitHub App and entering the sign-in code. On anything but a Mac (Linux, a cloud agent), skip steps 2 to 4.

1. **Ask for the GitHub App.** The person signs in at [https://warmbuild.dev/app/](https://warmbuild.dev/app/) with GitHub and installs the Warmbuild GitHub App on the account that owns the repository. The App reads metadata, never code. Nothing else works until it is installed.
2. **Install the CLI** in the repository root.

   ``` title="Terminal"
   curl -fsSL https://warmbuild.dev/install.sh | sh -s -- --add-to-path
   # or, with Node.js: brew install warmbuild/tap/warmbuild
   ```

   - Needs macOS and Xcode 26 or 27. The installer fetches one binary, with no Node.js; the Homebrew formula installs the Node.js build.
     - Installs to `~/.warmbuild/bin` without sudo and links `warmbuild` into `~/.local/bin`.
3. **Sign in.** `warmbuild login` prints a GitHub URL and a code:

   - Run it in the background and show the person both. It waits up to 15 minutes for them to enter the code.
     - Without a person, set `WARMBUILD_TOKEN` to an API token from the dashboard’s settings. Tokens only read unless an account admin gives them write access.
     - Never read or print the token.
4. **Start the cache** once, in any checkout. It covers every worktree of the repository, including later ones.

   ``` title="Terminal"
   warmbuild start
   XCODE_XCCONFIG_FILE="$HOME/.warmbuild/warmbuild.xcconfig" xcodebuild build -scheme App
   warmbuild status
   ```

   - `XCODE_XCCONFIG_FILE` reaches every target, Swift packages included.
     - `warmbuild status` shows the hit rate of the last build; if it is low, `warmbuild doctor` says why.
     - Until CI has filled the cache (step 5), a build here finds little in it.
5. **Add the Action on CI.** Edit the workflows that already exist; don’t add a new one. In every job that runs `xcodebuild` on macOS:

   - add the step after the checkout and before the first `xcodebuild`;
     - give the job (or the workflow) `id-token: write`, keeping the permissions it has. The job signs in with its GitHub OIDC token, so there is no secret;
     - leave `runs-on` and the `xcodebuild` lines as they are.

   ``` title=".github/workflows/build.yml"
   permissions:
     id-token: write
     contents: read
   jobs:
     build:
       runs-on: macos-26
       steps:
         - uses: actions/checkout@v5
         - uses: warmbuild/action@v1.14.2
         - run: xcodebuild build -scheme App -destination 'generic/platform=iOS Simulator'
   ```

   Open a pull request with the change. Pushes to the default branch fill the cache and everything else reads it, so the pull request’s own build finds it empty. Once it is merged and the default branch has built, later pull requests hit. Each job’s summary shows its hits and misses.
6. **Install the skill** ([above](#agents)), so later sessions know the `warmbuild` commands: the Claude Code command, or the AGENTS.md snippet for other agents.
7. **If a command fails,** `warmbuild stop` turns it off and builds run as before.

## For scripts: wait, exit codes and status --json

Every command exits with the same codes, so an agent can tell a failure from a wrong command line or a wait that ran out. `warmbuild run` is the exception: it exits with the build’s own code.

| Code | Meaning |
| --- | --- |
| `0` | Done; for `status`, the cache serves builds. |
| `1` | Failed; for `status`, the cache is off. |
| `2` | Wrong command line: unknown command or flag, a missing argument. |
| `124` | Gave up waiting (`wait`, `start`), as `timeout(1)` does. |

``` title="Terminal"
warmbuild start --quiet          # one line: Warmbuild: on (read-only)
warmbuild wait --timeout 120 && xcodebuild build -scheme App
warmbuild status --json          # exit 0 on, 1 off
```

`warmbuild wait [--timeout <s>]` blocks until the cache serves builds: `0` when ready, `124` when it is still not ready after the timeout (15 minutes by default), `1` at once when the cache is off. `start --quiet` and `stop --quiet` print a one-line result.

`warmbuild status --json` has `schemaVersion: 1`. Fields may be added within a version; a field renamed, removed or given another meaning raises it. Times are Unix milliseconds.

| Field | What it holds |
| --- | --- |
| `schemaVersion`, `generatedAt` | `1`; when the report was made |
| `running`, `pid` | the cache serves builds; the daemon’s pid or `null` |
| `version`, `mode`, `xcconfig` | the CLI version; `read-only` or `read-write`; the xcconfig’s path |
| `account`, `tokenExpiresAt` | the signed-in account, or `null` |
| `sourceRoot` | the checkout `/tmp/warmbuild/src` points at, or `null` |
| `checkouts`, `unmappable` | every mapped worktree; worktrees whose path has a space and cannot be mapped |
| `repositories`, `projects`, `conflicts` | linked repositories; project name → folder below the checkout; names found at two places, not mapped |
| `worktrees[]` | `path`, `counted`, `lastBuild` (`hits`, `misses`, `hitRate`, `startedAt`, `endedAt`) and `disk` (`bytes`, `derivedData[]`), each or `null` |
| `lastBuild` | all worktrees together: `hits`, `misses`, `hitRate` (0–1), `remoteHits`, `localHits`, `mbDown`, `mbUp`, `estimatedSavedMs` (an estimate, or `null`), `httpFailures`, `failedRequests` by reason (`network`, `token`, `key`, `account`, `server`) |
| `localTier` | the Mac’s store: `path`, `bytes`, `measuredAt`, `lastGcAt`, `maxBytes`, `freeBytes`, `lowDisk` |
| `diagnosis` | when the cache is off or the last build hit little: `id`, `detail`, `fix`; else `null` |

## MCP server: agents without a shell

Agents that cannot run the CLI (Claude on the web and desktop, cloud agents) read the same CI reports through Warmbuild’s remote MCP server. Add its URL as a remote server; the first call opens a sign-in with the same GitHub account as the dashboard, and the agent then reads what you can: your accounts, and repositories shared with you through team access.

`https://mcp.warmbuild.dev/mcp`

- **Claude (web and desktop):** Settings → Connectors → *Add custom connector*, paste the URL.
- **Claude Code:** `claude mcp add --transport http warmbuild https://mcp.warmbuild.dev/mcp`, then `/mcp` to sign in. With a shell, the CLI and skill above do more.
- **Cursor:** in `~/.cursor/mcp.json`, `{"mcpServers": {"warmbuild": {"url": "https://mcp.warmbuild.dev/mcp"}}}`.
- **Codex:** in `~/.codex/config.toml`, `[mcp_servers.warmbuild]` with `url = "https://mcp.warmbuild.dev/mcp"`, then `codex mcp login warmbuild`.

Every tool only reads:

- `list_repositories`: the repositories you can read.
- `latest_ci_report` for a repository, branch or pull request: where the minutes went, cache hits and misses, failed and flaky tests, findings.
- `why_cache_miss` for a target; `tests`: slow, flaky or failing; `pr_test_selection`: what a pull request ran and why; `build_insights`.
- `ci_checkup`: the [CI checkup](https://warmbuild.dev/checkup/) of any public repository, read from GitHub.

Results are short: names, durations and counts, never source or logs. Access lasts an hour and renews for 30 days.
