Baton

io.github.kanumuri9593由 GitHub 帳號 kanumuri9593 發布v0.2.10更新於 Oct 24, 2026

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

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

Baton 讓編碼助理執行、熱重載、檢查並截圖 Flutter、Web、React Native 與原生 iOS/Android 應用程式。

可以做什麼
  • 檢查專案並列出目標、裝置與工作階段,啟動模擬器或仿真器
  • 執行應用程式目標或多應用程式工作流程,並等待就緒
  • 用一次檢查呼叫套用變更,回傳重載結果、新錯誤、失敗請求與截圖,並給出 OK / NOT OK 結論
  • 熱重載、熱重啟、停止或忘記工作階段,讀取日誌與工作階段摘要
  • 依手機、平板、桌面或自訂視窗尺寸截圖,檢視或清除網路請求
  • 讀寫啟動設定、產生證據包、瀏覽執行歷史並操作儀表板卡片
適用情境
適合助理在修改 Flutter、Next.js/Vite、React Native 或原生行動專案時,透過執行應用程式、讀取錯誤與查看截圖來驗證每次變更。適用於具備模擬器或瀏覽器的本機開發機器上的開發循環。
執行需求
以 npx baton-run(或全域 npm 安裝)啟動的本機程序;執行應用程式的機器需 Node.js 24+;支援 macOS、Linux 與 Windows。Web 截圖需要模擬器、仿真器或已安裝的 Chrome/Chromium/Edge/Brave(可用 BATON_CHROME 指定瀏覽器路徑)。macOS 原生面板需要 Xcode 或命令列工具。未宣告帳號或 API 金鑰。
安裝前請注意
它會啟動、重啟與停止你的應用程式,並可寫入啟動設定,會改變本機狀態。setup 會修改各助理的設定檔,並保留備份。依分支執行時會把專案中的密鑰與設定複製到主目錄下的工作樹。本機守護程序會寫出供用戶端讀取的權杖檔。它不會點擊介面或判斷截圖,截圖不代表畫面正確。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Baton,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Baton]

Baton

Run, hot-reload, check and screenshot your apps from any coding agent.
Flutter, Next.js, Vite, React Native / Expo, and native iOS and Android, from a terminal, the Baton app, or any MCP client.

[npm version] [CI] [MIT license] [Node >= 24] [MCP Registry: io.github.kanumuri9593/baton]

Website · Set up your agent · Agent notes · PDF guides · Token study · Changelog

[Install in VS Code] [Install in VS Code Insiders] [Add Baton to Cursor]

[An agent edits a web page, check_change reports NOT OK with the browser console error, the agent fixes the typo and check_change reports OK with a phone screenshot]

Baton is a local daemon that owns your running apps, with an MCP server and a CLI in front of it. Your agent starts an app on a simulator or in a browser, applies each edit with one check_change call, and gets back only what is new: the reload result, error lines, failed requests and a screenshot, with an OK / NOT OK verdict. You see the same runs in your terminal, in the Baton app, and in the band above Claude Code's prompt, and you can press the same buttons. Baton reads the .vscode/launch.json, package.json, pubspec.yaml, Xcode and Gradle projects you already have.

0.2.10 is a public developer preview. Open an issue with what broke or what you wanted.

Quick start

Requires Node.js 24+ on the machine that runs your apps. macOS, Linux and Windows.

bash
npm install -g baton-runbaton setup          # adds Baton to every coding agent installed on this machine

Restart your agent (or open a new chat) and ask it to "run the app and show me a screenshot".

Other ways in:

WayCommand
Claude Code plugin/plugin marketplace add kanumuri9593/Baton then /plugin install baton@baton
Codex plugincodex plugin marketplace add kanumuri9593/Baton then codex plugin add baton@baton
VS Code or Cursor, one clickthe install buttons at the top of this page
VS Code MCP gallerysearch @mcp baton in the Extensions view (GitHub MCP Registry listing)
MCP server, no installnpx -y baton-run as the server command (pin with [email protected])
Pinned GitHub installnpm install -g github:kanumuri9593/Baton#v0.2.10
From sourcegit clone https://github.com/kanumuri9593/Baton.git && cd Baton && npm install && npm run build

