scrcpy-mcp
Provides full vision and control over Android devices via ADB and scrcpy, enabling AI agents to interact with the device screen, input, apps, UI, shell, files, and clipboard.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@scrcpy-mcptake a screenshot of my home screen"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
34 tools covering screenshots, input, apps, UI automation, shell, files, and clipboard
scrcpy-first: uses scrcpy's binary control protocol for 10-50x faster input and near-instant screenshots (~33ms)
ADB fallback: every tool works without scrcpy — slower but always available
Image-returning screenshots: the AI actually sees the screen, not just a file path
UI element finding:
ui_find_elementreturns tap coordinates so the AI can act on what it seesClipboard that works on Android 10+: scrcpy bypasses the restrictions that break ADB-only solutions
Prerequisites
Required
Requirement | Install | Verify |
Node.js 22+ | nodejs.org or |
|
ADB (Android Platform Tools) |
| |
Android device with USB debugging | Settings → Developer Options → USB Debugging |
|
Optional (for enhanced performance)
Requirement | Install | Benefit |
scrcpy | 10-50x faster input, ~33ms screenshots | |
ffmpeg |
| Required for scrcpy video stream decoding |
Device setup
Enable Developer Options: Settings → About Phone → tap "Build Number" 7 times
Enable USB Debugging: Settings → Developer Options → USB Debugging
Connect device via USB
Accept the RSA fingerprint prompt on the device
Verify:
adb devicesshould show your device asdevice(notunauthorized)
Installation
# Run directly with npx (no install needed)
npx scrcpy-mcp
# Or install globally
npm install -g scrcpy-mcpMCP Client Configuration
Claude Code
claude mcp add android -- npx scrcpy-mcpOr add to .mcp.json in your project root:
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["scrcpy-mcp"]
}
}
}OpenCode
Add to .mcp.json:
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["scrcpy-mcp"]
}
}
}Cursor
Settings → MCP → Add Server:
{
"android": {
"command": "npx",
"args": ["scrcpy-mcp"]
}
}Claude Desktop
Edit ~/.config/Claude/claude_desktop_config.json (Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["scrcpy-mcp"]
}
}
}VS Code (GitHub Copilot)
Add to .vscode/mcp.json:
{
"servers": {
"android": {
"command": "npx",
"args": ["scrcpy-mcp"]
}
}
}Customizing Environment Variables
If you need to configure custom options (such as pointing to a non-standard scrcpy-server path or forcing a specific version), you can add the "env" object to your server configuration. For example:
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["scrcpy-mcp"],
"env": {
"SCRCPY_SERVER_PATH": "C:\\path\\to\\scrcpy-server",
"SCRCPY_SERVER_VERSION": "3.3.4"
}
}
}
}Note: On Windows, remember to double-escape backslashes (\\) in your configuration paths.
Tool Reference
Session Management
Tool | Description |
| Start a scrcpy session. When active, input and screenshots use the fast path (10-50x faster). |
| Stop the scrcpy session. Tools fall back to ADB. |
Device Management
Tool | Description |
| List all connected devices with serial, state, and model |
| Get model, Android version, screen size, SDK level, battery |
| Wake the device screen |
| Turn the screen off |
| Rotate the screen (requires active session) |
| Pull down the notification panel (requires active session) |
| Pull down the quick settings panel (requires active session) |
| Collapse notification/settings panels (requires active session) |
Vision
Tool | Description |
| Capture the screen and return it as an image. ~33ms with scrcpy, ~500ms via ADB. |
| Start recording the screen to a file on the device |
| Stop recording and optionally pull the file to the host |
Input Control
All input tools use scrcpy (~5-10ms) when a session is active, otherwise fall back to ADB (~100-300ms).
Tool | Description |
| Tap at screen coordinates |
| Swipe from one point to another |
| Long press at coordinates |
| Drag from one point to another |
| Type a text string into the focused field |
| Send a key event: HOME, BACK, ENTER, VOLUME_UP, VOLUME_DOWN, POWER, etc. |
| Scroll at a position (dx=horizontal, dy=vertical) |
App Management
Tool | Description |
| Launch an app by package name. Prefix with |
| Force-stop an app |
| Install an APK from the host machine |
| Uninstall an app |
| List installed packages, optionally filter by name or system/third-party |
| Get the current foreground app and activity |
UI Automation
Tool | Description |
| Dump the full UI hierarchy as XML |
| Find elements by text, resource ID, class name, or content description. Returns tap coordinates. |
Shell & Files
Tool | Description |
| Execute an arbitrary ADB shell command and return the output |
| Push a file from the host machine to the device |
| Pull a file from the device to the host machine |
| List directory contents on the device |
Clipboard
Tool | Description |
| Get clipboard content. Uses scrcpy to bypass Android 10+ restrictions. |
| Set clipboard content. Pass |
Performance
Operation | scrcpy (session active) | ADB fallback |
Screenshot | ~33ms | ~500ms |
Tap / Swipe | ~5-10ms | ~100-300ms |
Text input | ~5ms | ~100-300ms |
Clipboard | ~10ms | unreliable on Android 10+ |
Start a session once at the beginning to unlock the fast path:
start_session → take screenshots → tap → swipe → ...Environment Variables
Variable | Default | Description |
|
| Path to the ADB binary |
| (none) | Default device serial, overrides auto-detection |
| (auto) | Path to the scrcpy-server binary |
| (auto) | Version of the scrcpy-server binary |
|
| Path to the ffmpeg binary |
When only one device is connected, tools auto-detect it. With multiple devices, pass the serial parameter explicitly or set ANDROID_SERIAL.
Troubleshooting
adb devices shows unauthorized
Accept the RSA fingerprint prompt on the device. If the prompt doesn't appear, revoke USB debugging authorizations in Developer Options and reconnect.
start_session fails
Make sure scrcpy is installed and the scrcpy-server binary is accessible. Set SCRCPY_SERVER_PATH if it's in a non-standard location.
File vs Directory: Ensure
SCRCPY_SERVER_PATHpoints directly to thescrcpy-serverfile itself (e.g.C:\path\to\scrcpy-server), NOT to its parent folder.Android Directory Conflict: If you previously pushed a directory to the server path,
/data/local/tmp/scrcpy-server.jaron the Android device might have been created as a folder. Runadb shell rm -rf /data/local/tmp/scrcpy-server.jarto delete it.Version Mismatch: Ensure
SCRCPY_SERVER_VERSIONmatches the exact version of thescrcpy-serverfile (e.g.,"3.3.4"). If they mismatch, the Android JVM will fail withjava.lang.ClassNotFoundException: com.genymobile.scrcpy.Server.
Screenshots are slow (~500ms)
Start a scrcpy session with start_session to enable the fast video stream path. Requires scrcpy and ffmpeg.
expand_notifications / expand_settings / collapse_panels fail
These tools require an active scrcpy session. Run start_session first.
Clipboard doesn't work on Android 10+ ADB clipboard access is restricted on Android 10+. Start a scrcpy session — the scrcpy clipboard protocol bypasses this restriction.
Multiple devices connected
Pass serial to each tool or set the ANDROID_SERIAL environment variable.
Security
This server provides full control over connected Android devices. The shell_exec tool can run arbitrary commands, and file_push/file_pull can read and write any file accessible to the shell user.
The server runs locally over stdio — it is not exposed to the network
ADB requires USB debugging to be explicitly enabled on the device
The device must accept your host's RSA key on first connection
Only connect devices you own and trust the AI agent you are using
License
MIT — see LICENSE
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JuanCF/scrcpy-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server