Skip to content

Safari Browser Automation CLI

Lets an agent control the real Safari browser on macOS via a command-line wrapper around safari-mcp

Stars
58,084
Licence
Apache-2.0
Files
1 file

What it does

This skill teaches an AI agent to drive the Safari browser on a Mac through a command-line tool. Once installed, the agent can open pages, read page content as structured text, click, fill forms, scroll, take screenshots, save pages as PDF, read cookies and storage, and capture network activity, all in the user's real Safari with existing logins. It wraps the safari-mcp server and exposes its 84 tools as shell commands, which suits agents that cannot speak MCP directly.

Great for

  • Developers whose agent framework does not support MCP and needs browser control from bash or scripts
  • Engineers scripting repeatable browser tasks or running them in macOS CI jobs
  • People debugging a page interactively from Terminal

Skip it if

  • Users on Windows or Linux, since safari-mcp is macOS-only (reason: Safari and Apple Events are required)
  • Agents that already speak MCP natively, where calling safari-mcp directly is faster (reason: each CLI call spawns a new subprocess)
  • Running it against accounts or sites you do not own without care, since it can read cookies, storage and fill passwords (reason: sensitive credentials can be exposed or misused)

Try asking

  • “Open example.com, take a snapshot and summarise the main headings”
  • “Fill in the login form on my staging site using the email in my notes and click Log in”
  • “Save the current page as a PDF to /tmp/report.pdf”
  • “Capture network requests while loading a page and list the slowest ones”
Step-by-step guide: how to use Safari Browser Automation CLIInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    skills.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip skills.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip skills.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Take a snapshot before clicking, because element refs expire on the next snapshot
  • Avoid passing passwords or cookie values in shell arguments where they may be logged; prefer environment-driven flows
  • Use tools describe <name> to check exact argument names, since the CLI uses --script not --code for evaluate

What's inside

  • SKILL.md

Redistributed unmodified from HKUDS/CLI-Anything under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.