puppet-ai
Allows Arc browser automation including clicking, scrolling, and reading page content via screen capture and OCR.
Enables Windsurf (Codeium's IDE) to capture the screen, read text via OCR, detect UI elements, and control mouse and keyboard on macOS.
Allows Firefox browser automation including clicking, scrolling, and reading page content via screen capture and OCR.
Enables Google Gemini CLI to capture the screen, read text via OCR, detect UI elements, and control mouse and keyboard on macOS.
Enables OpenAI Codex CLI to capture the screen, read text via OCR, detect UI elements, and control mouse and keyboard on macOS.
Allows Safari browser automation including clicking, scrolling, and reading page content via screen capture and OCR.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@puppet-aiopen the Mail app and read my latest email"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
puppet-ai
Full computer control for AI agents — see, click, type, scroll via MCP.
Give any AI agent eyes and hands. puppet-ai captures the screen, reads text via native OCR, detects UI elements, and controls mouse + keyboard. Works with any app on macOS — browsers, desktop apps, games, terminals.
Why puppet-ai?
Fast — native macOS OCR in ~0.5s, 7x faster with caching
Universal — works with ANY app, not just browsers
Agent-agnostic — MCP standard, plug into any AI agent
Secure — auto-masks API keys, passwords, credit cards, emails in OCR output
Complete — 27 tools: vision + actions + system
Private — all processing on-device, no data leaves your Mac
Related MCP server: mcp-desktop
Quick Start
1. Install
pip install puppet-agent2. Enable Accessibility
System Settings → Privacy & Security → Accessibility → enable your terminal/IDE app.
3. Connect to your AI agent
puppet-ai is an MCP server. Connect it to any MCP-compatible agent below, then ask the agent to interact with your computer.
Integrations
Claude Code
Add to ~/.claude/settings.json:
{
"mcpServers": {
"puppet-ai": {
"command": "puppet-ai",
"args": ["serve"]
}
}
}OpenAI Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.puppet-ai]
command = "puppet-ai"
args = ["serve"]Or via CLI:
codex mcp add puppet-ai -- puppet-ai serveGoogle Gemini CLI
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"puppet-ai": {
"command": "puppet-ai",
"args": ["serve"]
}
}
}Verify: launch gemini and run /mcp to check connection.
Google Antigravity
Via MCP settings in Antigravity, or add to your project's .antigravity/settings.json:
{
"mcpServers": {
"puppet-ai": {
"command": "puppet-ai",
"args": ["serve"]
}
}
}Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"puppet-ai": {
"command": "puppet-ai",
"args": ["serve"]
}
}
}Or: Cursor Settings → Tools & MCP → Add Server.
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"puppet-ai": {
"command": "puppet-ai",
"args": ["serve"]
}
}
}Cline (VS Code)
In VS Code, open Cline settings → MCP Servers → Add:
{
"puppet-ai": {
"command": "puppet-ai",
"args": ["serve"]
}
}Zed
Add to Zed settings (~/.config/zed/settings.json):
{
"context_servers": {
"puppet-ai": {
"command": {
"path": "puppet-ai",
"args": ["serve"]
}
}
}
}OpenClaw
Add to your agent's MCP config:
mcp_servers:
puppet-ai:
command: puppet-ai
args: [serve]Any MCP Client
puppet-ai speaks MCP over stdio. Spawn it as a subprocess:
import subprocess
proc = subprocess.Popen(
["puppet-ai", "serve"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)
# Communicate via MCP JSON-RPC over stdin/stdoutWorks with any agent that supports the Model Context Protocol.
Detailed setup guides: integrations/
Tools
Vision (see the screen)
Tool | Description |
| List all open windows (app, title, size) |
| Read text via OCR with bounding boxes for clicking |
| Capture screenshot as base64 JPEG |
| Full screen state: all windows + active window text |
| Get UI elements via Accessibility API (buttons, links, checkboxes) |
Actions (control the computer)
Tool | Description |
| Click at coordinates |
| Find text on screen and click it — no coordinates needed |
| Click text, wait for screen to stabilize, return new state |
| Type text via clipboard paste (works with any keyboard layout) |
| Open URL in browser (http/https only) |
| Scroll up/down in an app |
| Keyboard shortcut (e.g. |
| Press a key (enter, tab, escape, etc.) |
| Drag and drop |
| Bring app to front |
| Copy to clipboard |
| Paste from clipboard |
System
Tool | Description |
| Check accessibility access |
| Screen dimensions |
| Current cursor position |
| Temporarily disable PII masking |
| Re-enable PII masking |
How It Works
AI Agent (Claude, Codex, Gemini, Cursor, Windsurf, ...)
↕ MCP protocol (stdio)
puppet-ai server
├── Vision: Apple Vision OCR + CGWindowList capture
├── Accessibility: AXUIElement tree (buttons, links, fields)
├── Actions: pyautogui (mouse, keyboard, scroll)
└── Security: PII regex filter (API keys, cards, passwords, emails)The loop:
Look —
vision_read_window("Safari")→ text + coordinatesDecide — agent plans next action
Act —
action_click_text("Sign In")→ clicks center of textVerify —
vision_read_windowagain → confirm it workedRepeat
Features
Native macOS OCR
Uses Apple Vision Framework — no external API, no GPU needed, works offline. Supports Russian and English.
Per-Window Capture
Captures specific windows via CGWindowList without switching apps or stealing focus.
Smart Coordinates
OCR returns absolute screen coordinates with Retina scaling handled automatically.
OCR Cache
Repeated reads of unchanged windows are 7x faster. Cache auto-invalidates after any action.
PII Protection
Sensitive data is automatically masked in OCR output:
API keys:
sk-1***efCredit cards:
4111***1111Emails:
user***comPasswords in forms
Crypto keys
Accessibility API
Detect interactive UI elements — buttons, checkboxes, links, text fields — with exact clickable coordinates.
Built-in Agent Instructions
The MCP server includes a system prompt that teaches agents how to use all 27 tools, macOS keyboard shortcuts, and the look-decide-act-verify loop.
Security
All data stays on your Mac — no telemetry, no analytics, no external calls
PII auto-masking — API keys, credit cards, emails, passwords masked before reaching the agent
URL validation — only
http://andhttps://allowed,file://blockedInput sanitization — app names validated to prevent injection
Browser allowlist — only known browsers accepted (Chrome, Safari, Firefox, Arc, etc.)
Failsafe — pyautogui failsafe enabled by default (move mouse to corner to abort)
Examples
import asyncio
from puppet_ai.core.capture import ScreenCapture
from puppet_ai.core.actions import DesktopActions
from puppet_ai.server.mcp import VisionPipeContext, create_all_tools
async def main():
ctx = VisionPipeContext(
capture=ScreenCapture(),
actions=DesktopActions(failsafe=True),
)
tools = create_all_tools(ctx)
# See what's on screen
windows = await tools["vision_list_windows"]()
for w in windows:
print(f"{w['app']:20s} — {w['title'][:50]}")
# Read a window
page = await tools["vision_read_window"](app="Safari")
print(page["text"][:500])
# Click text on screen
await tools["action_click_text"](text="Sign In", app="Safari")
# Open a URL
await tools["action_open_url"](url="https://example.com", browser="Safari")
asyncio.run(main())More examples in examples/.
Configuration
# puppet-ai.yaml
ocr:
languages: ["en", "ru"]
mode: accurate # or "fast"
pii:
enabled: true
categories: [api_keys, credit_cards, crypto_keys, emails, passwords]
capture:
max_width: 800
format: jpeg
quality: 75Presets:
puppet-ai serve --preset fast # speed over accuracy
puppet-ai serve --preset balanced # default
puppet-ai serve --preset quality # max accuracyKnown Limitations
Safari —
type_textandCmd+Vdon't work reliably in web input fields. Safari restricts programmatic input and Accessibility API access for web content. Use Chrome for full browser automation.Electron apps — some Electron apps (e.g. Dolphin Anty) block clipboard paste in input fields.
Safari Accessibility — returns 0 UI elements for web page content. Native macOS apps and Chrome work fine.
For full browser automation, Chrome is recommended over Safari.
Requirements
macOS 13+ (Ventura or later)
Python 3.11+
Accessibility permissions enabled
Author
Daniel Starkov
Twitter: @retardTransoff
LinkedIn: Daniel Starkov
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/transoff/puppet-ai'
If you have feedback or need assistance with the MCP directory API, please join our Discord server