Content
# Android ADB MCP Server



This is an Android ADB server based on the MCP protocol, allowing remote control of Android devices connected to the computer through Claude for Desktop or other MCP clients.
## Features
- **Device Management**: List connected Android devices
- **Screen Operations**: Screenshot, tap, swipe (up, down, left, right)
- **Input Operations**: Text input, key simulation
- **Application Management**: Install/uninstall applications, launch applications
- **System Operations**: Get screen resolution and other device information
- **Network Tools**: Get network status, port scanning, WIFI management
- **File Tools**: File upload/download, file management
- **Advanced Tools**: UI testing, performance analysis, screen recording, log collection, enhanced application launch
## Prerequisites
1. Python 3.10 or higher
2. ADB installed and added to the system path
3. Android device has USB debugging enabled and is connected to the computer
## Installation
```bash
# Clone this repository
git clone https://github.com/wolfcoming/adb_mcp_server.git
cd adb_mcp_server
# Install dependencies
pip install -r requirements.txt
# Ensure ADB server is running
adb start-server
```
## Usage
### Configuration in Claude for Desktop
1. Install [Claude for Desktop](https://claude.ai/desktop)
2. Configure MCP server:
- Find the Claude for Desktop configuration file, usually in `~/Library/Application Support/Claude/claude_desktop_config.json`
- Add the following configuration:
```json
{
"mcpServers": {
"android_adb": {
"command": "python",
"args": [
"-m",
"src.adb_server"
],
"cwd": "/path/to/adb_mcp_server"
}
}
}
```
3. Restart Claude for Desktop
### Configuration in Cursor
1. Find the Cursor configuration file, usually in `~/.cursor/mcp.json`
2. Add the following configuration:
```json
{
"mcpServers": {
"android_adb": {
"command": "python",
"args": [
"-m",
"src.adb_server"
],
"cwd": "/path/to/adb_mcp_server"
}
}
}
```
3. Restart Cursor
## Supported Tools
### Device Management
- `list_devices`: List all connected Android devices
### Screen Operations
- `take_screenshot`: Capture device screen
- `tap_screen`: Tap the screen at the specified location
- `swipe_up`: Swipe up
- `swipe_down`: Swipe down
- `swipe_left`: Swipe left
- `swipe_right`: Swipe right
### Input Operations
- `input_text`: Input text
- `press_key`: Press the specified key
- `press_back`: Press the back key
- `press_home`: Press the Home key
### Application Management
- `start_app`: Start application
- `install_apk`: Install APK
- `uninstall_app`: Uninstall application
### System Operations
- `get_screen_resolution`: Get screen resolution
### Network Tools
- `get_ip_address`: Get device IP address
- `ping`: Test network connection
- `scan_ports`: Scan specified ports
- `get_wifi_status`: Get WIFI status
- `connect_wifi`: Connect to WIFI network
### File Tools
- `list_files`: List files in the directory
- `upload_file`: Upload file to device
- `download_file`: Download file from device
- `create_file`: Create file
- `delete_file`: Delete file
### Advanced Tools
- `dump_ui_hierarchy`: Get UI hierarchy
- `run_ui_test`: Execute UI test steps
- `check_element_exists`: Check if UI element exists
- `tap_element_by_text`: Tap UI element containing specified text
- `collect_device_logs`: Collect device logs
- `analyze_performance`: Analyze application performance
- `take_screen_recording`: Record device screen video
- `enhanced_start_app`: Enhanced application launch function, can bypass permission restrictions
## Example Usage
In Claude for Desktop, you can use it like this:
```
# Device related
"I want to see the connected Android devices"
"Please take a screenshot of my Android device screen"
# Application operations
"Please install this APK file: /path/to/app.apk"
"Please start the settings application (com.android.settings)"
"Please use the enhanced startup function to open the China News Network application, even if there are permission issues"
# Input and interaction
"Please click on the screen coordinates (500, 500)"
"Please swipe up from the bottom of the screen"
"Please click the button containing the text 'Settings'"
# File operations
"Please list the files in the /sdcard/ directory on the device"
"Please download /sdcard/DCIM/pic.jpg from the device to my computer"
# Network operations
"Please check the device's WIFI status"
"Please connect to the network named 'MyWifi'"
# Advanced features
"Please analyze the performance of the 'com.example.app' application for 30 seconds"
"Please record a 10-second screen video"
"Please collect recent device logs"
```
## Tips
- If you encounter problems, make sure the ADB server is running (`adb start-server`)
- Make sure the Android device has authorized your computer for USB debugging
- Some operations may require root privileges
- If you encounter "Permission Denial" permission issues, please use the `enhanced_start_app` advanced tool
## Contributing
Welcome to submit issues and contribute code! Please feel free to submit a Pull Request or create an Issue.
## License
MIT © [wolfcoming](https://github.com/wolfcoming)
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)