Skip to main content
Glama
README.md
# mcp-screenshot

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![MCP](https://img.shields.io/badge/MCP-compatible-brightgreen.svg)](https://modelcontextprotocol.io)
[![macOS](https://img.shields.io/badge/platform-macOS-lightgrey.svg)]()

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that provides screen capture capabilities on macOS. Enables AI assistants like Claude to take screenshots of your display for visual debugging, UI verification, and more.

## Features

- Full screen capture (single or multi-monitor)
- Region capture by pixel coordinates
- Returns images as base64-encoded PNG
- Zero external dependencies beyond macOS built-in `screencapture`
- Lightweight stdio transport

## Prerequisites

- **macOS** (uses the native `screencapture` CLI)
- **Node.js** >= 18
- **Screen Recording permission** granted to your terminal or IDE

## Quick Start

### 1. Clone and install

```bash
git clone https://github.com/zhandos717/mcp-screenshot.git
cd mcp-screenshot
npm install
```

### 2. Add to your MCP client

Add the following to your MCP configuration file (e.g. `~/.mcp.json` for Claude Code):

```json
{
  "mcpServers": {
    "screenshot": {
      "command": "npx",
      "args": ["tsx", "/absolute/path/to/mcp-screenshot/src/index.ts"]
    }
  }
}
```

### 3. Grant screen recording permission

Go to **System Settings > Privacy & Security > Screen Recording** and enable access for your terminal app (Terminal, iTerm2, Warp, etc.) or IDE.

### 4. Restart your MCP client

Restart Claude Code (or your MCP host) to pick up the new server.

## Available Tools

| Tool | Description | Parameters |
|------|-------------|------------|
| `screenshot_fullscreen` | Capture the entire screen as PNG | `display` (optional) — display number, 1 = main |
| `screenshot_region` | Capture a rectangular region as PNG | `x`, `y`, `width`, `height` — all in pixels |

### Example usage with Claude Code

```
You: "Look at my screen, something looks off with the layout"
Claude: [calls screenshot_fullscreen] I can see the issue — the sidebar is overlapping...

You: "Capture the top-left 500x500 area"
Claude: [calls screenshot_region with x=0, y=0, width=500, height=500]
```

## Configuration

### Multi-monitor setup

Pass the `display` parameter to `screenshot_fullscreen`:
- `1` — main display (default)
- `2`, `3`, ... — additional displays

### Alternative: run with compiled JS

```bash
npm run build
```

Then update your MCP config:

```json
{
  "mcpServers": {
    "screenshot": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-screenshot/dist/index.js"]
    }
  }
}
```

## How It Works

```
MCP Client (Claude Code)
    │
    │  stdio (JSON-RPC)
    ▼
mcp-screenshot server
    │
    │  execFile("screencapture", [...args, tmpFile])
    ▼
macOS screencapture CLI
    │
    │  PNG file → read → base64 → cleanup
    ▼
Image returned to client
```

The server uses macOS native `screencapture` with the `-x` flag (silent, no shutter sound) and writes to a temp file that is immediately read and deleted.

## Limitations

- **macOS only** — relies on the native `screencapture` command
- Screen Recording permission must be granted before first use
- Large screenshots (e.g. Retina 5K displays) produce ~5-10MB base64 payloads

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.

## License

[MIT](LICENSE)

TDQS

A4/5.0

Scored across 2 tools

Disambiguation5/5

The two tools target clearly distinct scopes: the whole screen versus a rectangular sub-region. There is no overlap in purpose, and the descriptions make the boundary explicit (full display vs. pixel-coordinate region).

Naming Consistency5/5

Both names follow the same predictable pattern: the shared prefix 'screenshot_' plus a scope qualifier ('fullscreen', 'region'). The convention is uniform snake_case and immediately readable.

Tool Count4/5

Two tools is a narrow surface, but it accurately matches the tightly scoped purpose of a screenshot server. It is on the thin side of the typical 3-15 range, but no tool is redundant or wasted.

Completeness4/5

The core capture workflows (full screen and region) are covered, so there are no dead ends for the primary use case. Minor gaps exist, such as capturing a single window, choosing a specific display, or writing directly to a file path instead of base64 only.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues