Skip to main content
Glama
vladkarpman

screen-buffer-mcp

by vladkarpman

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.

-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access 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/vladkarpman/screen-buffer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server