Skip to main content

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_frame for 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:

  1. 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.

  2. adb backend (fallback): Uses adb exec-out screencap -p for 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

Metadata

Release files for screen-buffer-mcp 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for screen-buffer-mcp 2.1.0
File Size Uploaded
screen_buffer_mcp-2.1.0.tar.gz 93.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for screen-buffer-mcp 2.1.0
File Interpreter ABI Platform
screen_buffer_mcp-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 107.4 kB

Release files / screen_buffer_mcp-2.1.0.tar.gz

Download URL screen_buffer_mcp-2.1.0.tar.gz
Size 93.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d0fa4b26bb22bc796e88f503621104e5ad9ac6e0d8ba878f5eb7fd36125d255d
BLAKE2b-256 checksum
How to use checksums
b709f4af30efb79319ab8fcc7adb884089bfb333835fd63a7bde0560dd4ac129
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2026.

Transparency log

Release files / screen_buffer_mcp-2.1.0-py3-none-any.whl

Download URL screen_buffer_mcp-2.1.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
933aec0648007cc201bfd5aa8ae2f6e4fbe7a7c32fe4abd50ceb927db726dddd
BLAKE2b-256 checksum
How to use checksums
29038b49f6cd76ade2363fcf1ae799b612627b1f22fa09e0c54b5e9c0f9beb35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page