# Repository Briefing: machinepulse-ai/karpo-browser
> Source: https://repoforai.com/repo/machinepulse-ai/karpo-browser (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/machinepulse-ai/karpo-browser
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: TypeScript
- **License**: Apache-2.0
- **Engineering Health**: A (79/100 · Maintenance 35/35 · Adoption 13/25 · Releases 11/20 · License 20/20)
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: MCP, CLI
- **Momentum**: 212 ★ total (+7 24h / +34 7d) · 23 forks
- **When to Use**: Best for: Teams with an existing MCP agent that need to navigate changing web pages, fill forms with explicit values, and verify or correct the final state before proceeding. Skip if: You need deterministic regression tests, offline operation without a local decision service, or guaranteed prevention of sensitive page data egress without additional controls.

## Overview
```text
### Architecture & Core Mechanics
Karpo Browser is a TypeScript browser runner exposed through a stdio MCP server, a CLI, and a typed `Browser` API. An external System 2 agent passes a goal and permitted input values to `run_browser_agent`. The runner converts the current page into numbered elements, asks System 1 for one action from a constrained set and a separate looping assessment, executes the chosen action over Chrome DevTools Protocol (CDP), and waits for the page to settle before repeating. It returns an exit status and the page reached; System 2 is responsible for judging whether the task actually succeeded.

The System One protocol sends `model`, `state`, and `questions` to a decision endpoint and reads `answers`. Library callers can instead inject an `ask(request, context)` implementation. The Node.js package declares no runtime dependencies, but the browser and the decision endpoint are still operational dependencies. The Claude Code plugin bundles the MCP integration and a skill; the optional controller under `test/controller` provides a separate System 2 over an OpenAI-compatible chat API and is not part of the npm distribution.

### Key Capabilities & Differentiators
The MCP interface supports opening pages, delegating a goal, reading numbered page elements, capturing a viewport JPEG, and taking individual actions such as clicks, typing, selection, and scrolling. During a delegated run, the decision model types only explicitly supplied values; writing a value in the goal does not make it available for typing. Named secrets can be inserted without sending their values to System 1, and the corresponding fields are masked in subsequent System 1 reads. The runner distinguishes `done`, `needs_from_person`, `needs_approval`, `looping`, `limit`, and other failure or interruption states, so the caller can ask for input, inspect the page, or take over.

OpenRouter model options include `typesafe/jev-1.14`, `google/gemini-decision-1`, and `openai/gpt-6-luna-decisions`. Custom backends must speak System One; a chat-completions endpoint is not a drop-in replacement for the System 1 role. Screenshot packing differs by endpoint: OpenRouter receives screenshots as items in a top-level `state` array, while a custom server receives them in `state.viewport_screenshot` by default. Library callers can choose the layout with `imagesAsStateItems`, and `src/decider/models.ts` applies conservative request limits to unlisted models.

### Trade-offs & Limitations
Compared with asking a general model to emit every browser tool call, Karpo delegates low-level actions to a model choosing from page-derived options. That is a plausible way to reduce expensive general-model turns, not a demonstrated latency or cost guarantee: each step still incurs a decision request, a browser action, and settling time. The returned page and manual controls give the host agent a recovery path when a run stalls. For stable flows with known locators and explicit assertions, scripted Playwright is a better fit: it avoids model judgment on every action and gives the test author direct control over what constitutes success.

Treat `done` as the decision model's assessment, not an assertion, and `needs_approval` as a state to handle rather than a substitute for host-side authorization. Named-secret masking is narrower than a guarantee that page data stays local. Ordinary page text and screenshots can reach the configured decision endpoint, and the MCP server's HTTP(S)-only navigation rule is not a domain allowlist. For authenticated or sensitive sessions, enforce data, network, and approval boundaries outside the model's instructions.

### Hardware & Deployment Guide
Install with `npm install -g karpo-browser` on Node.js 22.18 or later. The runner can start local Chrome or Chromium, use `CHROME_PATH` to find a nonstandard installation, or attach to a running browser via `BROWSER_CDP_URL` for MCP or `--cdp` for the CLI. Headless mode is enabled through `BROWSER_HEADLESS=1` for MCP or `--headless` for the CLI. Configure the required `SYSTEM1_MODEL`, set `SYSTEM1_API_KEY` when the provider requires it, and use `SYSTEM1_URL` to override the default OpenRouter endpoint. Claude Code has a plugin, while Codex and other MCP clients can launch `npx -y karpo-browser mcp` over stdio.

A local Chrome process does not make the setup offline: the default decision path calls OpenRouter. Hosting a compatible endpoint locally removes that decision-path dependency, but the site under automation may still require network access. Development scripts cover checking, testing, and building; conformance replay needs fixtures outside the repository via `CONFORMANCE_FIXTURES`. The root contains `CHANGELOG.md`, but no GitHub release is listed, so there is no release milestone to anchor an upgrade assessment.
```

## Key Capabilities
```text
- Decision boundary: System 1 selects one offered action per step; System 2 plans the task and verifies the returned page.
- Protocol: System One posts `model`, `state`, and `questions` and consumes `answers`; screenshot placement differs between the OpenRouter and custom-server defaults.
- Browser control: Chrome DevTools Protocol supports both launched Chrome or Chromium and attached browser sessions via WebSocket.
- Run outcomes: Goal completion, missing input, approval, looping, and time or step limits are distinct statuses, so the caller can choose how to recover.
- Data handling: Named secrets are inserted without putting their values in decision requests; ordinary page text and screenshots can still leave the browser host.
- Integration surfaces: stdio MCP for agent clients, a CLI with `--json`, and a typed TypeScript API with an injectable decision implementation.
```

## Quick Start / Clone
```bash
npm install -g karpo-browser
```
