MCP server for fast Android screenshots via scrcpy frame buffer
Project description
screen-buffer-mcp
MCP server for fast Android screenshots via scrcpy frame buffer (~50ms latency).
Features
- Fast screenshots via scrcpy frame buffer (~50ms vs ~500ms with adb)
- 10-frame circular buffer for instant access to recent frames
- Historical frame access via
device_get_framefor debugging/recording - Automatic fallback to adb when scrcpy unavailable
- Works with Claude Code and any MCP-compatible client
Requirements
- macOS 12+ or Linux
- Python 3.11+
- adb (Android Debug Bridge)
- scrcpy 3.x installed
- Android device connected via USB
Usage with Claude Code
Add to your .mcp.json:
{
"mcpServers": {
"screen-buffer": {
"command": "uvx",
"args": ["screen-buffer-mcp"]
}
}
}
Or add globally:
claude mcp add screen-buffer -s user -- uvx screen-buffer-mcp
Available Tools
| Tool | Description | Latency |
|---|---|---|
device_screenshot |
Capture latest frame from buffer | ~50ms (scrcpy) / ~500ms (adb) |
device_get_frame |
Get historical frame at offset | ~10ms |
device_list |
List connected devices | ~100ms |
device_screen_size |
Get screen dimensions | ~10ms |
device_backend_status |
Check active backend | instant |
How It Works
The server maintains a 10-frame circular buffer from the scrcpy video stream:
-
scrcpy backend (preferred): Connects to scrcpy server on device in video-only mode. Continuously captures frames at ~60fps into a circular buffer. Screenshots return the latest buffered frame instantly.
-
adb backend (fallback): Uses
adb exec-out screencap -pfor screenshots. Works everywhere but slower (~500ms per screenshot).
Frame Buffer
The frame buffer stores the last 10 frames (~160ms at 60fps), enabling:
- Instant screenshots: Latest frame always ready, no capture delay
- Historical access: Get frames from before an action for debugging
- Recording support: Extract frames at specific offsets
# Get latest screenshot
device_screenshot()
# Get frame from 100ms ago (offset 6 at 60fps)
device_get_frame(offset=6)
Configuration
Environment Variables
SCREEN_BUFFER_LOG_LEVEL: Set logging level (DEBUG, INFO, WARNING, ERROR)
Multiple Devices
Specify device ID for multi-device setups:
device_screenshot(device="RFCW318P7NV")
Use with mobile-mcp
For full device control (taps, swipes, typing), combine with mobile-mcp:
{
"mcpServers": {
"screen-buffer": {
"command": "uvx",
"args": ["screen-buffer-mcp"]
},
"mobile-mcp": {
"command": "npx",
"args": ["-y", "@mobilenext/mobile-mcp@latest"]
}
}
}
- screen-buffer-mcp: Fast screenshots (~50ms)
- mobile-mcp: Device input (tap, swipe, type)
Development
git clone https://github.com/vladkarpman/screen-buffer-mcp
cd screen-buffer-mcp
pip install -e ".[dev]"
pytest
License
MIT License - see LICENSE for details.
Related Projects
- mobile-mcp - Official Anthropic mobile MCP
- MYScrcpy - Python scrcpy client
- Claude Code - AI coding assistant
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file screen_buffer_mcp-2.1.0.tar.gz.
File metadata
- Download URL: screen_buffer_mcp-2.1.0.tar.gz
- Upload date:
- Size: 93.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0fa4b26bb22bc796e88f503621104e5ad9ac6e0d8ba878f5eb7fd36125d255d
|
|
| MD5 |
4fec9d25e6416cda652c4f011b54d843
|
|
| BLAKE2b-256 |
b709f4af30efb79319ab8fcc7adb884089bfb333835fd63a7bde0560dd4ac129
|
Provenance
The following attestation bundles were made for screen_buffer_mcp-2.1.0.tar.gz:
Publisher:
release.yml on vladkarpman/screen-buffer-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
screen_buffer_mcp-2.1.0.tar.gz -
Subject digest:
d0fa4b26bb22bc796e88f503621104e5ad9ac6e0d8ba878f5eb7fd36125d255d - Sigstore transparency entry: 827876924
- Sigstore integration time:
-
Permalink:
vladkarpman/screen-buffer-mcp@170f92158b196fa01687945e10b1064e617957bc -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/vladkarpman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@170f92158b196fa01687945e10b1064e617957bc -
Trigger Event:
push
-
Statement type:
File details
Details for the file screen_buffer_mcp-2.1.0-py3-none-any.whl.
File metadata
- Download URL: screen_buffer_mcp-2.1.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
933aec0648007cc201bfd5aa8ae2f6e4fbe7a7c32fe4abd50ceb927db726dddd
|
|
| MD5 |
ab2dd2e9b09ed560dee6ec5017129cb2
|
|
| BLAKE2b-256 |
29038b49f6cd76ade2363fcf1ae799b612627b1f22fa09e0c54b5e9c0f9beb35
|
Provenance
The following attestation bundles were made for screen_buffer_mcp-2.1.0-py3-none-any.whl:
Publisher:
release.yml on vladkarpman/screen-buffer-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
screen_buffer_mcp-2.1.0-py3-none-any.whl -
Subject digest:
933aec0648007cc201bfd5aa8ae2f6e4fbe7a7c32fe4abd50ceb927db726dddd - Sigstore transparency entry: 827876942
- Sigstore integration time:
-
Permalink:
vladkarpman/screen-buffer-mcp@170f92158b196fa01687945e10b1064e617957bc -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/vladkarpman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@170f92158b196fa01687945e10b1064e617957bc -
Trigger Event:
push
-
Statement type: