UStackUStack
Kagura icon

Kagura

Kagura is an open source browser automation testing harness for AI coding agents—supports MCP, HTTP API, Playwright control, and CI/CD replay.

Kagura

What is Kagura?

Kagura is an open source testing harness for AI coding agents that need to validate their work in a real browser. It lets an agent open a browser session, drive user flows (click, fill forms, navigate), and verify outcomes before shipping.

The core purpose is to close the gap between “the agent wrote the code” and “the code actually works in the UI.” Kagura provides browser control, email-flow handling (such as magic links and OTPs), and the ability to publish captured actions or test results to CI/CD.

Key Features

  • One-command browser control for agents: Start browser automation from a CLI command, designed for AI agents that can call tools during coding and verification.
  • MCP and HTTP API support: Use Kagura via MCP (native first-class Claude Code integration) or via an HTTP API so it can work with different agent runtimes.
  • Playwright-powered browser operations: Navigate pages, click through flows, fill forms, and capture screenshots using Playwright-backed control.
  • Email skills for verification flows: Handle magic links, OTPs, and email verification so browser tests don’t stall on “check your inbox” steps.
  • DOM analysis and accessibility tree: Provide a structured accessibility view so the agent understands page structure beyond just visual rendering.
  • Action logging with replay in CI/CD: Record actions and replay them in CI/CD without requiring the agent to rewrite test scripts.

How to Use Kagura

  1. Install the CLI: The site shows npm install -g @kagura-run/cli.
  2. Start the harness: Run one command to launch browser control for your AI coding agent.
  3. Connect the agent: Configure the agent to use Kagura either through MCP configuration (Claude Code integration) or the HTTP API.
  4. Run flows and collect evidence: Let the agent navigate, interact with the UI, and capture screenshots; use the recorded actions as the basis for test runs.
  5. Publish to CI/CD: Tests are designed to be published automatically so they can run on every push, as described on the site.

Use Cases

  • UI verification after code generation: An agent makes changes and then uses Kagura to click through critical UI paths and confirm expected behavior with recorded interactions and screenshots.
  • Testing authentication and onboarding that relies on email: For flows involving magic links, OTPs, or email verification, Kagura’s email handling skills help the agent complete the browser journey.
  • Automated regression in CI/CD without writing new scripts: Capture actions once and replay them in CI/CD, enabling repeatable runs on each push as the site describes.
  • Agent-driven QA for accessibility-aware UI understanding: Use the structured accessibility tree so the agent can reason about page elements and actions in a more structured way.
  • Tool integration across multiple coding agents: Use MCP when working with Claude Code, or use the HTTP API so Codex, Cursor, or other curl-capable agents can drive browser tests.

FAQ

  • Does Kagura work with Claude Code? Yes. The site states that Kagura has “MCP native” integration with Claude Code, where you add it to your MCP config.

  • Can I use Kagura with agents besides Claude Code? Yes. The site lists MCP usage for Claude Code and also mentions an HTTP API that can be used by other agents such as Codex and Cursor.

  • How does Kagura handle login or verification flows? Kagura includes email skills for magic links, OTPs, and email verification, which helps the browser automation complete steps that normally require user email access.

  • What test artifacts does Kagura produce? The site describes recording actions and capturing screenshots, and publishing tests to CI/CD (including replay of recorded actions).

  • Is Kagura self-hosted or cloud hosted? The page describes both options: a self-hosted run on your own infrastructure and a cloud managed hosting option with CI/CD, and email included.

Alternatives

  • General-purpose browser automation frameworks (e.g., Playwright/Selenium) with custom test code: These can automate UI testing, but typically require you to author and maintain test scripts rather than using a harness specifically built for AI agents.
  • Agent frameworks with built-in UI/DOM tooling: Some agent platforms include browser automation or tooling, but they may not provide the same combination of email-flow skills and CI/CD publishing/replay workflow.
  • End-to-end testing tools that focus on test authoring: E2E suites can validate app behavior, but they generally center on human-authored test cases instead of recording/replay designed for agent-driven execution.
  • MCP-capable automation services: If you already rely heavily on MCP for agent orchestration, you could look for other MCP tools that expose browser control, with the tradeoff that you may need to assemble email handling and CI/CD publishing yourself.