JS

juancf/scrcpy-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

145 stars 24 forks 质量 87 趋势 22MIT

juancf/scrcpy-mcp 是从 https://github.com/juancf/scrcpy-mcp. 导入的 MCP 服务器候选

概览

juancf/scrcpy-mcp 是从 https://github.com/juancf/scrcpy-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

MCP服务器通过ADB和SCRCPY,为AI代理提供对安卓设备的全面视野和控制。

将任何兼容MCP的AI助手(Claude Code、OpenCode、Cursor、VS Code Copilot等)连接到你的安卓设备。AI可以看到屏幕、点击、滑动、输入、启动应用、检查UI元素、传输文件并运行shell命令。

特色

  • 44 个工具,涵盖截图、输入、应用、UI 自动化、shell、文件、剪贴板、视频流和音频流/录制
  • SCRCPY-FIRST:使用 SCRCPY 的二进制控制协议,实现 10-50 倍的输入速度和近乎即时截图(~33ms)
  • ADB 备份:交互工具无需 SCRCPY ——速度较慢但始终可用(音频工具 start_audio_stream/[audio_record_start 和视频流需要 SCRCPY)
  • 返回图像截图:AI实际上能看到屏幕,而不仅仅是文件路径
  • UI 元素查找:ui_find_element 返回点击坐标,以便 AI 根据所见进行操作
  • 音频流式流式和录制:将设备音频流式传输到主机扬声器(start_audio_stream)或捕获到.wav/.opus(audio_record_start)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

scrcpy-mcp

MCP server that gives AI agents full vision and control over Android devices via ADB and scrcpy.

Connect any MCP-compatible AI assistant (Claude Code, OpenCode, Cursor, VS Code Copilot, etc.) to your Android device. The AI can see the screen, tap, swipe, type, launch apps, inspect UI elements, transfer files, and run shell commands.

Features

  • 44 tools covering screenshots, input, apps, UI automation, shell, files, clipboard, video streaming, and audio streaming/recording
  • scrcpy-first: uses scrcpy’s binary control protocol for 10-50x faster input and near-instant screenshots (~33ms)
  • ADB fallback: interaction tools work without scrcpy — slower but always available (the audio tools start_audio_stream/audio_record_start and the video stream require scrcpy)
  • Image-returning screenshots: the AI actually sees the screen, not just a file path
  • UI element finding: ui_find_element returns tap coordinates so the AI can act on what it sees
  • Audio streaming & recording: stream device audio to host speakers (start_audio_stream) or capture to .wav/.opus (audio_record_start)
  • Clipboard that works on Android 10+: scrcpy bypasses the restrictions that break ADB-only solutions

Prerequisites

Required

Requirement Install Verify
Node.js 24+ nodejs.org or nvm install (uses .nvmrc) node --version
ADB (Android Platform Tools) developer.android.com/tools/releases/platform-tools adb version
Android device with USB debugging (Android 11+ for audio) Settings → Developer Options → USB Debugging adb devices

Optional (for enhanced performance)

Requirement Install Benefit
scrcpy github.com/Genymobile/scrcpy 10-50x faster input, ~33ms screenshots
ffmpeg apt install ffmpeg / brew install ffmpeg Required for scrcpy video stream decoding, audio recording, and audio clip capture
ffplay Usually packaged with ffmpeg Required for audio playback and the MJPEG viewer window

Device setup

  1. Enable Developer Options: Settings → About Phone → tap “Build Number” 7 times
  2. Enable USB Debugging: Settings → Developer Options → USB Debugging
  3. Connect device via USB
  4. Accept the RSA fingerprint prompt on the device
  5. Verify: adb devices should show your device as device (not unauthorized)

Installation

# Run directly with npx (no install needed)
npx scrcpy-mcp

# Or install globally
npm install -g scrcpy-mcp

MCP Client Configuration

Claude Code

claude mcp add android -- npx scrcpy-mcp

Or add to .mcp.json in your project root:

在 GitHub 查看完整 README

安装

npx scrcpy-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "android": { "command": "npx", "args": ["scrcpy-mcp"] } } }