# Baton [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/kanumuri9593/Baton  
**GitHub Stars:** 1  
**npm Downloads (last month):** 445  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/baton-4

## Description
Run, hot-reload and screenshot Flutter, web, React Native and native iOS/Android apps.

## Tools
Capabilities this server exposes over MCP:

- **diagnose** — Search bounded log and network evidence across projects. Defaults to errors only and 20 findings. Findings are grouped by session; repeats of the same error are counted once (×N), and a stack is collapsed to its first app frames. Pass a trace ID and errorsOnly=false to follow a request across Node services. Use exact session IDs to limit scope.
- **run_workflow** — Launch up to eight project targets in dependency order and wait for each to become ready, in one call. Stops launching dependents on failure. Returns compact session IDs, URLs and errors; retains sessions for debugging. Use browser/device tools next to validate the actual flow. Paths must be absolute.
- **inspect_project** — Read fresh launch sources, configuration problems, nested projects and guidance file paths. Does not run commands or expose environment values. Use before choosing an environment, checkout and device; review screenshot evidence rather than treating capture as visual approval.
- **list_targets** — List everything runnable in a project: launch.json configs, package.json dev scripts, Flutter entrypoints.
- **list_sessions** — List running sessions with their status, capabilities, URLs and device.
- **list_checkouts** — List git checkouts this project can run from: This checkout, linked worktrees, local branches, remotes.
- **run_target** — Start a target by name. Returns the new session id to use with the other tools. Optional branch or checkout runs from a git worktree without moving the current folder.
- **hot_reload** — Hot reload a session, keeping app state. Flutter only. Returns code 0 on success; a non-zero code carries the compile error.
- **hot_restart** — Hot restart a session, dropping app state. For web dev servers and plain processes this reboots the process.
- **stop_session** — Stop one session, or every running session with all=true.
- **forget_session** — Remove stopped sessions from the list. Running sessions must be stopped first. Use all=true to clear every stopped session.
- **read_logs** — Read recent output from a session, newest last. Use filter to grep for an error: it searches all retained output and returns the last `tail` matching lines. Works for a currently running session id, and for a past run (its own session id, or the runId from list_run_history) even after it has stopped or the daemon has restarted.
- **list_run_history** — List past and current runs persisted on disk -- survives daemon restarts. Each line is runId, name, status (live / exit N / ?), how long ago it started, and its log size. Pass a runId to read_logs to see its output.
- **list_network_requests** — List HTTP requests the app has made, newest last. One line each: id, method, status (… while in flight), duration in ms, response bytes, URI. Flutter debug/profile sessions only, while the app is running. Captures dart:io HttpClient traffic (package:http and dio with its default adapter) — NOT cupertino_http/cronet_http native clients, WebSockets or raw sockets. Traffic those make is invisible here, not absent.
- **get_network_request** — One captured request in full: headers, timeline events, and optionally the bodies. Fetched from the running app, so it works only while the session is alive. Flutter debug/profile sessions only, while the app is running. Captures dart:io HttpClient traffic (package:http and dio with its default adapter) — NOT cupertino_http/cronet_http native clients, WebSockets or raw sockets. Traffic those make is invisible here, not absent.
- **clear_network_requests** — Forget every captured request for a session, in the daemon and in the app itself. Useful before reproducing one specific call.
- **read_launch_config** — Read a project's launch.json exactly as written -- comments, formatting and all -- plus the configurations it defines and any pre-flight problems with them. Returns file: null when the project has none; a file that does not parse still returns its text, with the parse errors.
- **write_launch_config** — OVERWRITE a project's launch.json with the text given. The whole file is replaced, so read it with read_launch_config first and send the full text back, or comments and configurations you did not mean to touch are lost. Invalid JSONC is refused before anything is written. Returns the path written and any pre-flight issues in the result.
- **list_devices** — List connected devices, simulators and emulators available to Flutter. Use boot_device to start one that is not running.
- **set_debug_flag** — Toggle a framework debug flag on a running Flutter session, e.g. ext.flutter.debugPaint with {enabled: true} or ext.flutter.timeDilation with {timeDilation: 5}. Values are sent as the strings Flutter expects.
- **screenshot** — Capture the screen of a running session so the visual result of a change can be checked. iOS simulators and Android devices capture the device screen. Web sessions (Vite, Next.js, Flutter web...) load their URL in a headless Chrome, Edge or Brave at the viewport given, and also report the page's console errors and failed requests; they capture at 1x unless scale=2. A capture proves an image was written, not that the UI is right: look at it.
- **check_change** — After editing code: apply the change and return the evidence in one call, instead of hot_reload + wait_for + read_logs + list_network_requests + screenshot. action=auto hot reloads Flutter, leaves web and React Native to HMR / Fast Refresh, and restarts everything else. Answers ok/not ok with only what is new since the call began: reload result, error lines (for web, including the browser console), failed requests, and a screenshot. Prefer this as the default step after every edit.
- **boot_device** — Boot an iOS simulator or Android emulator by name (e.g. "iPhone 17 Pro", "Pixel_8") or id, and wait until it is up. Returns the device id to pass to run_target as deviceId. Call with no name to list what can be booted.
- **wait_for** — Block until a session reaches a state. Use after run_target or hot_restart instead of polling read_logs.
- **session_summary** — Cheap structured overview -- call this before deciding what to do next.
- **run_proof** — Run proof verification and return a zip with screenshots, network call counts, response times and logs.
- **list_proofs** — List past proof bundles, newest first.
- **show_dashboard** — Show a live Baton control panel in the chat: every running app with its simulator or URL, status, CPU and memory; per-app Reload, Restart, Pause/Resume, Bring to front, Logs, Screenshot and Stop; quick actions for all apps; and New run (pick a project, target and device, or boot a simulator). Use when the user asks to see or show Baton, their runs or simulators.
- **dashboard_action** — Used by the Baton card: refresh; catalog (projects and devices for New run); run a project target on a device; boot a device; logs, reload, restart, pause, resume, front, screenshot, stop or dismiss (forget a finished run) one session; or reload/restart/pause/resume/front/stop all. Returns the card state.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "baton": {
    "command": "npx",
    "args": ["-y","baton-run"]
  }
}
```

## Documentation

## What the Baton MCP server does

The Baton MCP server manages local application runs for Flutter, Next.js, Vite, React Native and Expo, plus native iOS and Android projects. It can discover project details, identify available targets and devices, start applications, wait for readiness, inspect logs, and capture screenshots. The same runs are available through its local daemon, command-line interface, MCP client, and Baton app.

The main workflow is to inspect a project, boot a simulator or emulator when necessary, run a target, and wait for it to become usable. After an agent edits code, `check_change` applies the appropriate update: hot reload for Flutter, HMR for web and React Native, or a restart for native applications and ordinary processes. Its response focuses on newly observed results, including reload output, compiler or console errors, failed requests, and screenshots.

## How it works

Set `cwd` to the absolute project path when using project discovery tools. `boot_device` can list devices that are available to start or boot a selected simulator or emulator. `run_workflow` supports a workflow containing an API and frontend, while `run_target` starts an individual target. Native projects may need a longer first build, so `wait_for` accepts waits of up to 15 minutes.

Web screenshots are captured in a temporary headless Chrome, Edge, or Brave session, or through the browser specified by `BATON_CHROME`. Viewports can be `phone`, `tablet`, `desktop`, or a custom width and height. Device and simulator captures use the device resolution. A screenshot confirms that an image was captured; Baton does not interact with controls or determine whether the visual result is correct.

## Setup and configuration

Baton requires Node.js 24 or newer and supports macOS, Linux, and Windows. Install the package globally with `npm install -g baton-run`, then run `baton setup` to add its configuration to installed coding agents. The setup command changes only Baton’s configuration entries, creates `.baton-backup` files for changed configurations, and can be repeated. Use `baton setup cursor codex` to limit the targets, `--dry-run` to preview changes, or `--remove` to undo them.

An MCP client that accepts an `mcpServers` configuration can launch the server with `npx -y baton-run`; pinning a version such as `baton-run@0.2.10` is also supported. The repository provides separate setup paths for Claude Code and Codex plugins, as well as install links for VS Code and Cursor. The project is a public developer preview.

## Tools and capabilities

The Baton MCP server exposes 29 tools, including:

- Project and target discovery: `inspect_project`, `list_targets`, `list_devices`, `list_sessions`, and `list_checkouts`.
- Execution and lifecycle control: `boot_device`, `run_target`, `run_workflow`, `wait_for`, `stop_session`, `forget_session`, `hot_reload`, and `hot_restart`.
- Verification and diagnostics: `check_change`, `read_logs`, `session_summary`, `diagnose`, `screenshot`, and `set_debug_flag`.
- Network inspection: `list_network_requests`, `get_network_request`, and `clear_network_requests`.
- Configuration and evidence: `read_launch_config`, `write_launch_config`, `run_proof`, `list_proofs`, and `list_run_history`.
- Dashboard controls: `show_dashboard` and `dashboard_action`.

It can return screenshots for web apps, iOS simulators, and Android devices. For UI flows that require taps or other input, pair it with a browser, device-control, or Playwright MCP server. Agents without MCP support can use the CLI, including `baton check <session> --json` for a machine-readable check result.

_Full upstream README: https://allmcps.com/mcp/baton-4/readme_

