MCP server
Anvil has a Model Context Protocol server, so a coding agent such as Claude Code, Codex, Cursor or VS Code can set Anvil up for a repository, check on CI and reviews, run and cancel jobs, fix review findings and start Anvil's own agent tasks, all from the terminal or editor.
| Endpoint | https://itest.wicker.life/mcp, shown with copy buttons in Settings → Connect an agent |
| Transport | Streamable HTTP |
| Sign-in | OAuth in the browser (MCP authorization), or Authorization: Bearer rvw_… with an API token |
To connect Claude Code, Codex, Cursor or VS Code, follow Connect your agent. This page is the reference: access levels, what agents can do, and every tool.
What the agent may do #
On the consent screen you choose one of three levels. Each tool needs one of them, listed in the reference below.
| Level | Scope | What it allows |
|---|---|---|
| Read only | read |
See repositories, CI runs and logs, tests, reviews, findings, learnings and spend. |
| Read and write | write |
Also run, re-run and cancel CI, request and cancel reviews, resolve and dismiss findings, apply suggestions, comment, start agent tasks, edit learnings and monitors. |
| Read, write and setup | admin |
Also create repositories and mirrors, turn reviews on or off, change .anvil.yaml, add SSH keys. |
Whatever the level, the agent acts as you: it sees only the repositories you can see, and the git host still checks your own permissions, so it can't push where you can't. A tool that needs more than the connection has returns an error saying which level to allow.
Connected agents are listed in Settings → Connect an agent with their level and when they were last used. Disconnect ends their access at once. Agents stay signed in by refreshing a short-lived access token (one hour) with a refresh token (30 days, replaced on every use), so an agent you stop using drops off on its own.
API tokens #
Where there's no browser (CI jobs, scripts) or the client has no OAuth, send a personal API token from Settings → Connect an agent as Authorization: Bearer $ANVIL_TOKEN. Tokens start with rvw_, carry one of the three levels, and work as the git password for hosted repositories too. Steps in Connect your agent.
What agents can do #
A few typical requests and the tools behind them:
- "What needs my attention?"
get_statuslists branches with failing CI, open pull requests with unresolved critical or major findings, jobs queued or running, the runner queue, reviews and agent tasks in progress, and this month's spend against your budget. - "Set up Anvil for this repository." The
setup_repositoryprompt walks the agent throughlist_github_installations(orcreate_mirror),set_automatic_reviews, a.anvil.yamldrafted from the codebase (validate_review_config, thenwrite_review_config, which opens a pull request), runner labels (get_runner_guide) and a monitor (set_monitor). - "Why is CI failing?"
list_runs,get_job_logswith a search,search_logsacross jobs,list_testsandget_test_historyto tell flaky from broken, thenrerunwithfailed_only, orstart_agent_taskwithfix_ci. - "Fix the review findings."
list_findingsreturns each finding with its index and an agent prompt; the agent fixes them,apply_suggestionscommits Anvil's suggestions,dismiss_findingrecords false positives (optionally as a learning),resolve_findingmarks what's fixed, andrequest_reviewpluswait_for_reviewchecks the result. - "Try my tests on Node 24 first."
run_workflowsends a workflow and runs it once on a scratch branchanvil-ci/<id>, thenwait_for_runwaits for it and deletes the branch.
Long operations have wait_for_… tools (wait_for_run, wait_for_review, wait_for_agent_task) that wait up to a timeout and send progress. When one returns "finished": false, the agent calls it again. Every error says what to do next.
Prompts and resources #
The server also offers prompts (in Claude Code, /mcp__anvil__setup_repository and so on): setup_repository, why_is_ci_failing, address_review_findings and status_report. As resources it serves every page of this documentation (anvil://docs/<page>), the JSON Schema of .anvil.yaml (anvil://schema/anvil-yaml), the runner guide (anvil://guide/runners) and this tool reference (anvil://reference/tools).
Example: an agent runs a workflow #
You ask Claude Code: "Check that the test suite passes on Node 24 before I bump the engines field." The agent calls run_workflow:
{
"repo": "alice/shop",
"ref": "main",
"name": "node-24-check",
"yaml": "jobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - uses: actions/setup-node@v4\n with:\n node-version: 24\n - run: npm ci\n - run: npm test\n"
}
Anvil replaces the workflow's on: trigger so it runs exactly once, commits it as .gitea/workflows/anvil-ci-<id>.yml on a new branch anvil-ci/<id> made from main, and returns the run's id. The agent then calls wait_for_run: it returns the result, every job and step, and the last lines of each failed job's log, and deletes the scratch branch (pass keep_branch: true to keep it). On GitHub, runs-on: anvil-4cpu runs the same workflow on Anvil's machines.
Tool reference #
Your client shows each tool's full input schema. Repositories are owner/repo when hosted on Anvil and github:owner/repo on GitHub.
Overview #
Who you are, what needs attention, open pull requests.
| Tool | Scope | Parameters | What it does |
|---|---|---|---|
whoami |
read | – | Your Anvil account, what this connection may do (its scopes), your usernames on the hosts, and this month's AI spend against your budget. |
get_status |
read | repo?, hours? |
One call for what needs attention across your repositories: branches whose latest CI failed, open pull requests with unresolved blocking findings (critical or major) or failing pre-merge checks, CI jobs queued or running, Anvil's runner queue, reviews and agent tasks in progress, and this month's spend against your budget. |
list_pull_requests |
read | repo?, state?, hours?, limit? |
Pull requests Anvil knows in your repositories, most recently updated first, with review status, finding counts by severity, CI state and AI cost. |
Setup #
Connect repositories, turn reviews on, write .anvil.yaml, SSH keys, runners.
| Tool | Scope | Parameters | What it does |
|---|---|---|---|
list_repositories |
read | – | Repositories you can see in Anvil (hosted on Anvil, and GitHub repositories where the Anvil app is installed), with whether automatic reviews are on, how many reviews and CI jobs Anvil has recorded, and the AI spend. |
list_hosted_repositories |
read | – | Your repositories hosted on Anvil, including mirrors, with whether Anvil's reviewer has access (reviews on) and whether you administer them. |
list_github_installations |
read | – | Where Anvil's GitHub App is installed that you can reach, and the link to install it on more accounts or repositories. |
set_automatic_reviews |
admin | repo, enabled |
Turns Anvil's automatic reviews of new pull requests and pushes on or off for a repository (the switch in Settings → Repositories). |
create_repository |
admin | name, description?, private?, auto_init?, default_branch?, owner?, review? |
Creates a repository hosted on Anvil under your account (or an organisation you can create repositories in), with reviews on by default. |
create_mirror |
admin | clone_addr, repo_name, auth_token?, private? |
Creates a pull mirror on Anvil of a GitHub (or any git) repository and turns reviews on for it; Anvil keeps it in sync. |
get_review_config |
read | repo, ref? |
The repository's review settings file (.anvil.yaml; also .anvil.yml, .gitea/anvil.yaml or the older .reviewer.yaml), read from the default branch or ref: the raw text, any errors, and the settings in effect with defaults filled in. |
validate_review_config |
read | yaml |
Checks a proposed .anvil.yaml without writing it: YAML errors, settings Anvil rejects, unknown keys, and the settings that would be in effect. |
write_review_config |
admin | repo, yaml, mode?, branch?, message? |
Validates and writes the repository's .anvil.yaml as you. |
list_ssh_keys |
read | – | The SSH public keys on your Anvil account (for git over SSH to hosted repositories), and the SSH clone address. |
add_ssh_key |
admin | title, key |
Adds an SSH public key (ssh-ed25519, ecdsa or ssh-rsa line, e.g. the contents of ~/.ssh/id_ed25519.pub) to your account for git over SSH. |
get_runner_guide |
read | – | How to run CI on Anvil's machines: the runs-on labels (anvil-2cpu, anvil-4cpu, anvil-8cpu) with their CPU and memory, the daily minutes, an example workflow, and how hosted repositories run CI. |
CI #
Runs, jobs, logs, log search, tests and flaky tests, metrics, monitors, the runner queue.
| Tool | Scope | Parameters | What it does |
|---|---|---|---|
list_runs |
read | repo?, status?, branch?, job?, hours?, limit? |
Recent CI jobs across your repositories (GitHub Actions and Gitea Actions), newest first, with result, branch, commit, duration, queue time and run id. |
get_run |
read | repo, run_id |
One workflow run, live from the host: status, conclusion, branch, commit, and every job with its steps. |
list_jobs |
read | repo, run_id |
The jobs of one workflow run with status, conclusion, runner and steps; failed jobs first. |
get_job |
read | job_id |
Everything Anvil recorded about one CI job: steps, timing, labels and runner, its stored log (size, lines), the other jobs of the run, recent durations of the same job, failed tests from JUnit reports, and a CPU/memory summary when it ran on an Anvil runner. |
get_job_logs |
read | repo, job_id, tail_lines?, search? |
The log of one CI job, live from the host: the last lines, or only the lines matching a search with two lines of context. |
search_logs |
read | query, hours? |
Searches the job logs Anvil keeps (the CI → Logs page) across your repositories: every term must appear. |
get_job_metrics |
read | job_id |
CPU and memory use over time of a job that ran on an Anvil runner (up to 60 points), with peaks against the size's limits and a size suggestion (smaller to save, larger when it runs out). |
list_tests |
read | repo?, hours? |
Test results from JUnit reports in CI (the CI → Tests page): flaky tests (pass and fail on the same code), failing tests, and the slowest tests, with counts. |
get_test_history |
read | repo, test |
The last 50 results of one test in a repository: status, duration, failure message, commit, branch and the job it ran in. |
list_flaky_jobs |
read | repo?, hours? |
CI jobs that both passed and failed on the same commit in the time window, with how many commits, the failure rate and when they last ran. |
get_runner_queue |
read | repo?, hours? |
Anvil runners now: jobs queued and running, usage per size and per owner against the daily minutes, recent runner jobs with queue time, plus queue and duration percentiles per runner label for all CI. |
dispatch_workflow |
write | repo, workflow, ref?, inputs? |
Starts an existing workflow that has a workflow_dispatch trigger, on a branch, with inputs. |
run_workflow |
write | repo, yaml, ref?, name? |
Sends a workflow (GitHub Actions / Gitea Actions YAML) and runs it once against a ref, without touching your branches: Anvil commits it to a scratch branch anvil-ci/<id> made from the ref, which starts the run, and returns the run id. |
wait_for_run |
read | repo, run_id?, head_sha?, timeout_seconds?, keep_branch? |
Waits for a workflow run to finish (up to timeout_seconds, sending progress) and returns its result, its jobs and the log tail of failed jobs. |
rerun |
write | repo, run_id, failed_only? |
Re-runs a workflow run: all jobs, or only the failed ones (failed_only). |
rerun_job |
write | repo, run_id, job_id |
Re-runs a single job of a finished run (and the jobs that depend on it). |
cancel_run |
write | repo, run_id |
Cancels a workflow run that's queued or in progress. |
cancel_job |
write | repo, job_id, cancel_whole_run? |
Cancels one job. |
list_monitors |
read | repo? |
CI monitors per repository (alerts on a failing branch, slower jobs, new flaky tests; by email and in Anvil) and the latest alerts raised. |
set_monitor |
write | repo, branch?, on_branch_failure?, on_duration_regression?, regression_pct?, on_new_flaky_test?, email?, recipients?, cooldown_minutes? |
Creates or updates a repository's CI monitor: which branch to watch, what to alert on (branch failure, duration regression over a percentage, new flaky test), email recipients and cooldown. |
delete_monitor |
write | repo |
Removes a repository's CI monitor; no more alerts for it. |
Reviews #
Reviews, findings, suggestions, threads, agent tasks and learnings.
| Tool | Scope | Parameters | What it does |
|---|---|---|---|
get_pull_request |
read | repo, number |
A pull request as Anvil's workspace shows it: title, description, branches, head commit, mergeability, changed files with line counts, every comment and inline thread (with ids for reply_to_thread, and whether resolved), CI checks on the head, and a short summary of Anvil's latest review. |
get_pull_request_review |
read | repo, number |
Anvil's latest review of a pull request in full: summary, the layers to read it in, change summaries, merge and security risk, linked issues, findings (each with an agent_prompt to act on and an optional suggestion), and pre-merge checks. |
request_review |
write | repo, number, full?, summary_only? |
Asks Anvil to review a pull request now, like @anvil review: incremental (only new commits) by default, full to review everything again, summary_only for just the summary. |
wait_for_review |
read | repo, number, timeout_seconds? |
Waits (up to timeout_seconds, sending progress) for the queued or running review of a pull request to finish, then returns its summary, findings by severity and checks. |
cancel_review |
write | repo, number |
Stops a queued or running review of a pull request. |
list_findings |
read | repo?, number?, run_id?, status?, severity?, hours? |
Findings of a pull request's latest review (or run_id) with index, severity, category, file, line, title, body, agent_prompt, whether a committable suggestion exists, and status (open, resolved, dismissed). |
resolve_finding |
write | repo, number, index, run_id?, note? |
Marks a finding resolved (fixed), with an optional note such as the commit that fixed it. |
dismiss_finding |
write | repo, number, index, run_id?, reason, learn? |
Dismisses a finding that doesn't apply (false positive, intended behaviour), with the reason. |
reopen_finding |
write | repo, number, index, run_id? |
Sets a resolved or dismissed finding back to open. |
list_suggestions |
read | repo, number, run_id? |
Which findings of the latest review (or run_id) carry a committable suggestion, whether each still applies to the current head, and whether you may apply them (write access, PR open, not from a fork). |
apply_suggestions |
write | repo, number, run_id, indexes |
Commits the suggestions of the given findings to the pull request's branch as you, in one commit (the workspace's Apply / Apply all). |
comment_on_pull_request |
write | repo, number, body |
Posts a conversation comment on the pull request as you. |
reply_to_thread |
write | repo, number, comment_id, body |
Replies as you in the thread of an inline review comment (e.g. one of Anvil's findings). |
ask_about_pull_request |
write | repo, number, question, path?, start_line?, end_line?, timeout_seconds? |
Asks Anvil a question about a pull request (the workspace's Ask): Anvil reads the change and the repository and answers. |
get_answer |
read | answer_id, timeout_seconds? |
The answer to an ask_about_pull_request question, waiting up to timeout_seconds for it. |
start_agent_task |
write | repo, number, task, recipe?, instructions? |
Has Anvil's coding agent change the pull request, like the PR commands: fix (address the review's findings, or what instructions say), fix_ci (make failing CI pass), tests (write tests for the change), docstrings, simplify, resolve_conflicts (merge the base and resolve conflicts), or recipe (run a recipe from .anvil.yaml, name in recipe). |
get_agent_task |
read | task_id |
One agent task: status (queued, running, done, no_change, failed, refused, cancelled), the commit and branch it pushed or the pull request it opened, files changed, cost and any error. |
list_agent_tasks |
read | repo?, number?, active?, limit? |
Recent agent tasks in your repositories, newest first; filter by repository, pull request, or only active (queued or running) ones. |
wait_for_agent_task |
read | task_id, timeout_seconds? |
Waits (up to timeout_seconds, sending progress) for an agent task to finish and returns the outcome. |
cancel_agent_task |
write | task_id |
Stops an agent task: a queued one never starts, a running one is aborted and pushes nothing. |
list_learnings |
read | repo? |
Learnings: rules your team taught Anvil (with @anvil learn, Ask, or add_learning) that every review of the repository applies, optionally limited to paths. |
add_learning |
write | repo, text, path_glob? |
Teaches Anvil a rule for future reviews of a repository, phrased as an instruction to a reviewer (e.g. "Don't flag missing JSDoc in tests"); path_glob limits it to matching files. |
remove_learning |
write | id |
Deletes a learning (id from list_learnings); reviews stop applying it. |
Prompts #
| Prompt | What it does |
|---|---|
setup_repository |
Connect the repository to Anvil, turn on reviews, write a .anvil.yaml that fits the code, and set up CI on Anvil's runners and monitors. |
why_is_ci_failing |
Find the failing CI jobs on a branch or pull request, read their logs, tell flaky from real failures, and explain the cause and fix. |
address_review_findings |
Go through Anvil's findings on a pull request: fix them locally, apply suggestions, dismiss false positives, resolve what's fixed, and ask for a re-review. |
status_report |
A short report across your repositories: failing CI, pull requests with blocking findings, work in progress and spend. |
59 tools. Scopes: read (read only), write (read and write), admin (read, write and setup).
Limits #
- Workflows started through MCP run on the same runners and limits as any other job: see Runner sizes and labels.
- Reviews, Ask and agent tasks count against the monthly AI budget of the repository's owner.
wait_for_…tools wait at most 10 minutes per call; call them again for longer work.- Dynamic client registration is limited per address; unused registrations are removed after 30 days.