baton setup edits only the baton entry in each tool's config, keeps a .baton-backup of every file it changes, and is safe to run again. baton setup cursor codex limits it to those tools, --dry-run previews, --remove undoes it.

Any MCP client that takes an mcpServers block:

json
{  "mcpServers": {    "baton": { "command": "npx", "args": ["-y", "[email protected]"] }  }}

The agent loop

inspect_project → boot_device → run_target → wait_for → edit → check_change → fix → check_change
  1. inspect_project (and list_targets) with cwd set to the absolute project path.
  2. boot_device if no simulator or emulator is up. With no name it lists what can boot.
  3. run_target, or run_workflow for an API plus a frontend, then wait_for. wait_for accepts up to 15 minutes, enough for a first native build.
  4. After every edit, check_change. It applies the edit (hot reload for Flutter, HMR for web and React Native, restart for native and plain processes) and returns only what changed.
NOT OK  console/storefront  action=none  status=running  2280msnew errors (1):  [vite] Internal server error: Unexpected token (14:2)

Failed Flutter reloads return the compiler errors, not just DevFS synchronization failed:

lib/main.dart:419:19: Error: Expected ';' after this.

Screenshots cover iOS simulators, Android devices and web apps. For web, Baton opens the session URL in a throwaway headless Chrome, Edge or Brave (or BATON_CHROME) at viewport phone (a real 390×844 mobile layout), tablet, desktop or WIDTHxHEIGHT. Web captures are 1× by default, so a phone image is 390×844 (about 430 image tokens for a model); pass scale: 2 (--scale 2) when fine detail matters. check_change with screenshot: false returns text only but still loads a web page, so its console errors count. Simulator and device screenshots are returned at the device's own resolution.

Baton launches apps and reports evidence. It does not tap the UI or judge screenshots: a capture means an image was written, not that the screen is right. Pair it with Playwright MCP, Chrome DevTools MCP or a device-control MCP when a flow needs input.

29 tools: inspect_project, list_targets, list_sessions, list_checkouts, list_devices, boot_device, run_target, run_workflow, check_change, hot_reload, hot_restart, stop_session, forget_session, wait_for, read_logs, session_summary, screenshot, set_debug_flag, diagnose, list_network_requests, get_network_request, clear_network_requests, read_launch_config, write_launch_config, run_proof, list_proofs, list_run_history, show_dashboard and dashboard_action (the buttons on the live card that show_dashboard draws in hosts that support MCP Apps). Each carries MCP hints, so clients that honour them can skip the prompt for the 16 read-only tools.

Supported agents

Agentbaton setup idGuide
Claude Code (terminal, desktop app, VS Code)claude (installs the plugin)docs/clients/claude-code.md
Codexcodexdocs/clients/codex.md
Cursorcursordocs/clients/cursor.md
VS Code (GitHub Copilot agent mode)vscodedocs/clients/vscode.md
Antigravityantigravitydocs/clients/antigravity.md
Gemini CLIgeminidocs/clients/gemini-cli.md
Windsurfwindsurfdocs/clients/windsurf.md
Claude Desktop (chat)manual onlydocs/clients/claude-desktop.md

Agents without MCP can shell out to the same CLI. Every command exits non-zero on failure, and baton check <session> --json gives the same verdict as check_change. Full agent notes: AGENTS.md. Crawler summary: llms.txt.

Printable guides to share: quick start, agent setup guide and FAQ.

In Claude Code: the Baton band

The plugin draws Baton above the prompt while anything runs, in the terminal and in the desktop app. One row per run, with its device or URL, status, CPU and memory, and icon buttons:

ButtonWhat it does
☰Show or hide that run's recent logs under its row
🐞Debug: asks Claude to read the run's errors and logs, fix the cause and check_change
▶Play: hot reload (or restart) a running app, resume a paused one, or run it again once it ends
⏸Pause the app (macOS)
⏹Stop. Once a run has ended this becomes ✕ dismiss
⧉Bring that run's own simulator window (or its web page) to the front (macOS)

