Screen Capture MCP
Enables AI agents to capture screen regions by defining a visual overlay or arbitrary coordinates, returning base64 PNG images.
README
Screen Capture MCP
An MCP (Model Context Protocol) server that gives AI agents eyes on your screen. Define a capture region with a visual overlay, then let your agent screenshot it on demand.
Built for Claude Code but works with any MCP-compatible client.
How It Works
Two components work together:
- Overlay (
overlay.py) — A transparent, draggable frame you position over any window. It saves the coordinates to a temp file. - MCP Server (
server.js) — Reads those coordinates and uses macOSscreencaptureto grab the region, returning a base64 PNG to the agent.
┌──────────────────────────┐
│ Your App Window │
│ ┌────────────────────┐ │
│ │ ▓▓ Overlay Frame ▓▓│ │ overlay.py
│ │ ▓ ▓│ │ saves coordinates
│ │ ▓ (capture area) ▓│──────▶ /tmp/claude-viewport.json
│ │ ▓ ▓│ │
│ │ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓│ │
│ └────────────────────┘ │
│ │ server.js
└──────────────────────────┘ reads coords + screencapture
│
▼
base64 PNG → Agent
Tools
The MCP server exposes three tools:
| Tool | Description |
|---|---|
capture_viewport |
Capture the locked overlay region. Returns the image + metadata. |
get_viewport_info |
Read the current overlay coordinates without taking a screenshot. |
capture_region |
Capture any arbitrary screen region by x, y, width, height. No overlay needed. |
Setup
Prerequisites
- macOS (uses native
screencapture) - Node.js 18+
- Python 3.8+ with Tkinter
Install
git clone https://github.com/Sherif-Aboulnasr/Screen-Capture-MCP.git
cd Screen-Capture-MCP
npm install
Configure your MCP client
Add to your MCP settings (e.g. ~/.claude/settings.json for Claude Code):
{
"mcpServers": {
"screen-capture": {
"command": "node",
"args": ["/path/to/Screen-Capture-MCP/server.js"]
}
}
}
Usage
1. Start the overlay
python3 overlay.py
A lime-green border frame appears on screen.
2. Position it
- Drag the top bar to move the frame over your target window
- Drag the bottom-right handle to resize
- Click the lock icon to lock the region in place (border turns red)
3. Let your agent capture
Once locked, the agent can call capture_viewport at any time to see what's on screen.
Agent: "Let me check how that looks..."
→ calls capture_viewport
→ receives screenshot of the locked region
→ "The button is misaligned — let me fix the padding..."
Capture without the overlay
Use capture_region to grab any screen coordinates directly:
{
"x": 100,
"y": 200,
"width": 800,
"height": 600
}
Overlay controls
| Control | Action |
|---|---|
| Top bar drag | Move the frame |
| Bottom-right handle drag | Resize |
| Lock icon (top-left) | Toggle lock/unlock |
| X button (top-right) | Quit overlay |
| State | Border color |
|---|---|
| Unlocked (moveable) | Lime green |
| Locked (capture ready) | Red |
How it's built
- Overlay: Python Tkinter — four separate edge windows with a 3px border, keeping the center click-through. A separate resize handle window at the bottom-right corner.
- Server: Node.js using
@modelcontextprotocol/sdk. Reads coordinates from/tmp/claude-viewport.json, runsscreencapture -R, returns base64 PNG. - Coordinate file: JSON at
/tmp/claude-viewport.jsonwith adjusted capture coordinates and raw frame coordinates.
Use cases
- UI development — Agent captures before/after screenshots while iterating on styles
- Visual debugging — "Does this layout look right?" — agent can see for itself
- Design review — Position overlay on a Figma/design window, let the agent compare against code output
- Mobile development — Frame your iOS Simulator, let the agent see the app state
License
MIT
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.