screen-buffer-mcp

screen-buffer-mcp

An MCP server that enables high-speed Android screenshot capture with ~50ms latency using the scrcpy frame buffer. It maintains a circular buffer for instant access to recent frames and automatically falls back to ADB when scrcpy is unavailable.

Category
Visit Server

README

screen-buffer-mcp

MCP server for fast Android screenshots via scrcpy frame buffer (~50ms latency).

<!-- mcp-name: io.github.vladkarpman/screen-buffer-mcp -->

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured