Native Safari browser automation for AI agents — 84 tools, zero Chrome overhead.

Native Safari browser automation for AI agents on macOS with 80 tools, using real Safari sessions and 60% less CPU than Chrome-based alternatives.

166 views7Local (stdio)

About safari-mcp

safari-mcp is a community-built MCP server published by achiya-automation that provides AI assistants with tools and capabilities via the Model Context Protocol. Native Safari browser automation for AI agents — 84 tools, zero Chrome overhead. It is categorized under productivity. This server exposes 20 tools that AI clients can invoke during conversations and coding sessions.

How to install

You can install safari-mcp in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

safari-mcp is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (20)

safari_navigate

Navigate to URL with auto HTTPS and wait for load

safari_snapshot

Get page state with accessibility tree for element targeting

safari_click

Click elements by CSS selector, visible text, or coordinates

safari_fill

Fill input fields with React/Vue/Angular compatibility

safari_screenshot

Capture screenshots as PNG (viewport or full page)

Safari MCP Server — 80 native browser automation tools for AI agents on macOS

🦁 Safari MCP

The only MCP server for Safari — native browser automation for AI agents.

npm version npm downloads License: MIT macOS GitHub stars

Install in VS Code Install in VS Code Insiders Install in Cursor

80 tools · No Chrome/Puppeteer/Playwright needed · ~5ms per command · 60% less CPU than Chrome

Quick Start · All 80 Tools · Examples · Why Safari MCP? · Architecture · Changelog

Safari MCP Demo

TL;DR: Use your real Safari with all your logins, cookies, and sessions. No headless browsers, no Chrome, no Puppeteer. Just native AppleScript + JavaScript on macOS — 60% less CPU/heat on Apple Silicon.

🤔 Why not just use Playwright or Chrome DevTools MCP?

ProblemSafari MCP Solution
Chrome DevTools MCP heats up your MacNative WebKit — ~60% less CPU
Playwright launches a new browser without your loginsUses your real Safari with all sessions
Puppeteer requires Chrome + debug portJust AppleScript — no extra browser
Headless browsers can't access your authenticated sessionsGmail, GitHub, Slack — already logged in
Browser automation steals window focusSafari stays in background, never interrupts

Highlights

  • 80 tools — navigation, clicks, forms, screenshots, network, storage, accessibility, and more
  • Zero heat — native WebKit on Apple Silicon, ~60% less CPU than Chrome
  • Your real browser — keeps all logins, cookies, sessions (Gmail, GitHub, Ahrefs, etc.)
  • Background operation — Safari stays in the background, no window stealing
  • No browser dependencies — no Puppeteer, no Playwright, no WebDriver, no Chrome
  • Persistent process — reuses a single osascript process (~5ms per command vs ~80ms)
  • Framework-compatible — React, Vue, Angular, Svelte form filling via native setters

Quick Start

Prerequisites

  • macOS (any version with Safari)
  • Node.js 18+
  • Safari → Settings → Advanced → Show features for web developers
  • Safari → Develop → Allow JavaScript from Apple Events

Install (one command)

npx safari-mcp

That's it — no global install needed. Or install permanently:

npm install -g safari-mcp

Configure your MCP client

Add to your client's config file — all clients use the same JSON:

{
  "mcpServers": {
    "safari": {
      "command": "npx",
      "args": ["safari-mcp"]
    }
  }
}
Where does each client store this?
ClientConfig file
Claude Code~/.mcp.json
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json
Cursor.cursor/mcp.json in your project
Windsurf.windsurf/mcp.json in your project
VS Code + Continue.vscode/mcp.json in your project
Alternative: Homebrew
brew install achiya-automation/tap/safari-mcp
Alternative: from source
git clone https://github.com/achiya-automation/safari-mcp.git
cd safari-mcp && npm install

Usage Workflow

The recommended pattern for AI agents using Safari MCP:

1. safari_snapshot        → Get page state (accessibility tree)
2. safari_click/fill/...  → Interact with elements by ref
3. safari_snapshot        → Verify the result

Element targeting — tools accept multiple targeting strategies:

StrategyExampleBest for
CSS selector#login-btn, .submitUnique elements
Visible text"Sign In", "Submit"Buttons, links
Coordinatesx: 100, y: 200Canvas, custom widgets
Ref from snapshotref: "e42"Any element from accessibility tree

Tip: Start with safari_snapshot to get element refs, then use refs for precise targeting. This is faster and more reliable than CSS selectors.


Tools (80)

Navigation (4)

ToolDescription
safari_navigateNavigate to URL (auto HTTPS, wait for load)
safari_go_backGo back in history
safari_go_forwardGo forward in history
safari_reloadReload page (optional hard reload)

Page Reading (3)

ToolDescription
safari_read_pageGet title, URL, and text content
safari_get_sourceGet full HTML source
safari_navigate_and_readNavigate + read in one call

