The Peekaboo MCP server provides macOS screen capture and AI-powered image analysis for integration with AI assistants like Claude Desktop and Cursor IDE.
- Capture Screenshots: Take screenshots of entire screens, specific app windows, or all windows of an app, with control over output format (file or Base64 data).
- AI Image Analysis: Analyze captured or existing images using AI models like GPT-4 Vision, Claude, or local models via Ollama.
- System Information: List running applications, their open windows (including details like position, size, and IDs), and server status.
- Integration: Seamlessly integrate with AI assistants for visual context and debugging workflows.
- Privacy Options: Support for local AI analysis through Ollama for privacy-focused use cases.
- Advanced Targeting: Fuzzy matching and precise targeting for apps, windows, and screens.
Enables comprehensive screen capture capabilities on macOS, including capturing entire screens, specific application windows, or all windows of an app with various formatting options.
Enables local AI image analysis of screenshots through Ollama, supporting models like LLaVA and Qwen2-VL for vision tasks without sending data to the cloud.
Provides integration with OpenAI's vision models (like GPT-4o) for analyzing captured screenshots through the OpenAI API.
Peekaboo MCP: Lightning-fast macOS Screenshots 🚀
Peekaboo is a powerful macOS utility for capturing screenshots and analyzing them with AI vision models. It works both as a standalone CLI tool (recommended) and as an MCP server for AI assistants like Claude Desktop and Cursor.
🎯 Choose Your Path
🖥️ CLI Tool (Recommended for Most Users)
Perfect for:
- Command-line workflows and automation
- Shell scripts and CI/CD pipelines
- Quick screenshots and AI analysis
- System administration tasks
🤖 MCP Server (For AI Assistants)
Perfect for:
- Claude Desktop integration
- Cursor IDE workflows
- AI agents that need visual context
- Interactive AI debugging sessions
What is Peekaboo?
Peekaboo bridges the gap between visual content on your screen and AI understanding. It provides:
- Lightning-fast screenshots of screens, applications, or specific windows
- AI-powered image analysis using GPT-4 Vision, Claude, or local models
- Window and application management with smart fuzzy matching
- Privacy-first operation with local AI options via Ollama
- Non-intrusive capture without changing window focus
🚀 Quick Start: CLI Tool
Installation
Basic Usage
Configuration
Create a persistent configuration file at ~/.config/peekaboo/config.json
:
Example configuration:
Common Workflows
🤖 MCP Server Setup
For AI assistants like Claude Desktop and Cursor, Peekaboo provides a Model Context Protocol (MCP) server.
For Claude Desktop
Edit your Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
For Cursor IDE
Add to your Cursor settings:
MCP Tools Available
image
- Capture screenshotslist
- List applications, windows, or check statusanalyze
- Analyze images with AI vision models
🔧 Configuration
Configuration Precedence
Settings follow this precedence (highest to lowest):
- Command-line arguments
- Environment variables
- Configuration file (
~/.config/peekaboo/config.json
) - Built-in defaults
Available Options
Setting | Config File | Environment Variable | Description |
---|---|---|---|
AI Providers | aiProviders.providers | PEEKABOO_AI_PROVIDERS | Comma-separated list (e.g., "openai/gpt-4o,ollama/llava") |
OpenAI API Key | aiProviders.openaiApiKey | OPENAI_API_KEY | Required for OpenAI provider |
Anthropic API Key | aiProviders.anthropicApiKey | ANTHROPIC_API_KEY | For Claude Vision (coming soon) |
Ollama URL | aiProviders.ollamaBaseUrl | PEEKABOO_OLLAMA_BASE_URL | Default: http://localhost:11434 |
Default Save Path | defaults.savePath | PEEKABOO_DEFAULT_SAVE_PATH | Where screenshots are saved (default: current directory) |
Log Level | logging.level | PEEKABOO_LOG_LEVEL | trace, debug, info, warn, error, fatal |
Log Path | logging.path | PEEKABOO_LOG_FILE | Log file location |
CLI Binary Path | - | PEEKABOO_CLI_PATH | Override bundled Swift CLI path (advanced usage) |
Environment Variable Details
AI Provider Configuration
PEEKABOO_AI_PROVIDERS
: Comma-separated list of AI providers to use for image analysis- Format:
provider/model,provider/model
- Example:
"openai/gpt-4o,ollama/llava:latest"
- The first available provider will be used
- Default:
"openai/gpt-4o,ollama/llava:latest"
- Format:
OPENAI_API_KEY
: Your OpenAI API key for GPT-4 Vision- Required when using the
openai
provider - Get your key at: https://platform.openai.com/api-keys
- Required when using the
ANTHROPIC_API_KEY
: Your Anthropic API key for Claude Vision- Will be required when Claude Vision support is added
- Currently not implemented
PEEKABOO_OLLAMA_BASE_URL
: Base URL for your Ollama server- Default:
http://localhost:11434
- Use for custom Ollama installations or remote servers
- Default:
Default Behavior
PEEKABOO_DEFAULT_SAVE_PATH
: Default directory for saving screenshots- Default: Current working directory
- Supports tilde expansion (e.g.,
~/Desktop/Screenshots
) - Created automatically if it doesn't exist
Logging and Debugging
PEEKABOO_LOG_LEVEL
: Control logging verbosity- Options:
trace
,debug
,info
,warn
,error
,fatal
- Default:
info
- Use
debug
ortrace
for troubleshooting
- Options:
PEEKABOO_LOG_FILE
: Custom log file location- Default:
/tmp/peekaboo-mcp.log
(MCP server) - For CLI, logs are written to stderr by default
- Default:
Advanced Options
PEEKABOO_CLI_PATH
: Override the bundled Swift CLI binary path- Only needed if using a custom-built CLI binary
- Default: Uses the bundled binary
Using Environment Variables
Environment variables can be set in multiple ways:
🎨 Setting Up Local AI with Ollama
For privacy-focused local AI analysis:
📋 Requirements
- macOS 14.0+ (Sonoma or later)
- Screen Recording Permission (required)
- Accessibility Permission (optional, for window focus control)
Granting Permissions
- Screen Recording (Required):
- System Settings → Privacy & Security → Screen & System Audio Recording
- Enable for Terminal, Claude Desktop, or your IDE
- Accessibility (Optional):
- System Settings → Privacy & Security → Accessibility
- Enable for better window focus control
🏗️ Building from Source
Prerequisites
- macOS 14.0+ (Sonoma or later)
- Node.js 20.0+ and npm
- Xcode Command Line Tools (
xcode-select --install
) - Swift 5.9+ (included with Xcode)
Build Commands
Creating Release Binaries
The release script creates:
peekaboo-macos-universal.tar.gz
- Standalone CLI binary (universal)@steipete-peekaboo-mcp-{version}.tgz
- npm packagechecksums.txt
- SHA256 checksums for verification
🧪 Testing
📚 Documentation
🐛 Troubleshooting
Issue | Solution |
---|---|
Permission denied | Grant Screen Recording permission in System Settings |
Window not found | Try using fuzzy matching or list windows first |
AI analysis failed | Check API keys and provider configuration |
Command not found | Ensure Peekaboo is in your PATH or use full path |
Enable debug logging for more details:
🤝 Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
📝 License
MIT License - see LICENSE file for details.
👤 Author
Created by Peter Steinberger - @steipete
🙏 Acknowledgments
- Apple's ScreenCaptureKit for blazing-fast captures
- The MCP team for the Model Context Protocol
- The Swift and TypeScript communities
Note: This is Peekaboo v2.0, which introduces standalone CLI functionality alongside the original MCP server. For users upgrading from v1.x, see the CHANGELOG for migration details.
local-only server
The server can only run on the client's local machine because it depends on local resources.
A macOS utility that captures screenshots and analyzes them with AI vision, enabling AI assistants to see and interpret what's on your screen.
Related MCP Servers
- AsecurityAlicenseAqualityProvides screenshot and OCR capabilities for macOS.Last updated -13510JavaScriptMIT License
- AsecurityAlicenseAqualityEnables capturing high-quality native macOS screenshots using Safari through a Node.js server, supporting various sizes, zoom levels, and load wait times.Last updated -17TypeScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides AI vision capabilities for analyzing UI screenshots, offering tools for screen analysis, file operations, and UI/UX report generation.Last updated -261JavaScriptISC License
- -securityFlicense-qualityEnables AI tools to capture and process screenshots of a user's screen, allowing AI assistants to see and analyze what the user is looking at through a simple MCP interface.Last updated -1Python