# achiya-automation/safari-mcp [Health: Active]

**Category:** 📂 Browser Automation  
**Repository:** https://github.com/achiya-automation/safari-mcp  
**GitHub Stars:** 225  
**npm Downloads (last month):** 4453  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/achiya-automation-safari-mcp

## Description
Native Safari browser automation for AI agents with 80+ tools. No Chrome dependency, optimized for Apple Silicon with 60% less CPU overhead.

## Tools
Capabilities this server exposes over MCP:

- **safari_navigate** — Navigate to URL (auto HTTPS, wait for load)
- **safari_go_back** — Go back in history
- **safari_go_forward** — Go forward in history
- **safari_reload** — Reload page (optional hard reload)
- **safari_read_page** — Get title, URL, and text content
- **safari_get_source** — Get full HTML source
- **safari_navigate_and_read** — Navigate + read in one call
- **safari_click** — Click by CSS selector, visible text, or coordinates
- **safari_double_click** — Double-click (select word, etc.)
- **safari_right_click** — Right-click (context menu)
- **safari_hover** — Hover over element
- **safari_click_and_wait** — Click + wait for navigation
- **safari_click_and_read** — Click then return the updated page — saves a round-trip (React Router + full loads)
- **safari_fill** — Fill input (React/Vue/Angular compatible)
- **safari_clear_field** — Clear input field
- **safari_select_option** — Select dropdown option
- **safari_fill_form** — Batch fill multiple fields
- **safari_fill_and_submit** — Fill form + submit in one call
- **safari_type_text** — Type real keystrokes (JS-based, no System Events)
- **safari_press_key** — Press key with modifiers
- **safari_react_select_set** — Set a react-select v5 value via React fiber — bypasses the menu UI
- **safari_react_select_list_options** — List a react-select v5 dropdown's options without opening it
- **safari_replace_editor** — Replace all content in a code editor (Monaco, CodeMirror, Ace, ProseMirror)
- **safari_verify_state** — Verify an editor's framework-level state matches expected — catch stale DOM before Submit
- **safari_screenshot** — Screenshot as PNG (viewport or full page)
- **safari_screenshot_element** — Screenshot a specific element
- **safari_save_pdf** — Export page as PDF
- **safari_scroll** — Scroll up/down by pixels
- **safari_scroll_to** — Scroll to exact position
- **safari_scroll_to_element** — Smooth scroll to element
- **safari_list_tabs** — List all tabs (index, title, URL)
- **safari_new_tab** — Open new tab (background, no focus steal)
- **safari_close_tab** — Close tab
- **safari_switch_tab** — Switch to tab by index
- **safari_wait_for_new_tab** — Wait for a new tab (e.g. OAuth popup) and auto-switch to it
- **safari_wait_for** — Wait for element, text, or URL change
- **safari_wait** — Wait for specified milliseconds
- **safari_evaluate** — Execute arbitrary JavaScript, return result
- **safari_eval_file** — Execute JavaScript read from a file path (avoids huge inline scripts)
- **safari_list_frames** — List every document in the tab (main page + each iframe) with frameId, URL and text length — pass a frameId to `safari_evaluate`'s `frame` to run inside a cross-origin iframe
- **safari_get_element** — Element details (tag, rect, attrs, visibility)
- **safari_query_all** — Find all matching elements
- **safari_get_computed_style** — Computed CSS styles
- **safari_detect_forms** — Auto-detect all forms with field selectors
- **safari_accessibility_snapshot** — Full a11y tree: roles, ARIA, focusable elements
- **safari_snapshot** — Accessibility tree with ref IDs for every interactive element — preferred way to see page state
- **safari_drag** — Drag between elements or coordinates
- **safari_upload_file** — Upload file via JS DataTransfer (no file dialog!)
- **safari_paste_image** — Paste image into editor (no clipboard touch!)
- **safari_handle_dialog** — Handle alert/confirm/prompt
- **safari_resize** — Resize browser window
- **safari_emulate** — Emulate device (iPhone, iPad, Pixel, Galaxy)
- **safari_reset_emulation** — Reset to desktop
- **safari_get_cookies** — Get all cookies
- **safari_set_cookie** — Set cookie with all options
- **safari_delete_cookies** — Delete one or all cookies
- **safari_local_storage** — Read localStorage
- **safari_set_local_storage** — Write localStorage
- **safari_delete_local_storage** — Delete/clear localStorage
- **safari_session_storage** — Read sessionStorage
- **safari_set_session_storage** — Write sessionStorage
- **safari_delete_session_storage** — Delete/clear sessionStorage
- **safari_export_storage** — Export all storage as JSON (backup/restore sessions)
- **safari_import_storage** — Import storage state from JSON
- **safari_clipboard_read** — Read clipboard text
- **safari_clipboard_write** — Write text to clipboard
- **safari_network** — Quick network requests via Performance API
- **safari_start_network_capture** — Start detailed capture (fetch + XHR)
- **safari_network_details** — Get captured requests with headers/timing
- **safari_clear_network** — Clear captured requests
- **safari_mock_route** — Mock network responses (intercept fetch/XHR)
- **safari_clear_mocks** — Remove all network mocks
- **safari_start_console** — Start capturing console messages
- **safari_get_console** — Get all captured messages
- **safari_clear_console** — Clear captured messages
- **safari_console_filter** — Filter by level (log/warn/error)
- **safari_performance_metrics** — Navigation timing, Web Vitals, memory
- **safari_throttle_network** — Simulate slow-3g/fast-3g/4g/offline
- **safari_extract_tables** — Tables as structured JSON
- **safari_extract_meta** — All meta: OG, Twitter, JSON-LD, canonical

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "safari-mcp": {
    "command": "npx",
    "args": ["safari-mcp"]
  }
}
```

## Documentation

## What achiya-automation/safari-mcp does

achiya-automation/safari-mcp gives MCP-compatible AI agents control of a real Safari browser on macOS. It is designed for sessions where Safari is already signed in, so browser state such as cookies, logins, and active sessions remains available to automation. The server uses Safari's native WebKit environment rather than launching Chromium or requiring a separate browser automation stack.

The package exposes 98 tools across browser navigation, page inspection, interaction, forms, screenshots, network and storage operations, and accessibility workflows. It can operate Safari in the background, making it suitable for coding agents that need to inspect or update web applications while the user continues working.

## How it works

Install or invoke the package as a local stdio process. The MCP client starts `npx safari-mcp`, and the server translates tool calls into actions in Safari. A typical interaction starts by obtaining page state with `safari_snapshot`, then targeting elements using a snapshot reference, CSS selector, visible text, or screen coordinates. After an action, taking another snapshot or reading the page lets the agent verify the result.

The server supports ordinary page loads as well as client-side application flows. For example, `safari_click_and_read` combines a click with returning the updated page, while `safari_navigate_and_read` combines navigation and page extraction. Multiple agents can instead connect through a shared HTTP daemon by starting the package with `SAFARI_MCP_HTTP=1` and an optional `SAFARI_MCP_HTTP_PORT`.

## Setup and configuration

Safari MCP requires macOS with Safari and Node.js 20 or newer. In Safari, enable **Show features for web developers** under Settings → Advanced, then enable **Allow JavaScript from Apple Events** under Settings → Developer.

The simplest installation is:

```bash
npx safari-mcp
```

A global npm installation is also supported:

```bash
npm install -g safari-mcp
```

The server can be configured in MCP clients with the command `npx` and the argument `safari-mcp`. The package also supports installation through Homebrew or from the Git repository. VS Code and Cursor provide one-click installation links in the project configuration.

## Tools and capabilities

Available operations include:

- Navigate, reload, and move through browser history with `safari_navigate`, `safari_reload`, `safari_go_back`, and `safari_go_forward`.
- Inspect page titles, URLs, text, HTML, and accessibility state with `safari_read_page`, `safari_get_source`, and `safari_snapshot`.
- Click, double-click, right-click, hover, scroll, and target elements by selectors, text, coordinates, or snapshot references.
- Fill, clear, and submit forms, select dropdown values, type keystrokes, and press modified keys.
- Set and inspect React Select v5 controls, replace content in Monaco, CodeMirror, Ace, and ProseMirror editors, and verify framework-level editor state.
- Capture viewport or full-page PNG screenshots, capture individual elements, and export pages as PDF files.

Framework-aware form operations include native setter behavior for React, Vue, Angular, and Svelte applications. Specialized tools can avoid menu interaction for React Select v5 and help detect stale editor DOM before submission.

## Limitations and notes

The server is macOS-only and depends on Safari's Apple Events JavaScript permission. It drives the real Safari profile rather than an isolated browser session, so agents operate with the cookies, logins, and sessions available in that browser. Concurrent agents using one Safari instance can contend for the active tab; the shared HTTP mode is provided for running several agents against one browser process.

Safari MCP does not require Chrome, Puppeteer, Playwright, or WebDriver. Its MCP configuration uses local stdio by default, while HTTP mode requires setting `SAFARI_MCP_HTTP=1` and can use `SAFARI_MCP_HTTP_PORT` to choose the daemon port.

_Full upstream README: https://allmcps.com/mcp/achiya-automation-safari-mcp/readme_

