iBog/mcp_android_devices
If you are the rightful owner of mcp_android_devices and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The MCP Android Devices Server is a Model Context Protocol server that provides information about connected Android devices and emulators using JSON-RPC 2.0 over stdio transport.
MCP Android Devices Server
A Model Context Protocol (MCP) server that provides information about connected Android devices and emulators. This server implements the official MCP specification using JSON-RPC 2.0 over stdio transport.
Features
- Lists all connected Android devices and emulators
- Provides detailed device information (name, model, architecture, Android version, SDK level)
- Captures screenshots from Android devices and emulators
- Returns screenshots as Base64-encoded PNG images
- Follows the official MCP protocol specification
- Uses JSON-RPC 2.0 over stdio transport
- Proper error handling and protocol compliance
- Cross-platform support (Windows, macOS, Linux)
How to use
Build the server
go build
Configure with MCP Clients
Cursor IDE - Step by Step Installation
-
Build the server executable:
go build -
Copy the executable to a permanent location:
# Windows mkdir C:\tools\mcp_servers copy mcp_android_devices.exe C:\tools\mcp_servers\ # macOS/Linux sudo mkdir -p /usr/local/bin/mcp_servers sudo cp mcp_android_devices /usr/local/bin/mcp_servers/ -
Open Cursor IDE Settings:
- Press
Ctrl+,(Windows/Linux) orCmd+,(macOS) to open Settings - Or go to
File > Preferences > Settings
- Press
-
Navigate to MCP Settings:
- In the Settings search bar, type "MCP"
- Look for "MCP Servers" section
- Click "Edit in settings.json" or find the MCP configuration area
-
Add the MCP server configuration:
For Windows:
{ "mcp": { "servers": { "android_devices": { "command": "C:\\tools\\mcp_servers\\mcp_android_devices.exe" } } } }For macOS/Linux:
{ "mcp": { "servers": { "android_devices": { "command": "/usr/local/bin/mcp_servers/mcp_android_devices" } } } } -
Alternative: Use relative path (if keeping in project folder):
{ "mcp": { "servers": { "android_devices": { "command": "./mcp_android_devices" } } } } -
Save and restart Cursor IDE
-
Verify installation:
- Open Cursor IDE
- Look for MCP status indicator in the status bar
- Try asking: "List my Android devices" or "Show connected Android emulators"
- Try asking: "Take a screenshot of my Android device" or "Capture the screen from my emulator"
- The AI should now be able to use both the device listing and screenshot tools
Troubleshooting Cursor IDE Integration
Common Issues:
-
Server not found:
- Verify the executable path is correct
- Use absolute paths instead of relative paths
- Check file permissions (executable bit on Unix systems)
-
ADB not found:
- Ensure Android SDK is installed
- Add
adbto your system PATH - Test with
adb devicesin terminal
-
Permission issues (Windows):
- Run Cursor IDE as administrator (temporarily)
- Or move executable to a user-accessible directory
-
Settings not taking effect:
- Completely restart Cursor IDE
- Check for syntax errors in settings.json
- Look at Cursor IDE logs/console for error messages
-
Screenshot functionality not working:
- Ensure your Android device/emulator screen is unlocked
- Verify the device is properly connected with
adb devices - Check that the device has sufficient storage space
- Some devices may require enabling "USB Debugging" and "Disable permission monitoring"
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"android_devices": {
"command": "./mcp_android_devices"
}
}
}
Test the server manually
The server communicates via JSON-RPC 2.0 over stdin/stdout. Here are some test examples:
-
Initialize the connection:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | ./mcp_android_devices -
List available tools:
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | ./mcp_android_devices -
Call the get_android_devices tool:
echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_android_devices","arguments":{}}}' | ./mcp_android_devices -
Capture a screenshot from an Android device:
echo '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"get_android_screen","arguments":{"device":"emulator-5554"}}}' | ./mcp_android_devicesOr capture from the first available device:
echo '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"get_android_screen","arguments":{}}}' | ./mcp_android_devices
MCP Protocol Examples
Initialize Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2024-11-05",
"capabilities": {
"tools": {
"listChanged": true
}
},
"serverInfo": {
"name": "android-devices-mcp-server",
"version": "1.0.0"
}
}
}
Tools List Response
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"tools": [
{
"name": "get_android_devices",
"description": "Get a list of connected Android devices and emulators",
"inputSchema": {
"type": "object",
"properties": {}
}
},
{
"name": "get_android_screen",
"description": "Capture a screenshot from an Android device",
"inputSchema": {
"type": "object",
"properties": {
"device": {
"type": "string",
"description": "Device name (e.g., 'emulator-5554'). If not provided, uses the first available device."
}
}
}
}
]
}
}
Device List Tool Call Response
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"content": [
{
"type": "text",
"text": "[{\"name\":\"Pixel 2 API 30\",\"device\":\"emulator-5554\",\"model\":\"sdk_gphone_x86\",\"arch\":\"x86\",\"android_version\":\"11\",\"sdk_level\":\"30\",\"run_status\":\"device\"}]"
}
],
"isError": false
}
}
Screenshot Tool Call Response
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"content": [
{
"type": "image",
"data": "iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAA...(base64 encoded PNG data)...==",
"mimeType": "image/png"
}
],
"isError": false
}
}
Note: The data field contains the complete Base64-encoded PNG image. The actual response will contain the full Base64 string, which has been truncated in this example for readability.
Requirements
- Go 1.19 or later
- Android SDK with
adbin PATH - Connected Android devices or running emulators