Peekaboo (macOS Screen Capture) MCP server

Enables macOS screen capture and window management with tools for taking screenshots, analyzing images, and controlling application windows
Back to servers
Setup instructions
Provider
Peter Steinberger
Release date
May 23, 2025
Language
TypeScript
Stats
562 stars

Peekaboo MCP is a powerful macOS utility that enables you to capture screenshots, analyze them with AI vision models, and automate GUI interactions. It functions as both a standalone CLI tool and as an MCP server for integration with AI assistants like Claude Desktop and Cursor.

Installation Options

Option 1: Homebrew (Recommended)

brew tap steipete/tap
brew install peekaboo

Option 2: Direct Download

curl -L https://github.com/steipete/peekaboo/releases/latest/download/peekaboo-macos-universal.tar.gz | tar xz
sudo mv peekaboo-macos-universal/peekaboo /usr/local/bin/

Option 3: npm (includes MCP server)

npm install -g @steipete/peekaboo-mcp

Basic Usage

Capturing Screenshots

# Capture specific app
peekaboo image --app Safari --path screenshot.png

# Capture frontmost window
peekaboo image --mode frontmost

# Capture specific screen
peekaboo image --mode screen --screen-index 0

Listing Applications and Windows

# List all running applications
peekaboo list apps

# List windows for a specific app
peekaboo list windows --app "Visual Studio Code"

# List all displays
peekaboo list screens

Analyzing Images with AI

# Analyze a saved screenshot
peekaboo image --analyze "What error is shown?" --path screenshot.png

# Capture and analyze in one command
peekaboo image --analyze "Find all buttons" --app Safari

# Identify UI elements
peekaboo see --analyze "Describe this UI" --app Chrome

GUI Automation

# Identify UI elements
peekaboo see --app Safari

# Click elements by text
peekaboo click "Submit"

# Type text
peekaboo type "Hello world"

# Press keyboard keys
peekaboo press return
peekaboo press tab --count 3

# Scroll content
peekaboo scroll --direction down --amount 5

# Use keyboard shortcuts
peekaboo hotkey cmd,c

AI Agent Automation

# Use natural language to perform tasks
peekaboo "Open TextEdit and write Hello World"
peekaboo agent "Take a screenshot of Safari and email it"
peekaboo agent --verbose "Find all Finder windows and close them"

Window Management

# Close window
peekaboo window close --app Safari

# Minimize window
peekaboo window minimize --app Finder

# Move window
peekaboo window move --app TextEdit --x 100 --y 100

# Resize window
peekaboo window resize --app Terminal --width 800 --height 600

# Focus window
peekaboo window focus --app "Visual Studio Code"

Multi-Screen Support

# Move app to specific screen
peekaboo window resize --app Safari --target-screen 1

# Move to next screen
peekaboo window move --app Terminal --screen-preset next

# Apply window preset on specific screen
peekaboo window resize --app Notes --preset left_half --target-screen 0

Menu Interaction

# List all menus for an app
peekaboo menu list --app Calculator

# List menus for frontmost app
peekaboo menu list-all

# Click menu item
peekaboo menu click --app Safari --item "New Window"

# Click through nested menus
peekaboo menu click --app TextEdit --path "Format > Font > Bold"

# Click system menu extras
peekaboo menu click-extra --title "WiFi"

Setting Up the MCP Server

For Claude Desktop

  1. Open Claude Desktop Settings (from the menubar)
  2. Navigate to Developer → Edit Config
  3. Add the Peekaboo MCP server configuration:
{
  "mcpServers": {
    "peekaboo": {
      "command": "npx",
      "args": ["-y", "@steipete/peekaboo-mcp@beta"],
      "env": {
        "PEEKABOO_AI_PROVIDERS": "anthropic/claude-opus-4,openai/gpt-4.1,ollama/llava:latest",
        "OPENAI_API_KEY": "your-openai-api-key-here"
      }
    }
  }
}

For Cursor IDE

Add to your Cursor settings:

{
  "mcpServers": {
    "peekaboo": {
      "command": "npx",
      "args": ["-y", "@steipete/peekaboo-mcp@beta"],
      "env": {
        "PEEKABOO_AI_PROVIDERS": "openai/gpt-4.1,ollama/llava:latest",
        "OPENAI_API_KEY": "your-openai-api-key-here"
      }
    }
  }
}

Configuration

Managing API Keys Securely

# Set API key securely (stored in ~/.peekaboo/credentials)
peekaboo config set-credential OPENAI_API_KEY sk-...

# View current configuration
peekaboo config show --effective

Setting Up Local AI with Ollama

For privacy-focused local AI analysis:

# Install Ollama
brew install ollama
ollama serve

# Download recommended models
ollama pull llama3.3           # For agent tasks
ollama pull llava:latest       # For vision tasks

# Use with Peekaboo
PEEKABOO_AI_PROVIDERS="ollama/llama3.3" peekaboo agent "Click the Submit button"

System Requirements

  • macOS 14.0+ (Sonoma or later)
  • Screen Recording Permission (required)
  • Accessibility Permission (optional, for window focus control)

Check permissions status:

peekaboo permissions check
peekaboo permissions request screen-recording
peekaboo permissions request accessibility

Troubleshooting

Enable debug logging for more details:

export PEEKABOO_LOG_LEVEL=debug
peekaboo list server_status

For step-by-step debugging, use the verbose flag:

peekaboo image --app Safari --verbose

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "peekaboo" '{"command":"npx","args":["-y","@steipete/peekaboo-mcp"],"env":{"PEEKABOO_AI_PROVIDERS":"openai/gpt-4o,ollama/llava:latest","OPENAI_API_KEY":"your-openai-api-key-here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "peekaboo": {
            "command": "npx",
            "args": [
                "-y",
                "@steipete/peekaboo-mcp"
            ],
            "env": {
                "PEEKABOO_AI_PROVIDERS": "openai/gpt-4o,ollama/llava:latest",
                "OPENAI_API_KEY": "your-openai-api-key-here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "peekaboo": {
            "command": "npx",
            "args": [
                "-y",
                "@steipete/peekaboo-mcp"
            ],
            "env": {
                "PEEKABOO_AI_PROVIDERS": "openai/gpt-4o,ollama/llava:latest",
                "OPENAI_API_KEY": "your-openai-api-key-here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later