Skip to main content
Glama
README.md
# ADB MCP

A Model Context Protocol (MCP) server that provides Android Debug Bridge (ADB) functionality for automating Android devices.

## Features

### Device Management
- List connected devices
- Get device information
- Set default device for operations
- Check device connection status

### Screen Operations
- Take screenshots
- Click at coordinates
- Swipe gestures
- Input text
- Press keys

### App Management
- Install/uninstall apps
- Start/stop apps
- List installed apps
- Get app information

### File Operations
- Push files to device
- Pull files from device
- List files and directories
- Create directories
- Delete files

### Shell Commands
- Execute shell commands
- Get system information
- Get battery information
- Get logcat output

## Installation

1. Clone the repository
2. Install dependencies:
   ```bash
   npm install
   ```

3. Build the project:
   ```bash
   npm run build
   ```

## Usage

### Prerequisites
- Android Debug Bridge (adb) must be installed and available in PATH
- Android device connected via USB with USB debugging enabled
- Device must be authorized for debugging

### Running the Server
```bash
npm start
```

### Available Tools

#### Device Management
- `adb_list_devices` - List all connected devices
- `adb_get_device_info` - Get device information
- `adb_set_default_device` - Set default device

#### Screen Operations
- `adb_screenshot` - Take screenshot
- `adb_click` - Click at coordinates
- `adb_swipe` - Swipe gesture
- `adb_input_text` - Input text
- `adb_press_key` - Press key

#### App Management
- `adb_install_app` - Install APK
- `adb_uninstall_app` - Uninstall app
- `adb_start_app` - Start app
- `adb_stop_app` - Stop app
- `adb_list_apps` - List installed apps

#### File Operations
- `adb_push_file` - Push file to device
- `adb_pull_file` - Pull file from device
- `adb_list_files` - List files in directory

#### Shell Commands
- `adb_shell` - Execute shell command
- `adb_get_system_info` - Get system information
- `adb_get_battery_info` - Get battery information
- `adb_get_logcat` - Get logcat output

## Security

The server includes basic security measures:
- Dangerous shell commands are blocked
- File path validation
- Device connection verification
- Input sanitization

## Development

### Build
```bash
npm run build
```

### Development Mode
```bash
npm run dev
```

### Lint
```bash
npm run lint
```

### MCP
```bash
      "mcpServers": {
        "adb-mcp": {
          "type": "stdio",
          "command": "node",
          "args": [
            "/adb-mcp/dist/index.js"
          ],
          "env": {
            "ADB_DOWNLOAD_PATH": "/adb-mcp",
            "MCP_READ_PATH": "/adb-mcp"
          }
        }
      }
```

## License

MIT

TDQS

B3.4/5.0

Scored across 20 tools

Disambiguation5/5

Every tool has a clearly distinct purpose with no ambiguity - each targets a specific Android Debug Bridge operation like clicking, getting info, installing apps, or file management. The descriptions clearly differentiate actions like adb_click vs adb_swipe, adb_install_app vs adb_uninstall_app, and adb_pull_file vs adb_push_file.

Naming Consistency5/5

All tools follow a perfect 'adb_verb_noun' pattern consistently throughout the entire set. The naming convention is uniform with clear action-object relationships, making it easy to understand what each tool does at a glance.

Tool Count4/5

20 tools is slightly high but reasonable for comprehensive Android device management. The count covers essential ADB operations without obvious bloat, though some related operations like app clearing or system property setting could potentially be added or consolidated.

Completeness5/5

The toolset provides complete coverage for Android device management through ADB, including device listing/selection, app lifecycle management (install/start/stop/uninstall), file operations, input simulation, system information retrieval, and debugging capabilities. No significant gaps exist for core ADB workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues