← Discover MCPs and Agents
c
MCPAI & MLGitHub

claude-for-safari

Give your AI Agent the power to control Safari on macOS. No extensions, no separate browser.

Links

README

From the repo.

Claude for Safari

Give your AI Agent the power to control Safari

MIT License macOS GitHub Stars

Website · Quick Start · Features · FAQ

English | 中文


Why This?

You want your AI Agent to help with browser tasks — then you discover:

  • 🔒 Playwright → Separate browser instance, hijacks your session
  • 🧩 Claude for Chrome → Requires Chrome extension, doesn't work with Safari
  • 📝 Copy & paste → Manually feeding page content to AI every time

You just want AI to use your Safari, as if you were doing it yourself.

Claude for Safari makes it one command:

npx skills add SDLLL/claude-for-safari

After installing, tell Claude "check what's open in my Safari" — it reads and controls your real browser directly.

If this saves you time, give it a ⭐ — it helps other developers discover the project!


Quick Start

Run this in your terminal:

npx skills add SDLLL/claude-for-safari

Then launch Claude Code:

claude

Say "show me what tabs are open in Safari". The agent will guide you through permission setup automatically.

Compatible with any AI Agent that supports Skills: Claude Code, Cursor, Windsurf, etc.

First-Time Setup

The agent auto-detects and guides you, but you can configure ahead of time:

  1. System Settings > Privacy & Security > Automation → Allow terminal to control Safari
  2. Safari > Settings > Advanced → Enable "Show features for web developers"
  3. Safari > Develop menu → Check "Allow JavaScript from Apple Events"
  4. (Optional) System Settings > Privacy & Security > Screen Recording → Allow the terminal or agent host (enables reliable background screenshots)
  5. (Optional) System Settings > Privacy & Security > Accessibility → Required only for System Events clicks and keystrokes

Features

No browser extension, proxy, or persistent daemon. The core uses macOS-native capabilities; optional window helpers require an available Swift toolchain.

CapabilityWhat the Agent DoesHow
List tabsList all windows and tabs with title & URLAppleScript
Read pagesExtract text, structured data, simplified DOMAppleScript + JavaScript
Execute JSRun arbitrary JavaScript in page contextAppleScript do JavaScript
ScreenshotCapture Safari window — AI can "see" the pagescreencapture
NavigateOpen URLs, new tabs, new windowsAppleScript
ClickClick elements (React/Vue/Angular compatible)JavaScript dispatchEvent
TypeFill forms, simulate keyboard inputJavaScript + System Events
Safe form fillingDiscover fields and fill supported non-sensitive controls with per-field verificationBundled JavaScript + JXA
Network observationObserve redacted page-level fetch/XHR metadata; bodies are explicit opt-inBundled JavaScript
Control indicatorShow when an agent is changing a page and clean up afterwardBundled JavaScript
ScrollScroll up/down, scroll to elementJavaScript scrollBy/scrollTo
Switch tabsSwitch by index or URL keywordAppleScript
Wait for loadWait until page is fully loadedJavaScript readyState

Screenshot Modes

ModePermission RequiredWindow SwitchBest For
BackgroundScreen RecordingNo switchRecommended, seamless
User-visibleVaries by macOS policyYesFallback when background capture is unavailable

How It Works

Claude Code ──osascript──► Safari (reads/controls your real browser)
     │
     └──screencapture──► screenshot ──► Claude sees the page

No extensions, proxy servers, or persistent background services.

The skill uses AppleScript, page JavaScript, screencapture, and optional bundled helpers. Page-injected helpers can be detected by websites and are removed after use.


FAQ

Do I need to install anything?

The core requires no browser extension or separate automation browser. It uses macOS AppleScript and screencapture; compiling the optional multi-window helper requires swiftc/Apple Command Line Tools.

Does it support Chrome / Firefox / Arc?

Safari only. For other browsers, use Playwright MCP or Chrome ACP. Safari is the only macOS browser with full AppleScript automation support.

Is it safe? Will AI do random things?

The skill requires target verification, preserves site confirmation dialogs, excludes sensitive form fields, and asks for authorization before consequential actions. Your agent host's own permission policy still applies.

The window flickers when taking screenshots?

Grant Screen Recording permission to the terminal or agent host for reliable background window capture. Without it, use a user-visible Screenshot workflow and verify the resulting image rather than assuming capture succeeded.

Which AI Agents are compatible?

Any agent supporting Claude Code Skills: Claude Code, Cursor, Windsurf, etc.


Acknowledgements

  • @rrecio contributed the form, control-indicator, window-helper, network-observer, and real-Safari testing ideas in PR #2.
  • @jordan-brough contributed permission, dialog, locale, timestamp, and Safari UI measurement findings in PR #3.

Their work informed the maintainer-integrated, safety-hardened implementation.


License

MIT

Collected info

  • 52 stars
  • 6 forks
  • Source updated: 7/17/2026

Config for your environment

Replace {MCP_ENDPOINT_URL} with this MCP’s endpoint URL (from its repo or docs above). No API key — you connect directly.

Tool

OS

Config file: ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-server": {
      "url": "{MCP_ENDPOINT_URL}"
    }
  }
}

Paste into mcpServers in the config file. Restart Cursor after saving.

If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.