The header has + (new run: puts /baton:run in the prompt) and the same ▶ ⏸ ⏹ ⧉ for every run at once. Bring all raises every device's window. /baton opens the same workspace in a side pane with longer logs. The band and pane read the same daemon as the MCP tools, so a run started by Claude, the CLI or the Baton app shows up everywhere. Details: docs/clients/claude-code.md.

What it supports

FrameworkHot reload (keeps state)RestartNotes
Flutter / Dart✅ real, via the daemon protocol✅ hot restartDevices, DevTools, debug flags, screenshots (Flutter web too)
Next.js, Vite, Nuxt, Astro, Remix, Angular, CRAHMR is automatic on save✅ reboots the dev serverDetects the real URL and readiness; phone, tablet and desktop screenshots
React Native / ExpoFast Refresh is automatic✅ reload broadcast to dev clientsTalks to Metro's message socket
Native iOS (Xcode)—✅ rebuild, reinstall, relaunchBuilds for the selected simulator, installs, launches, follows logs, screenshots
Native Android (Gradle)—✅ rebuild, reinstall, relaunchinstallDebug, starts the launcher activity, follows logcat, screenshots
Anything else—✅ kill and respawnAny launch.json or package.json script

Capabilities are reported honestly. A Vite session does not claim Flutter's stateful hot reload, so the control panel greys the button out and agents get a clear refusal instead of a silent no-op.

Where targets come from

Baton reads what you already have. No new config file is required.

  • .vscode/launch.json, read but never modified, so your IDE keeps working
  • .claude/launch.json, same format
  • package.json: dev, start, serve and storybook scripts, with the package manager taken from your lockfile
  • pubspec.yaml: Flutter projects with no launch.json still get a default
  • Xcode: .xcodeproj / .xcworkspace, shared schemes, Podfile, or Package.swift
  • Gradle: settings.gradle(.kts), the wrapper, application modules, or a lone AndroidManifest.xml

A nested ios/ or android/ folder picked on its own is a native target. Picking the Flutter or React Native root still runs the framework, which is what hot-reloads. Native sessions build, install and launch on the device you pick, then follow the app log. Restart rebuilds and relaunches.

baton init writes a .vscode/launch.json from what it detects (--claude for .claude/launch.json). See examples/ for small launch configs.

The CLI

bash
baton list                                  # every target, and where it came frombaton run "iOS Simulator (DEV)"             # names match on any unambiguous substringbaton run "iOS Simulator (DEV)" --branch origin/mainbaton ps                                    # what's runningbaton logs dev -f                           # follow outputbaton check webapp --viewport phone         # did my edit break anything?baton reload --allbaton stop --allbaton devices --all                         # connected devices, plus every one you could bootbaton boot "iPhone 17 Pro Max"              # start a simulator that isn't runningbaton add ~/code/storefront                 # watch another project toobaton doctor                                # sources, blockers, nested projects, guidancebaton app                                   # the control panel

baton help lists every command.

Several apps and projects at once

Launch an API and a console in dependency order with one call:

bash
baton workflow examples/workflow-lab/workflow.json

The result has session ids, readiness, URLs and focused failures. MCP agents use run_workflow. Try the dependency-free two-project delivery lab.

The daemon is not tied to one directory. baton add <path> tracks another project; the control panel then shows a side rail per project plus All. Session ids are project-scoped (storefront/npm-dev, api/npm-dev), so two projects can both have an npm dev. Sessions live in the daemon, so closing the terminal doesn't stop your app.

Devices you haven't started yet

connected  ● iPhone 17 Pro                48F0A0D1-…  ios (emulator)  ● sdk gphone16k arm64          emulator-5556  android (emulator)
bootable  ○ iPhone 17 Pro Max            3237F94B-…  ios  iOS 26.5  ○ iPad mini (A17 Pro)          51470177-…  ios  iOS 26.5  ○ Pixel 10 Pro                 Pixel_10_Pro  android

Flutter's emulator list collapses every iPhone and iPad into one entry, so Baton asks simctl directly. baton boot "iPad mini" starts one, waits until Flutter can see it, and prints the device id to run on.

A branch without switching git