Click & Interaction (5)

ToolDescription
safari_clickClick by CSS selector, visible text, or coordinates
safari_double_clickDouble-click (select word, etc.)
safari_right_clickRight-click (context menu)
safari_hoverHover over element
safari_click_and_waitClick + wait for navigation

Form Input (7)

ToolDescription
safari_fillFill input (React/Vue/Angular compatible)
safari_clear_fieldClear input field
safari_select_optionSelect dropdown option
safari_fill_formBatch fill multiple fields
safari_fill_and_submitFill form + submit in one call
safari_type_textType real keystrokes (JS-based, no System Events)
safari_press_keyPress key with modifiers

Screenshots & PDF (3)

ToolDescription
safari_screenshotScreenshot as PNG (viewport or full page)
safari_screenshot_elementScreenshot a specific element
safari_save_pdfExport page as PDF

Scroll (3)

ToolDescription
safari_scrollScroll up/down by pixels
safari_scroll_toScroll to exact position
safari_scroll_to_elementSmooth scroll to element

Tab Management (4)

ToolDescription
safari_list_tabsList all tabs (index, title, URL)
safari_new_tabOpen new tab (background, no focus steal)
safari_close_tabClose tab
safari_switch_tabSwitch to tab by index

Wait (2)

ToolDescription
safari_wait_forWait for element, text, or URL change
safari_waitWait for specified milliseconds

JavaScript (1)

ToolDescription
safari_evaluateExecute arbitrary JavaScript, return result

Element Inspection (4)

ToolDescription
safari_get_elementElement details (tag, rect, attrs, visibility)
safari_query_allFind all matching elements
safari_get_computed_styleComputed CSS styles
safari_detect_formsAuto-detect all forms with field selectors

Accessibility (1)

ToolDescription
safari_accessibility_snapshotFull a11y tree: roles, ARIA, focusable elements

Drag & Drop (1)

ToolDescription
safari_dragDrag between elements or coordinates

File Operations (2)

ToolDescription
safari_upload_fileUpload file via JS DataTransfer (no file dialog!)
safari_paste_imagePaste image into editor (no clipboard touch!)

Dialog & Window (2)

ToolDescription
safari_handle_dialogHandle alert/confirm/prompt
safari_resizeResize browser window

Device Emulation (2)

ToolDescription
safari_emulateEmulate device (iPhone, iPad, Pixel, Galaxy)
safari_reset_emulationReset to desktop

Cookies & Storage (10)

ToolDescription
safari_get_cookiesGet all cookies
safari_set_cookieSet cookie with all options
safari_delete_cookiesDelete one or all cookies
safari_local_storageRead localStorage
safari_set_local_storageWrite localStorage
safari_delete_local_storageDelete/clear localStorage
safari_session_storageRead sessionStorage
safari_set_session_storageWrite sessionStorage
safari_delete_session_storageDelete/clear sessionStorage
safari_export_storageExport all storage as JSON (backup/restore sessions)
safari_import_storageImport storage state from JSON

Clipboard (2)

| Tool | De


README truncated. View full README on GitHub.

Alternatives

Related Skills

Browse all skills
chief-architect

PERSONAL APP ARCHITECT - Strategic development orchestrator for personal productivity applications. Analyzes project context, makes architectural decisions for single-developer projects, delegates to specialized skills, and ensures alignment between user experience goals and technical implementation. Optimized for personal apps targeting 10-100 users.

0
personal-analytics

Analyze conversation patterns, track productivity, and surface self-knowledge insights. Use when user wants to understand their own patterns (when they chat, what topics they discuss, productivity trends, sentiment over time). Provides weekly/monthly reports, topic recommendations, and time-based insights. Privacy-first design with all analysis local.

0
windsurf-extension-pack

Install and configure essential Windsurf extensions for productivity. Activate when users mention "install extensions", "setup windsurf plugins", "configure extensions", "extension recommendations", or "productivity extensions". Handles extension installation and configuration. Use when working with windsurf extension pack functionality. Trigger with phrases like "windsurf extension pack", "windsurf pack", "windsurf".

0
cto-engineering-metrics

Expert methodology for defining, tracking, and interpreting engineering performance metrics including DORA, team health, productivity, and executive reporting.

0
email-management-expert

Expert email management assistant for Apple Mail. Use this when the user mentions inbox management, email organization, email triage, inbox zero, organizing emails, managing mail folders, email productivity, checking emails, or email workflow optimization. Provides intelligent workflows and best practices for efficient email handling.

0
windsurf-usage-analytics

Analyze team AI usage patterns and productivity metrics. Activate when users mention "usage analytics", "ai metrics", "productivity tracking", "usage reports", or "roi analysis". Handles analytics and reporting configuration. Use when working with windsurf usage analytics functionality. Trigger with phrases like "windsurf usage analytics", "windsurf analytics", "windsurf".

0