An MCP server that captures Android emulator/device screenshots for AI agent visual analysis
npm install android-ui-assist-mcpadb devices
bash
npm install -g android-ui-assist-mcp
`
$3
`bash
git clone https://github.com/yourusername/android-ui-assist-mcp
cd android-ui-assist-mcp
npm install && npm run build
`
AI Agent Configuration
$3
Create or edit %APPDATA%\Claude\claude_desktop_config.json:
`json
{
"mcpServers": {
"android-ui-assist": {
"command": "npx",
"args": ["android-ui-assist-mcp"],
"timeout": 10000
}
}
}
`
For local development:
`json
{
"mcpServers": {
"android-ui-assist": {
"command": "node",
"args": ["d:\\projects\\android-ui-assist-mcp\\dist\\index.js"],
"timeout": 10000
}
}
}
`
Restart Claude Desktop to apply configuration.
Development Environment Setup
$3
1. Start your Expo development server:
`bash
npx expo start
or
npm start
`
2. Open your app on a connected device or emulator
3. Ensure your device appears in adb devices
4. Your AI agent can now take screenshots during development
$3
1. Start Metro bundler:
`bash
npx react-native start
`
2. Run on Android:
`bash
npx react-native run-android
`
3. Enable hot reload for instant feedback with AI analysis
$3
1. Start Flutter in debug mode:
`bash
flutter run
`
2. Use hot reload (r) and hot restart (R) while getting AI feedback
3. The AI agent can capture UI states after each change
$3
1. Open project in Android Studio
2. Run app with instant run enabled
3. Connect device or start emulator
4. Enable AI agent integration for real-time UI analysis
$3
Install and configure:
`bash
npm install -g @google/generative-ai-cli
gemini auth login
`
Method 1: Command Line Configuration
`bash
For NPM installation
gemini mcp add android-ui-assist npx android-ui-assist-mcp
For local development
gemini mcp add android-ui-assist node "/path/to/android-ui-assist-mcp/dist/index.js"
`
Method 2: Configuration File
Create ~/.gemini/settings.json (Windows: %USERPROFILE%\.gemini\settings.json):
`json
{
"mcpServers": {
"android-ui-assist": {
"command": "npx",
"args": ["android-ui-assist-mcp"]
}
}
}
`
For local development:
`json
{
"mcpServers": {
"android-ui-assist": {
"command": "node",
"args": ["/path/to/android-ui-assist-mcp/dist/index.js"]
}
}
}
`
Verify: gemini mcp list
$3
Create .vscode/settings.json in your project:
`json
{
"github.copilot.enable": {
"*": true
},
"mcp.servers": {
"android-ui-assist": {
"command": "npx",
"args": ["android-ui-assist-mcp"],
"timeout": 10000
}
}
}
`
Docker Deployment
$3
`bash
cd docker
docker-compose up --build -d
`
Configure AI platform for Docker:
`json
{
"mcpServers": {
"android-ui-assist": {
"command": "docker",
"args": ["exec", "android-ui-assist-mcp", "node", "/app/dist/index.js"],
"timeout": 15000
}
}
}
`
$3
`bash
docker build -t android-ui-assist-mcp .
docker run -it --rm --privileged -v /dev/bus/usb:/dev/bus/usb android-ui-assist-mcp
`
Available Tools
!MCP Tools Available
| Tool | Description | Parameters |
| ------------------------- | -------------------------- | --------------------- |
| take_android_screenshot | Captures device screenshot | deviceId (optional) |
| list_android_devices | Lists connected devices | None |
$3
take_android_screenshot
`json
{
"name": "take_android_screenshot",
"description": "Capture a screenshot from an Android device or emulator",
"inputSchema": {
"type": "object",
"properties": {
"deviceId": {
"type": "string",
"description": "Optional device ID. If not provided, uses the first available device"
}
}
}
}
`
list_android_devices
`json
{
"name": "list_android_devices",
"description": "List all connected Android devices and emulators with detailed information",
"inputSchema": {
"type": "object",
"properties": {}
}
}
`
Usage Examples
!Real-Time Development Workflow
_Example: AI agent listing devices, capturing screenshots, and providing detailed UI analysis in real-time_
$3
With your development environment running (Expo, React Native, Flutter, etc.), interact with your AI agent:
Initial Analysis:
- "Take a screenshot of my current app UI and analyze the layout"
- "Show me the current state of my login screen and suggest improvements"
- "Capture the app and check for accessibility issues"
Iterative Development:
- "I just changed the button color, take another screenshot and compare"
- "Help me adjust the spacing - take a screenshot after each change"
- "Take a screenshot and tell me if the new navigation looks good"
Cross-Platform Testing:
- "Capture screenshots from both my phone and tablet emulator"
- "Show me how the UI looks on device emulator-5554 vs my physical device"
Development Debugging:
- "List all connected devices and their status"
- "Take a screenshot from the specific emulator running my debug build"
- "Capture the current error state and help me fix the UI issue"
Troubleshooting
$3
- ADB not found: Verify ADB is installed and in PATH
- No devices: Check USB connection and debugging authorization
- Device unauthorized: Disconnect/reconnect USB, check device authorization prompt
- Screenshot failed: Ensure device is unlocked and properly connected
$3
- Verify adb devices shows your device as "device" status
- Restart ADB server: adb kill-server && adb start-server
- Check USB debugging permissions on device
Development
$3
`bash
npm run build # Production build
npm test # Run tests
npm run lint # Code linting
npm run format # Code formatting
`
$3
`
src/
├── server.ts # MCP server implementation
├── types.ts # Type definitions
├── utils/
│ ├── adb.ts # ADB command utilities
│ ├── screenshot.ts # Screenshot processing
│ └── error.ts # Error handling
└── index.ts # Entry point
``