A MCP server that allows airi all LLMs to control Android devices. This project is a child project of airi.
input_tap- Tap on the screen at given coordinatesinput_swipe- Swipe from one coordinate to anotherinput_text- Input text on the deviceinput_keyevent- Send a key event to the deviceinput_press- Press the current keyinput_roll- Roll the trackball
wm_size- Get the physical screen sizewm_density- Get the display densitycpu_percent- Get CPU usage percentagecpu_count- Get the number of CPU coresbattery_level- Get battery levelbattery_stats- Get detailed battery statistics
ui_get_hierarchy- Get UI hierarchy (XML)utils_top_activity- Get the top activityutils_top_activities- Get all top activitiesutils_package_version- Get package version info
device_connect- Connect to a device at specified host and portdevice_reset- Reset device connectionshell_execute- Execute any shell command
docker run --rm -it -p 3000:3000 -e ADB_HOST=host.docker.internal ghcr.io/proj-airi/airi-android:v0.3.4
# or stdio mode
docker run --rm -i -e USE_STDIO=true -e ADB_HOST=host.docker.internal ghcr.io/proj-airi/airi-android:v0.3.4For agents supporting MCP, you can use the following configuration:
// mcp.json
{
"mcpServers": {
// http mode
"airi-android-http": {
"url": "http://localhost:3000/mcp"
},
// stdio mode
"airi-android-stdio": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"USE_STDIO=true",
"-e",
"ADB_HOST",
"ghcr.io/proj-airi/airi-android:v0.3.4"
],
"env": {
"ADB_HOST": "host.docker.internal"
}
}
}
}Requires Bun to be installed.
# Install dependencies
bun install
# Start server (HTTP mode, port 3000)
bun run start
# Or use stdio mode
USE_STDIO=true bun run start- Install Bun
- Install Android Platform Tools
- Connect an Android device (via USB or
adb connectfor emulators)
# Install dependencies
bun install
# Run tests
bun test
# Start development server
bun run dev
# Build binary
bun run build
# Lint code
bun run lint
# Type check
bun run typecheckSee AGENTS.md for code guidelines.
| Variable | Description | Default |
|---|---|---|
USE_STDIO |
Set to true to use stdio transport mode |
false |
ADB_HOST |
ADB server host address | localhost |