
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.
概览
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 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Baton,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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]
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.
Restart your agent (or open a new chat) and ask it to "run the app and show me a screenshot".
Other ways in:
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:
The agent loop
inspect_project(andlist_targets) withcwdset to the absolute project path.boot_deviceif no simulator or emulator is up. With no name it lists what can boot.run_target, orrun_workflowfor an API plus a frontend, thenwait_for.wait_foraccepts up to 15 minutes, enough for a first native build.- 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.
Failed Flutter reloads return the compiler errors, not just DevFS synchronization failed:
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
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:
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
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 formatpackage.json:dev,start,serveandstorybookscripts, with the package manager taken from your lockfilepubspec.yaml: Flutter projects with no launch.json still get a default- Xcode:
.xcodeproj/.xcworkspace, shared schemes,Podfile, orPackage.swift - Gradle:
settings.gradle(.kts), the wrapper, application modules, or a loneAndroidManifest.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
baton help lists every command.
Several apps and projects at once
Launch an API and a console in dependency order with one call:
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
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.
Pre-flight checks
Configs often reference gitignored files. Baton checks first and refuses to spawn:
baton list flags blocked targets the same way. --force runs anyway.
Evidence across devices
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
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
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]. Runnpm 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_CHROMEto a browser binary. - Something else:
baton doctor, or/baton:doctorin Claude Code.
Unpinned github:kanumuri9593/Baton follows main. Prefer #v0.2.10 or npm install -g baton-run.
Contributing
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版本历史
2- v0.2.10最新Oct 11, 2026
- v0.2.9Oct 11, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分