How infiniv/android-ui-mcp works
This repository is an MCP server that gives AI coding agents two Android UI capabilities: list connected devices and capture a screenshot for visual analysis. The main flow starts with an agent request over stdio, dispatches through the MCP server, and either lists ADB devices or captures, formats, and returns an image with dimensions. The README also describes integrations with several MCP-capable agents and development environments; these are clients of the server, not separate runtime subsystems. Source excerpts show the main handlers and ADB/screenshot implementation; broader workflow claims are based on README documentation.
Main entry points: server.ts MCP Server · adb.ts ADB Commands · screenshot.ts Screenshot Formatting · types.ts Tool Schemas
Components 11
MCP Interface
- Process Entry
src/index.ts - MCP Server
src/server.ts - Stdio Transport
Android Operations
- Device Listing
src/server.ts - Screenshot Tool
src/server.ts - Screenshot Formatting
src/utils/screenshot.ts - ADB Commands
src/utils/adb.ts
Schemas and Errors
- Tool Schemas
src/types.ts - Error Formatting
src/utils/error.ts
Other components
- AI Agent
- Android Device
Connections 15
- AI Agent → Stdio Transport: sends requests
README.md - Process Entry → MCP Server: starts
src/index.ts - MCP Server → Stdio Transport: connects
src/server.ts - Stdio Transport → MCP Server: delivers requests
src/server.ts - MCP Server → Tool Schemas: validates inputs
src/server.ts - MCP Server → Screenshot Tool: dispatches screenshot
src/server.ts - MCP Server → Device Listing: dispatches listing
src/server.ts - Screenshot Tool → Screenshot Formatting: requests capture
src/server.ts - Screenshot Formatting → ADB Commands: captures image
src/utils/screenshot.ts - Device Listing → ADB Commands: lists devices
src/server.ts - ADB Commands → Android Device: queries device
src/utils/adb.ts - Screenshot Tool → Tool Schemas: validates result
src/server.ts - MCP Server → Error Formatting: formats failures
src/server.ts - Screenshot Tool → AI Agent: returns image
src/server.ts - Device Listing → AI Agent: returns device list
src/server.ts