# r_adb_mcp_server
## 基本信息
- Slug: `rahulkr-r_adb_mcp_server`
- Source: modelscope
- Publisher: @rahulkr/r_adb_mcp_server
- Categories: developer-tools / testing-and-qa-tools / app-automation
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@rahulkr/r_adb_mcp_server
## 简介
暂无描述。
## 安装提示

```bash
# Install from PyPI pip install r-adb-mcp-server # Or run directly with uvx (no installation needed) uvx r-adb-mcp-server
```

## MCP Server 详情

# Enhanced ADB MCP Server for Flutter/Android Development

[![PyPI version](https://badge.fury.io/py/r-adb-mcp-server.svg)](https://badge.fury.io/py/r-adb-mcp-server)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A comprehensive MCP server for controlling Android devices via ADB, specifically designed for Flutter development, UI testing, and visual QA workflows.

## Quick Start

```bash
# Install from PyPI
pip install r-adb-mcp-server

# Or run directly with uvx (no installation needed)
uvx r-adb-mcp-server
```

**Note:** Both the package name and command are `r-adb-mcp-server`.

Then add to your MCP client configuration (Claude Desktop, Cursor, etc.) - see [Configuration](#configuration) section below.

## Features

###  Device Management
- List connected devices with details
- Get comprehensive device info (model, Android version, battery, etc.)
- Screen specifications with DP calculations

###  Visual Capture
- Screenshots (base64 or file)
- Screen recording with start/stop control
- Capture with metadata for Figma comparison

###  UI Inspection
- Full UI hierarchy dump (XML)
- Find elements by text or resource ID
- Get all clickable elements with coordinates
- Extract all visible text for verification

###  Input & Interaction
- Tap, double-tap, long-press
- Swipe and scroll (up/down/to-text)
- Text input and clear
- Key events (HOME, BACK, ENTER, etc.)
- Tap elements by text or ID

###  App Management
- Launch/stop/clear apps
- Install/uninstall APKs
- List packages with filtering
- Get current activity
- App info (version, install date, etc.)

###  Debugging & Logs
- Logcat with filtering (tag, level, package)
- Flutter-specific logs
- Crash logs extraction
- ANR traces

###  Performance Profiling
- Memory usage per app
- CPU monitoring
- GPU rendering info
- Frame stats for jank detection
- Battery statistics

###  Network Control
- Network info (WiFi status, IP)
- Toggle WiFi/Airplane mode
- Set/clear HTTP proxy

###  Developer Options
- Animation scale (speed up tests)
- Show taps (for recordings)
- Show layout bounds
- Screen rotation control
- Change resolution/density

###  Accessibility Testing
- Font scale adjustment
- TalkBack toggle
- High contrast mode
- Color inversion

###  Emulator Features
- GPS location spoofing
- Simulate SMS/calls

## Prerequisites

1. **ADB installed** and in your PATH
   ```bash
   adb version
   ```

2. **Android device/emulator** connected with USB debugging enabled
   ```bash
   adb devices
   ```

3. **Python 3.10+** and optionally `uv` for running with `uvx`

   To install `uv` (optional, for `uvx` command):
   ```bash
   # macOS/Linux
   curl -LsSf https://astral.sh/uv/install.sh | sh

   # Or with Homebrew (macOS)
   brew install uv

   # Or with pip
   pip install uv
   ```

## Installation

### From PyPI (Recommended)

```bash
# Install globally with pip
pip install r-adb-mcp-server

# Or use with uvx (no installation needed)
uvx r-adb-mcp-server
```

### From Source

```bash
cd adb-mcp-server

# Using uv (recommended)
uv sync

# Or using pip
pip install -e .
```

## Configuration

### Claude Desktop

**Using installed package (recommended):**

macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
Linux: `~/.config/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "adb": {
      "command": "uvx",
      "args": ["r-adb-mcp-server"]
    }
  }
}
```

**Or if installed with pip:**

```json
{
  "mcpServers": {
    "adb": {
      "command": "r-adb-mcp-server"
    }
  }
}
```

**Using from source:**

```json
{
  "mcpServers": {
    "adb": {
      "command": "uv",
      "args": ["--directory", "/path/to/adb-mcp-server", "run", "python", "src/adb_mcp_server/server.py"]
    }
  }
}
```

### Cursor IDE

Add to `.cursor/mcp.json`:

**Using installed package (recommended):**

```json
{
  "mcpServers": {
    "adb": {
      "command": "uvx",
      "args": ["r-adb-mcp-server"]
    }
  }
}
```

**Using from source:**

```json
{
  "mcpServers": {
    "adb": {
      "command": "uv",
      "args": ["--directory", "/path/to/adb-mcp-server", "run", "python", "src/adb_mcp_server/server.py"]
    }
  }
}
```

### Claude Code

**Using installed package (recommended):**

```bash
claude mcp add adb -- uvx r-adb-mcp-server
```

**Using from source:**

```bash
claude mcp add adb -- uv --directory /path/to/adb-mcp-server run python src/adb_mcp_server/server.py
```

### GitHub Copilot

**Using installed package (recommended):**

Add to your VS Code settings (`.vscode/settings.json` or User Settings):

```json
{
  "github.copilot.chat.mcp.servers": {
    "adb": {
      "command": "uvx",
      "args": ["r-adb-mcp-server"]
    }
  }
}
```

**Or if installed with pip:**

```json
{
  "github.copilot.chat.mcp.servers": {
    "adb": {
      "command": "r-adb-mcp-server"
    }
  }
}
```

**Using from source:**

```json
{
  "github.copilot.chat.mcp.servers": {
    "adb": {
      "command": "uv",
      "args": ["--directory", "/path/to/adb-mcp-server", "run", "python", "src/adb_mcp_server/server.py"]
    }
  }
}
```

**Note:** Make sure you have GitHub Copilot Chat extension installed and MCP support enabled in VS Code.

## Available Tools (60+)

### Device Management
| Tool | Description |
|------|-------------|
| `list_devices()` | List all connected devices |
| `get_device_info()` | Comprehensive device details |
| `get_screen_specs()` | Screen size, density, DP values |

### Visual Capture
| Tool | Description |
|------|-------------|
| `screenshot()` | Capture as base64 PNG |
| `screenshot_to_file(filename)` | Save screenshot to file |
| `start_screen_record(duration, filename)` | Start recording (max 180s) |
| `stop_screen_record()` | Stop recording |
| `pull_recordings(local_dir)` | Download recordings |
| `capture_screen_for_comparison(name)` | Screenshot with metadat…

