Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 3.38 KB

File metadata and controls

58 lines (41 loc) · 3.38 KB

SDK Guide

ExecBro works with zero app changes, but installing the companion execbro-sdk package is the single biggest upgrade to debugging quality. It lets you wire up the important parts of your app — your state stores and your network layer — directly into the agent's reach, so the AI inspects real Redux/TanStack Query state and full request/response bodies instead of guessing from the outside.

Why it helps

Under the hood, the MCP server connects over Chrome DevTools Protocol (CDP), which misses events that fire before it attaches and can't read request/response bodies on newer architectures. The SDK patches fetch and console at import time and buffers everything in-app from the very first line — the MCP server auto-detects it and reads from it, no extra config.

Without SDK With SDK
State stores (Redux, TanStack Query, …) Manual via execute_in_app Wired up — direct references
Request/response bodies Not available Full (including GraphQL)
Startup network requests (auth, config) Missed Captured from first fetch
Console logs from startup May miss early logs Captured from first log
Works on Bridgeless (Expo SDK 52+) Partial Full

Install

npm install execbro-sdk

Initialize

Add to your app's entry file (index.js, App.tsx, or app/_layout.tsx for Expo Router) as the first import, and pass in the stores and references you want the agent to reach:

import { init } from 'execbro-sdk';
import { store } from './store'; // Redux store
import { queryClient } from './queryClient'; // TanStack Query
import { navigationRef } from './navigation';

if (__DEV__) {
  init({
    stores: { redux: store, queryClient },
    navigation: navigationRef,
  });
}

// ... rest of your imports

init() alone (no arguments) already unlocks full log and network capture. Wiring stores, navigation, or custom references is what hands the agent direct control — it can read and act through any object you pass in, not just your state and navigation but AsyncStorage, MMKV, or any other reference you choose to expose. See the SDK README for every config option.

Native Android apps (preview)

Native (Kotlin) Android apps use a separate library, execbro-sdk-android. It plays the same role as init({ stores, custom }) here, but since a native app has no JavaScript runtime, it registers named state readers and named commands instead of object references.

Coming soon: the library is not published to Maven yet. Execbro already supports it, and install instructions will appear here when it is released. The API looks like this:

ExecBro.init(this) {
    state("lock") { lockState.isLocked }
    command("lock", "Engage the lock") { args -> engage(); "locked" }
}

scan_metro finds the app over adb. list_debug_globals lists what it registered, inspect_global reads state, run_app_command runs commands and navigate drives Jetpack Navigation. See get_usage_guide({ topic: "native" }).