Skip to content
AgentOpen-source agent

agent-mcts

Wraps a coding agent CLI in tree search so it tries several attempts and keeps the best

agent-mcts is an open-source agent for coding. It is available on CLI, Linux, macOS, Windows and Self-hosted.

Pricing
Open source
Platforms
CLI, Linux, macOS
Listing updated

Similar agents

About agent-mcts

Most coding agents make one linear pass at a task: try, observe, retry in place. agent-mcts runs the same agent as a Monte Carlo Tree Search instead. Each attempt is made in its own git worktree, scored against tests, and the most promising attempts are revised further while your working tree stays untouched.

Scoring relies on your project's test command, optionally extended with tests an agent writes from the task description, or an LLM judge that reads each attempt's diff. Failing output from one attempt is passed into the revision prompts of its children, so the search learns what to fix. Every node is saved as a git branch, and an interrupted run still leaves an inspectable tree.

The tool is aimed at developers who already use Claude Code and want more reliable results on well-specified tasks. Its own benchmark reports gains on two tasks with written specs and no clear gain on a vague bug report, so it is best suited to tasks where tests can express what done looks like.

What it does

Tree search over attempts
Explores several branches of agent attempts using UCT selection and backs up scores to guide the budget.
Isolated git worktrees
Each attempt runs in its own worktree, so your working tree changes only when you apply a result.
Test-based scoring
Scores attempts by exit code and pass ratio from pytest, jest, cargo test, go test and JUnit-style output.
Generated tests option
Lets an agent write extra tests from the task and scores every attempt against them.
LLM judge option
Scores each attempt's diff with a model when tests are not enough.
Live terminal tree and resume
Shows the search tree as it grows and can resume an interrupted run with a larger budget.

Good for

  • Getting a more reliable fix from a coding agent on a task with a written spec
  • Comparing several agent attempts at a bug and applying the best one
  • Running a bounded, cost-capped search over an agent for a test-driven change
  • Studying test-time search over real software tasks as a research harness

Pricing

Open source

Free and open source under MIT; agent API costs apply per run.

agent-mcts FAQ

Which coding agents does agent-mcts support?

Claude Code is verified. A Codex CLI adapter ships but has only been tested against a fake codex binary. A Kimi CLI adapter is planned.

Is agent-mcts open source?

Yes, it is released under the MIT license.

How are attempts applied to my project?

Running apply stages the chosen node's changes as a squash merge, so you review and commit them yourself.

How do I install agent-mcts?

Install with uv tool install agent-mcts, then run agent-mcts run with a task description inside your project.

Is agent-mcts free?

Yes. agent-mcts is open source, so you can use and self-host it for free.

What are the best alternatives to agent-mcts?

The closest alternatives to agent-mcts are CoderBaba, agent-orchestrator, Github, munder-difflin and gpt-pilot.

Where this comes from

  • Description: written from the project's README.