For agents
Built to be used by agents
Everything a person can see or do in BareCI, an agent can do through the MCP server or the bareci CLI,
which call the same JSON API. Every answer is structured, carries the numbers an agent needs to decide, and names
the next action.
{
"mcpServers": {
"bareci": {
"type": "http",
"url": "https://api.bareci.com/mcp",
"headers": {
"Authorization": "Bearer ${BARECI_TOKEN}"
}
}
}
} The loop
What an agent does with a pull request
Test the worktree
Upload the worktree as it is, uncommitted changes included, and read the output until the run ends.
Ask whether it may merge
After pushing, get the Gate's verdict with the fix for every reason it is not ready yet.
Work through the findings
Fix or dispute each reviewer's finding; BareCI answers the reviewer in its own channel.
Test the preview
Run the repository's Flows against the pull request's preview, replayed with no model call.
31 tools
Every tool, from one catalogue
The MCP tools, the API reference and these docs are generated from the same catalogue, so they cannot drift.
| Tool | Group | What it does |
|---|---|---|
whoami | Account | Who this token acts as: its kind, scopes and the organisations it may act for. |
account_get | Account | An organisation's plan, spend this month, hard cap and whether it may launch work now (admission). |
account_usage | Account | Usage for a month, by kind (machine time, preview hours, Flows tokens), with what is billable. |
repo_settings | Account | A repository's BareCI settings: image, pools (labels) and variables. |
run_create | Runs | Run a command on a fresh BareCI machine from the repository's image, with your worktree as the source (uncommitted changes included). |
run_get | Runs | A run's status, exit code, machine and timings (queue, download, command, upload). |
run_logs | Runs | A run's output after a sequence number, long-polling up to `wait` seconds for more. |
run_cancel | Runs | Stop a run: the machine stops the command and is terminated. |
run_artifacts | Runs | Files a run brought back (`collect` and `junit`). |
tests_flaky | Tests | Tests that both passed and failed on the same commit recently: what BareCI reruns and the Gate flags. |
tests_slowest | Tests | The slowest tests and files by recent duration, to know what to shard or speed up. |
tests_shard | Tests | Which of `files` shard `index` of `total` should run, balanced by recorded durations. |
previews_list | Previews | A repository's live previews: URL, branch, PR, state, expiry and the access token the URL needs. |
preview_get | Previews | One preview by id: its URL, state, expiry and the access token the URL needs. |
preview_stop | Previews | End a preview: its machine is released first, so billing stops, then its tunnel and DNS record go. |
previews_close | Previews | End every preview of a branch or pull request. |
flows_run | Flows | Run the repository's Flows (AI end-to-end tests, `*.flow.ts`) on a BareCI machine against a base URL, usually the PR's preview. |
browser_start | Flows | Open a real browser for writing a flow: answers with the page's accessibility tree. |
browser_act | Flows | Do something on the live page: an `instruction` in plain language (kind do, or check to assert without acting), or one exact `action` ({type, target, value}). |
browser_snapshot | Flows | The live page's URL, title and accessibility tree, and a screenshot when asked. |
browser_stop | Flows | Close a live browser; answers with the model tokens it used. |
browser_sessions | Flows | The live browsers open in this MCP server, with how long each has been idle. |
findings | Reviews | Every reviewer's findings on a pull request (CodePanel, GitHub reviews and bots, webhook reviewers), merged and deduplicated. |
findings_refresh | Reviews | Read every reviewer's findings now instead of waiting for the next webhook. |
finding_resolve | Reviews | Answer a finding: `fixed` with the commit that fixes it, or `disputed` with the reason. |
reviews_request | Reviews | Ask the configured reviewers (or the ones named) to review the pull request's head now. |
review_config | Reviews | A repository's reviewers, review policy (blocking severities, required reviewers) and Gate settings (required checks, preview, merge queue). |
ready | Gate | The Gate's verdict for a pull request, the same as the `BareCI: ready` check: ready, and every reason it is not yet, each with its module, whether it is pending or blocking, and the fix. |
change_get | Gate | Everything BareCI knows about a pull request: head, checks, preview, reviewers, verdict and recent events. |
job_explain | Runners | Why a GitHub Actions job on a BareCI label is waiting, where it ran, and how long each step took. |
insights | Runners | Queue times, hit rates of the hot and warm tiers, and spend for your pools over recent days. |
Docs agents can read
Markdown everywhere
Questions
Which MCP protocol versions does BareCI speak?
Revision 2026-07-28 over Streamable HTTP, stateless, plus the legacy initialize handshake for 2025-11-25 and earlier, so current and older clients both connect.
Where do the browser tools run?
The live browser tools (browser_*) need a real browser, so they are served by the local MCP server in the CLI, bareci mcp, not by the hosted endpoint.
Can an agent act on another organisation's repositories?
No. A token belongs to one organisation, and every call is checked against it. Repositories of other organisations answer as if they did not exist.