ModernCIPush. Green. Merged.

CI for AI coding agents

ModernCI is a self-hosted CI server and merge queue built for teams whose coding agents open more pull requests than a conventional CI queue can test. An agent says a branch is done over MCP. ModernCI opens the pull request, tests it, and merges it when green. A failure is pushed back into the agent's MCP session with the failing test, the command that reproduces it, the log excerpt and the diff. ModernCI runs no AI model of its own: your agent, or a person, does the fixing.

Marks: live is in release 0.4.28 on main; preview is built in an open pull request, not released; planned is decided, not built. The source for every mark is facts.

The loop

  1. Done. The agent pushes its branch and calls the MCP tool done with the repo and branch. ModernCI opens the pull request into the target its branch file names, or updates the open one. live
  2. Tested. Each check is your own command from .ci/<branch>.yaml, read from the target branch, so a change cannot set its own checks. A green result is reused only for an identical input key. live
  3. Stale work cancelled. A newer push cancels the running checks it made pointless. A pull request whose head contains another open pull request's head cancels that one's checks, and the status names which pull request covered it. live
  4. Merged. Ready pull requests are chained into a merge queue. The deepest green prefix merges as exactly the commit that was tested (fast-forward), and a failing batch is bisected. live
  5. Sent back. A failure or a merge conflict becomes a work item, pushed to the session that called done without being asked: what failed in this change (failures that also fail on the target branch are listed apart and never charged), the reproduce command, the log excerpt, the diff it was tested on, and which attempt this is. live

Connecting an agent

Your team's ModernCI admin gives you the install's URL, its CA fingerprint and a token. Then:

modernci init https://ci.example.internal <CA fingerprint> < token-file   # pins the CA, saves the login (0600)
claude mcp add --scope user modernci -- modernci mcp                      # MCP over stdio, carried to the daemon
claude --dangerously-load-development-channels server:modernci            # optional: failures arrive as turns

The full walkthrough is Get started: join a team. The daemon also serves MCP over HTTPS at /mcp with a bearer token. live

ToolScopeWhat it does
doneagentOpen or update the pull request for a branch.
claimagentTake the oldest unclaimed work item (a failure to fix or a conflict to resolve).
reportagentFinish a claimed work item: what was done and the commit pushed.
askagentAsk a person a question; the answer becomes a ruling that later work items include.
my_work, watch, logreadYour open work and its pull requests; a long-poll event feed; a check's log.

The full, generated list is on facts.

Push channel. modernci mcp sends each work item, failure, green result and merge for that agent's own changes as notifications/claude/channel and as an MCP log message. Claude Code shows the channel as a turn when the session is started with claude --dangerously-load-development-channels server:modernci. Channels are a Claude Code research preview: a custom server like ModernCI's isn't on Claude Code's channel allowlist, the flag works in interactive sessions only, and Team and Enterprise organizations must enable channels first (Claude Code channels reference, read 2026-10-13). Other MCP clients get the log message, or can follow watch with mine. live

Escalation. Each repo's .ci/repo.yaml sets what happens when nobody fixes a failure. The default for a failing check is two fix attempts, then a stalled prompt, then the repo's owner. Each step times out after 60 minutes by default. live

Agent hosts (optional). modernci host join registers a machine you run that claims work items over MCP and runs your agent headless on them. It stops claiming when the agent hits a usage limit, and that limit doesn't count as an attempt. ModernCI never runs an agent itself. live

Guard rails for agent-written code

  • A change is never tested on the agent's own machine. live
  • Agents push only to the pull request's head branch. Pull requests from forks are never tested or pushed. live
  • A test check that ran zero tests fails. live
  • Only a person answers ask or approves. Enforcement for tokens is in preview (PR #61). preview
  • Requiring a fix to show the failing test failing before and passing after, and protecting paths (such as tests and golden files) from being weakened, are planned. planned

Evidence

  • ModernCI is developed this way: changes, including this page, are handed over with done, and ModernCI opens the pull request and tests it. Example: PR #190 ("Opened by ModernCI").
  • Agent pull request to merge time, compared with other CI setups: measurement in progress. The method is on benchmarks.
  • Measured baseline (busbar, 2026-10-12 to 13, 18.3 h, one 8-vCPU host): median push to green result 43 min, 37 min of it queued, because engines up to 0.4.28 run one pull request's checks one after another.

Limitations

  • One pull request's checks run one after another in 0.4.28. Running independent checks in parallel on separate machines is planned (PR #93 is a first cut).
  • Flaky-test quarantine covers cargo-nextest only.
  • GitHub and Gitea only (Forgejo through the Gitea API). GitLab is planned.
  • Self-hosted only. There is no public download yet and no hosted service.
  • The push channel as a conversation turn needs Claude Code's channels research preview and its development flag. Other clients get it as a log message.

See also: Rust CI, production readiness, alternatives to GitHub Actions.