๐ Peekaboo MCP: Screenshots so fast they're paranormal.
A macOS utility that enables AI assistants to see screen content through rapid screenshots and advanced analysis
๐ Quick Start
Peekaboo MCP is a ghostly macOS utility that allows AI assistants to "see" your screen. It captures screenshots and uses AI to analyze them, helping you with bug hunting, design reviews, and more.
Prerequisites
- macOS 14.0+ (Sonoma or later)
- Node.js 20.0+
Installation
Summon Peekaboo into your Agent realm by adding the following configuration to your Claude Desktop:
{
"mcpServers": {
"peekaboo": {
"command": "npx",
"args": [
"-y",
"@steipete/peekaboo-mcp@beta"
],
"env": {
"PEEKABOO_AI_PROVIDERS": "ollama/llava:latest"
}
}
}
}
Then, restart Claude Desktop.
Verification
Verify that Peekaboo has successfully crossed over:
./peekaboo --help
./peekaboo list server_status --json-output
./peekaboo image --mode screen --format png
peekaboo-mcp
โจ Features
๐๏ธโ๐จ๏ธ AI Vision for Assistants
Peekaboo gives your AI assistants the power of actual vision, making it easier to communicate UI issues and get accurate responses.
๐ธ Fast Screenshots
Capture screenshots of any window, app, or screen instantly.
๐ค AI Analysis
Analyze screenshots using AI models like Ollama and OpenAI, getting insights and answers to your questions.
๐จ Design Reviews
Let AI provide feedback on your designs, helping you improve your CSS and UI.
๐ Data Analysis
Ask AI to analyze charts and graphs in your screenshots, extracting valuable information.
๐ผ๏ธ UI Testing
Verify your app's appearance across different screens and devices, avoiding the "works on my machine" problem.
๐ฑ Multi-Screen Support
Capture screenshots from multiple screens simultaneously.
๐ค Automation
Integrate Peekaboo with your automation workflows, letting AI see what you see and fix what you break.
๐ฆ Installation
Ritual Requirements
- macOS 14.0+ (Sonoma or later)
- Node.js 20.0+
๐ฏ๏ธ Quick Summoning Ritual
Add the following configuration to your Claude Desktop:
{
"mcpServers": {
"peekaboo": {
"command": "npx",
"args": [
"-y",
"@steipete/peekaboo-mcp@beta"
],
"env": {
"PEEKABOO_AI_PROVIDERS": "ollama/llava:latest"
}
}
}
}
Then, restart Claude Desktop.
๐ฎ Mystical Configuration
Enchantment Variables
Configure Peekaboo using the following environment variables:
{
"PEEKABOO_AI_PROVIDERS": "ollama/llava:latest,openai/gpt-4o",
"PEEKABOO_LOG_LEVEL": "debug",
"PEEKABOO_LOG_FILE": "~/Library/Logs/peekaboo-mcp-debug.log",
"PEEKABOO_DEFAULT_SAVE_PATH": "~/Pictures/PeekabooCaptures",
"PEEKABOO_CONSOLE_LOGGING": "true",
"PEEKABOO_CLI_PATH": "/opt/custom/peekaboo"
}
๐ญ Available Enchantments
Variable |
Description |
Default |
PEEKABOO_AI_PROVIDERS |
Comma-separated list of provider_name/default_model_for_provider pairs. Determines which AI backends are available for the analyze and image tools. |
"" (none) |
PEEKABOO_LOG_LEVEL |
Logging level (trace, debug, info, warn, error, fatal). |
info |
PEEKABOO_LOG_FILE |
Path to the server's log file. |
~/Library/Logs/peekaboo-mcp.log |
PEEKABOO_DEFAULT_SAVE_PATH |
Default base absolute path for saving images captured by the image tool. |
(none, Swift CLI uses temp paths) |
PEEKABOO_OLLAMA_BASE_URL |
Base URL for the Ollama API server. |
http://localhost:11434 |
PEEKABOO_CONSOLE_LOGGING |
Boolean ("true" /"false" ) for development console logs. |
"false" |
PEEKABOO_CLI_PATH |
Optional override for the Swift peekaboo CLI executable path. |
(uses bundled CLI) |
๐ง AI Spirit Guide Configuration (PEEKABOO_AI_PROVIDERS
In-Depth)
The PEEKABOO_AI_PROVIDERS
environment variable is used to configure the AI providers and models for the analyze
and image
tools. It should be a comma-separated string in the format provider_name/model_identifier
.
provider_name
: Currently supported values are ollama
and openai
. Support for anthropic
is planned.
model_identifier
: The specific model to use for that provider (e.g., llava:latest
, gpt-4o
).
If the provider_config
argument in the analyze
or image
tools is set to "auto"
(the default for analyze
, and an option for image
), Peekaboo will try the providers from PEEKABOO_AI_PROVIDERS
in the order they are listed, checking for necessary API keys or service availability.
๐ฆ Summoning Ollama - The Local Vision Oracle
Ollama provides a powerful local AI that can analyze your screenshots without sending data to the cloud.
๐ฆ Installing Ollama
macOS (via Homebrew):
brew install ollama
Visit ollama.ai and download the macOS app.
Start the Ollama daemon:
ollama serve
The daemon will run at http://localhost:11434
by default.
๐ญ Downloading Vision Models
For powerful machines, LLaVA is the recommended model:
ollama pull llava:latest
ollama pull llava:7b-v1.6
ollama pull llava:13b-v1.6
ollama pull llava:34b-v1.6
For less beefy machines, Qwen2-VL provides excellent performance with lower resource requirements:
ollama pull qwen2-vl:7b
Model Size Guide:
qwen2-vl:7b
- ~4GB download, ~6GB RAM required
llava:7b
- ~4.5GB download, ~8GB RAM required
llava:13b
- ~8GB download, ~16GB RAM required
llava:34b
- ~20GB download, ~40GB RAM required
๐ฎ Configuring Peekaboo with Ollama
Add Ollama to your Claude Desktop configuration:
{
"mcpServers": {
"peekaboo": {
"command": "npx",
"args": [
"-y",
"@steipete/peekaboo-mcp@beta"
],
"env": {
"PEEKABOO_AI_PROVIDERS": "ollama/llava:latest"
}
}
}
}
For less powerful machines (using Qwen2-VL):
{
"mcpServers": {
"peekaboo": {
"command": "npx",
"args": [
"-y",
"@steipete/peekaboo-mcp@beta"
],
"env": {
"PEEKABOO_AI_PROVIDERS": "ollama/qwen2-vl:7b"
}
}
}
}
Multiple AI Providers (Ollama + OpenAI):
{
"env": {
"PEEKABOO_AI_PROVIDERS": "ollama/llava:latest,openai/gpt-4o",
"OPENAI_API_KEY": "your-api-key-here"
}
}
๐งช Testing Ollama Integration
Verify Ollama is running and accessible:
curl http://localhost:11434/api/tags
./peekaboo image --app Finder --path ~/Desktop/finder.png
๐ฐ๏ธ Granting Mystical Permissions
Peekaboo requires certain macOS permissions to function properly:
1. ๐๏ธ The All-Seeing Eye Permission
- Open System Preferences โ Security & Privacy โ Privacy
- Select Screen Recording from the left sidebar
- Click the lock icon and enter your password
- Click + and add your terminal application or MCP client
- Restart the application
Known vessels that can channel Peekaboo:
- Terminal.app:
/Applications/Utilities/Terminal.app
- Claude Desktop:
/Applications/Claude.app
- VS Code:
/Applications/Visual Studio Code.app
2. ๐ช Window Whisperer Permission (Optional)
To control windows during capture, add your terminal/MCP client application to the Accessibility permission in System Preferences โ Security & Privacy โ Privacy.
๐ฏ๏ธ Sรฉance Verification
Verify that Peekaboo has successfully crossed over:
./peekaboo --help
./peekaboo list server_status --json-output
./peekaboo image --mode screen --format png
peekaboo-mcp
Expected ghostly whispers:
{
"success": true,
"data": {
"swift_cli_available": true,
"permissions": {
"screen_recording": true
},
"system_info": {
"macos_version": "14.0"
}
}
}
๐ป Usage Examples
๐ผ๏ธ image
: Capture Ghostly Visions
Capture the entire main screen and save it:
{
"tool_name": "image",
"arguments": {
"mode": "screen",
"path": "~/Desktop/myscreen.png",
"format": "png"
}
}
Capture the active window of Finder and return its data as Base64:
{
"tool_name": "image",
"arguments": {
"app": "Finder",
"mode": "window",
"return_data": true,
"format": "jpg"
}
}
Capture all windows of "Google Chrome" and bring it to the foreground first:
{
"tool_name": "image",
"arguments": {
"app": "Google Chrome",
"mode": "multi",
"capture_focus": "foreground",
"path": "~/Desktop/ChromeWindows/"
}
}
๐๏ธ list
: Reveal Hidden Spirits
List all running applications:
{
"tool_name": "list",
"arguments": {
"item_type": "running_applications"
}
}
List all windows of the "Preview" app, including their bounds and IDs:
{
"tool_name": "list",
"arguments": {
"item_type": "application_windows",
"app": "Preview",
"include_window_details": ["bounds", "ids"]
}
}
Get the server's current status:
{
"tool_name": "list",
"arguments": {
"item_type": "server_status"
}
}
๐ฎ analyze
: Divine the Captured Essence
Ask a question about an image using the auto-configured AI provider:
{
"tool_name": "analyze",
"arguments": {
"image_path": "~/Desktop/myscreen.png",
"question": "What is the main color visible in the top-left quadrant?"
}
}
Force using Ollama with a specific model for analysis:
{
"tool_name": "analyze",
"arguments": {
"image_path": "~/Desktop/some_diagram.jpg",
"question": "Explain this diagram.",
"provider_config": {
"type": "ollama",
"model": "llava:13b-v1.6"
}
}
}
๐ Documentation
๐ญ Spectral Powers
Once summoned, Peekaboo grants you three supernatural abilities:
๐ผ๏ธ image
- Soul Capture
Captures macOS screen content and optionally analyzes it.
Parameters:
app_target
(string, optional): Specifies the capture target.
path
(string, optional): Base absolute path for saving the captured image(s).
question
(string, optional): If provided, the captured image will be analyzed.
format
(string, optional, default: "png"
): Specifies the output image format or data return type.
capture_focus
(string, optional, default: "background"
): Controls window focus behavior during capture.
Behavior with question
(AI Analysis):
- If a
question
is provided, the tool will capture the image and send it to an AI model for analysis.
- The analysis result is returned as
analysis_text
in the response.
Output Structure (Simplified):
content
: Can contain ImageContentItem
and/or TextContentItem
.
saved_files
: Array of objects detailing saved files.
analysis_text
: Text from AI (if question
was asked).
model_used
: AI model identifier (if question
was asked).
๐ป list
- Spirit Detection
Lists system items like running applications, windows of a specific app, or server status.
Parameters:
item_type
: "running_applications"
| "application_windows"
| "server_status"
app
: Application identifier (required for application_windows)
๐ฎ analyze
- Vision Divination
Analyzes a pre-existing image file using a configured AI model.
Parameters:
image_path
: Absolute path to image file
question
: Question/prompt for AI analysis
๐ Supernatural Abilities
๐ผ๏ธ Ethereal Vision Capture
- Multi-realm vision: Captures each display separately
- Soul targeting: App/window divination with matching
- Essence preservation: Supports PNG, JPEG, WebP, HEIF
- Mystical naming: Temporal runes and descriptive names
- Ward detection: Automatic permission verification
๐ป Spirit Management
- Spirit census: Complete digital ghost registry
- Portal detection: Window scrying with metadata
- Spectral matching: Divine apps by partial essence, ID, or number
- Life force monitoring: Active/slumbering status, portal counts
๐งฟ Oracle Integration
- Oracle agnostic: Supports Ollama and OpenAI, with more to come
- Image analysis: Natural language querying of captured content
- Configurable: Environment-based provider selection
๐ฉ Haunted Architecture
Peekaboo/
โโโ src/ # Node.js MCP Server (TypeScript)
โ โโโ index.ts # Main MCP server entry point
โ โโโ tools/ # Individual tool implementations
โ โ โโโ image.ts # Screen capture tool
โ โ โโโ analyze.ts # AI analysis tool
โ โ โโโ list.ts # Application/window listing
โ โโโ utils/ # Utility modules
โ โ โโโ peekaboo-cli.ts # Swift CLI integration
โ โ โโโ ai-providers.ts # AI provider management
โ โ โโโ server-status.ts # Server status utilities
โ โโโ types/ # Shared type definitions
โโโ peekaboo-cli/ # Native Swift CLI
โ โโโ Sources/peekaboo/ # Swift source files
โ โโโ main.swift # CLI entry point
โ โโโ ImageCommand.swift # Image capture implementation
โ โโโ ListCommand.swift # Application listing
โ โโโ Models.swift # Data structures
โ โโโ ApplicationFinder.swift # App discovery logic
โ โโโ WindowManager.swift # Window management
โ โโโ PermissionsChecker.swift # macOS permissions
โ โโโ JSONOutput.swift # JSON response formatting
โโโ package.json # Node.js dependencies
โโโ tsconfig.json # TypeScript configuration
โโโ README.md # This file
๐ฌ Arcane Knowledge
๐ Ancient Runes (JSON Output)
The Swift CLI outputs structured JSON when called with --json-output
:
{
"success": true,
"data": {
"applications": [
{
"app_name": "Safari",
"bundle_id": "com.apple.Safari",
"pid": 1234,
"is_active": true,
"window_count": 2
}
]
},
"debug_logs": ["Found 50 applications"]
}
๐ Portal Integration
The Node.js server translates between MCP's JSON-RPC protocol and the Swift CLI's JSON output, providing schema validation, error handling, logging, and type safety.
๐ช Permission Wards
Peekaboo respects macOS security by checking screen recording permissions, degrading gracefully when permissions are missing, and providing clear error messages.
๐ง Technical Details
๐ธ๏ธ Known Curses
- FileHandle warning: Non-critical Swift warning about TextOutputStream conformance
- AI Provider Config: Requires
PEEKABOO_AI_PROVIDERS
environment variable for analysis features
๐ Future Hauntings
- [ ] OCR Integration: Built-in text extraction from screenshots
- [ ] Video Capture: Screen recording capabilities
- [ ] Annotation Tools: Drawing/markup on captured images
- [ ] Cloud Storage: Direct upload to cloud providers
- [ ] Hotkey Support: System-wide keyboard shortcuts
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
๐ง Join the Coven
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
๐ Available Tools (via MCP Server)
Peekaboo exposes its powers through the following tools when run as an MCP server:
image
: Captures macOS screen content. Can target entire screens, specific application windows, or all windows of an app. Supports various formats and capture modes. Can optionally analyze the captured image immediately.
analyze
: Analyzes a pre-existing image file using a configured AI model.
list
: Lists system items like running applications, windows of a specific app, or server status.
For full input/output schemas, see docs/spec.md
.
๐ Peekaboo awaits your command! Happy haunting! ๐ป