Pick a local or remote branch and Baton makes a git worktree under ~/.baton/worktrees, copies secrets and config from your folder (not build/ or node_modules), and runs from that copy. Your branch, stash and editor do not move. Existing worktrees (the folders agents already edit) can be attached too, and hot reload follows that folder.

bash
baton run "iOS Simulator (DEV)" --branch origin/mainbaton run "iOS Simulator (DEV)" --checkout ~/wt/agent-abaton checkouts

Pre-flight checks

Configs often reference gitignored files. Baton checks first and refuses to spawn:

✗ "iOS Simulator (DEV / dev flavor)" cannot run yet:  missing config/secrets.local.json — copy config/secrets.local.template.json to config/secrets.local.json

baton list flags blocked targets the same way. --force runs anyway.

Evidence across devices

bash
baton proof "Local lab" --branch main --devices "iPhone 17 Pro" --appearance light,dark

Proof bundles hold logs, screenshots and network summaries. See the launch and validation guide, and start with the credential-free Flutter lab.

Backend tracing

Node launch targets can set "batonTrace": true for local OpenTelemetry HTTP/HTTPS and fetch metadata. baton diagnose (and MCP diagnose) returns a bounded error summary across sessions; baton diagnose <trace-id> --all follows one request across Node projects. See local backend tracing.

The Baton app

bash
baton app

One compact row per session: status, reload / restart / stop, logs, and links to the app URL and DevTools. r hot-reloads everything in view, R hot-restarts. There is no App Store download.

  • macOS: a native floating launcher and a menu-bar item. It stays above a full-screen terminal, never steals focus, and the menu-bar item shows how many sessions are live. The small AppKit host is compiled from source in hud/ on first use and needs Xcode or the Command Line Tools; without them Baton opens in the browser.
  • Linux and Windows (or baton app --browser): the same page in an app-style browser window, served on loopback by the daemon, with no external requests.

Settings: docs/app-settings.md. baton hud remains a compatibility alias.

How it works

.vscode/launch.json ─┐package.json  ───────┤pubspec.yaml  ───────┼─► detect ─► daemon ─► one session per targetXcode / Gradle  ─────┘                │       (flutter | web-dev | react-native | ios | android | process)                                      │                     WebSocket + POST /rpc on 127.0.0.1                          ├── Baton app  (native panel on macOS, browser elsewhere)                          ├── baton      (any terminal)                          └── baton-mcp  (any agent)

One daemon owns every session, so a session started in a terminal is visible in the control panel and to your agent. The daemon binds 127.0.0.1 and writes ~/.baton/daemon.json (mode 0600) with its port and a token; clients read it and authenticate.

For Flutter, sessions are flutter run --machine children and every control is one request on its documented JSON protocol (app.restart, app.stop, app.callServiceExtension). FVM is respected: a project pinning .fvm/flutter_sdk uses that SDK. More in docs/architecture.md.

Status

Tested (as of 0.2.3) against a large production Flutter app with 3,692 libraries: hot reload in 87 ms, hot restart in 359 ms, three simulators at once, and three projects (Flutter, Vite, a plain worker) side by side in one control panel. The Flutter adapter is the most complete. Web and React Native adapters cover run, restart, logs and URL detection.

Troubleshooting

  • ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING: you have the old [email protected]. Run npm uninstall -g baton-run && npm install -g baton-run.
  • The agent doesn't see Baton: restart the app or open a new chat after baton setup, then check the per-tool guide in docs/clients.md.
  • Web screenshots fail: install Chrome, Chromium, Edge or Brave, or set BATON_CHROME to a browser binary.
  • Something else: baton doctor, or /baton:doctor in Claude Code.

Unpinned github:kanumuri9593/Baton follows main. Prefer #v0.2.10 or npm install -g baton-run.

Contributing

bash
npm installnpm test          # portable tests, no simulator requirednpm run typecheck

See CONTRIBUTING.md. Report security issues privately as described in SECURITY.md. This project follows the Code of Conduct.

The app icon and vector marks live in assets/; npm run icons renders PNGs at every common size and a macOS .icns.

License

MIT. Written and maintained by Yeswanth Varma Kanumuri.

來源:README.md,提交 7d1b0d6

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.2.10最新Oct 11, 2026
  2. v0.2.9Oct 11, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分