{"id":47724080,"url":"https://github.com/achiya-automation/safari-mcp","last_synced_at":"2026-07-05T07:01:05.715Z","repository":{"id":345350694,"uuid":"1185552276","full_name":"achiya-automation/safari-mcp","owner":"achiya-automation","description":"Native Safari browser automation for AI agents. 80 tools via AppleScript — zero overhead, keeps logins, runs silently in background. Drop-in alternative to Chrome DevTools MCP with 40-60% less CPU/heat on Apple Silicon.","archived":false,"fork":false,"pushed_at":"2026-07-02T03:14:57.000Z","size":22931,"stargazers_count":132,"open_issues_count":6,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-07-02T05:11:46.558Z","etag":null,"topics":["ai-agents","ai-tools","apple-silicon","applescript","automation","browser-automation","claude","claude-code","cursor","devtools","llm-tools","macos","mcp","mcp-server","model-context-protocol","safari","safari-mcp","web-automation","webkit","windsurf"],"latest_commit_sha":null,"homepage":"https://achiya-automation.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/achiya-automation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"achiyaautomation","custom":["https://paypal.me/achiyaC123"]}},"created_at":"2026-03-18T17:47:00.000Z","updated_at":"2026-07-02T03:14:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/achiya-automation/safari-mcp","commit_stats":null,"previous_names":["achiya-automation/safari-mcp"],"tags_count":73,"template":false,"template_full_name":null,"purl":"pkg:github/achiya-automation/safari-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achiya-automation%2Fsafari-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achiya-automation%2Fsafari-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achiya-automation%2Fsafari-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achiya-automation%2Fsafari-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/achiya-automation","download_url":"https://codeload.github.com/achiya-automation/safari-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achiya-automation%2Fsafari-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35145900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","ai-tools","apple-silicon","applescript","automation","browser-automation","claude","claude-code","cursor","devtools","llm-tools","macos","mcp","mcp-server","model-context-protocol","safari","safari-mcp","web-automation","webkit","windsurf"],"created_at":"2026-04-02T20:02:49.175Z","updated_at":"2026-07-05T07:01:05.658Z","avatar_url":"https://github.com/achiya-automation.png","language":"JavaScript","funding_links":["https://ko-fi.com/achiyaautomation","https://paypal.me/achiyaC123"],"categories":["CI/CD \u0026 DevOps Pipelines","Browser Automation","MCP 服务器精选列表","🌐 Browser Automation \u0026 Web Scraping","🌐 Web Development"],"sub_categories":["📂 Browser Automation","🌐 浏览器自动化与网页交互"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"social-preview.png\" alt=\"Safari MCP Server — 97 native browser automation tools for AI agents on macOS\" width=\"100%\"\u003e\n\n\u003cbr/\u003e\n\n# 🦁 Safari MCP\n\n**The browser for your coding agent.**\n\n*Your real Safari, logged in — no Chrome, no heat, no headless.*\n\n[![npm version](https://img.shields.io/npm/v/safari-mcp)](https://www.npmjs.com/package/safari-mcp)\n[![npm downloads](https://img.shields.io/npm/dm/safari-mcp)](https://www.npmjs.com/package/safari-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![macOS](https://img.shields.io/badge/macOS-only-blue)](https://www.apple.com/macos/)\n\n[![Glama AAA](https://img.shields.io/badge/Glama-AAA_Score-22c55e?logo=ai)](https://glama.ai/mcp/servers/@achiya-automation/safari-mcp)\n[![MCP Registry](https://img.shields.io/badge/MCP_Registry-Verified-2563eb)](https://registry.modelcontextprotocol.io/v0/servers?search=achiya-automation)\n[![Smithery](https://img.shields.io/badge/Smithery-Listed-7c3aed)](https://smithery.ai/server/@achiya-automation/safari-mcp)\n[![MCP Score](https://mcpscoreboard.com/badge/05977769-8762-4e89-aff3-a0c5776843bb.svg)](https://mcpscoreboard.com/server/05977769-8762-4e89-aff3-a0c5776843bb/)\n\n\u003ca href=\"vscode:mcp/install?%7B%22safari-mcp%22%3A%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22safari-mcp%22%5D%7D%7D\"\u003e\u003cimg src=\"https://img.shields.io/badge/VS_Code-Install_Server-0078d4?logo=visual-studio-code\u0026logoColor=white\" alt=\"Install in VS Code\"\u003e\u003c/a\u003e\n\u003ca href=\"https://insiders.vscode.dev/redirect?url=vscode-insiders:mcp/install?%7B%22safari-mcp%22%3A%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22safari-mcp%22%5D%7D%7D\"\u003e\u003cimg src=\"https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?logo=visual-studio-code\u0026logoColor=white\" alt=\"Install in VS Code Insiders\"\u003e\u003c/a\u003e\n\u003ca href=\"cursor://anysphere.cursor-deeplink/mcp/install?name=safari-mcp\u0026config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22safari-mcp%22%5D%7D\"\u003e\u003cimg src=\"https://img.shields.io/badge/Cursor-Install_Server-f97316?logo=cursor\u0026logoColor=white\" alt=\"Install in Cursor\"\u003e\u003c/a\u003e\n\n**97 tools** · **No Chrome/Puppeteer/Playwright needed** · **~5ms per command** · **60% less CPU than Chrome**\n\n[Quick Start](#quick-start) · [All 97 Tools](#tools-97) · [Examples](examples/) · [Why Safari MCP?](#safari-mcp-vs-alternatives) · [Architecture](#architecture) · [Changelog](CHANGELOG.md)\n\n![Safari MCP Demo](https://github.com/achiya-automation/safari-mcp/raw/main/assets/safari-mcp-promo.gif)\n\n\u003c/div\u003e\n\n## ❌ Without Safari MCP\n\nYour AI agent needs to browse. So it either:\n\n- **Spins up Chromium via Playwright** — with no logins, no cookies, no sessions\n- **Uses Chrome DevTools MCP** — and melts your fan running a second browser\n- **Relies on headless scrapers** — blocked by Cloudflare, reCAPTCHA, and bot detection\n\n## ✅ With Safari MCP\n\nYour AI drives the **Safari you're already logged into** — Gmail, GitHub, Ahrefs, Slack, banking.\n\nNative WebKit. ~60% less CPU. Background operation. 97 tools. One `npx` command. macOS only.\n\n\u003e 📰 **Featured on freeCodeCamp:** [How to Connect Your AI Coding Agent to a Browser on macOS](https://www.freecodecamp.org/news/how-to-connect-your-ai-coding-agent-to-a-browser-on-macos/) · [HackerNoon: Reverse-Engineering React, Shadow DOM, and CSP](https://hackernoon.com/i-had-to-reverse-engineer-react-shadow-dom-and-csp-to-automate-safari-without-chrome)\n\n\u003e 🍎 **Apple shipped an official Safari MCP** (Safari Technology Preview 247, July 2026). It's built on `safaridriver` for isolated debugging sessions. safari-mcp drives the **real Safari you're already logged into** — on stable Safari, with 97 tools. See the full comparison below.\n\n---\n\n## Highlights\n\n- **97 tools** — navigation, clicks, forms, screenshots, network, storage, accessibility, and more\n- **Zero heat** — native WebKit on Apple Silicon, ~60% less CPU than Chrome\n- **Your real browser** — keeps all logins, cookies, sessions (Gmail, GitHub, Ahrefs, etc.)\n- **Background operation** — Safari stays in the background, no window stealing\n- **No browser dependencies** — no Puppeteer, no Playwright, no WebDriver, no Chrome\n- **Persistent process** — reuses a single osascript process (~5ms per command vs ~80ms)\n- **Framework-compatible** — React, Vue, Angular, Svelte form filling via native setters\n\n---\n\n## Quick Start\n\n### Prerequisites\n\n- macOS (any version with Safari)\n- Node.js 18+\n- Safari → Settings → Advanced → **Show features for web developers** ✓\n- Safari → Develop → **Allow JavaScript from Apple Events** ✓\n\n### Install (one command)\n\n```bash\nnpx safari-mcp\n```\n\nThat's it — no global install needed. Or install permanently:\n\n```bash\nnpm install -g safari-mcp\n```\n\n### Configure your MCP client\n\nAll clients run Safari MCP the same way — `npx safari-mcp`. Pick your editor:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Code\u003c/b\u003e\u003c/summary\u003e\n\n```bash\nclaude mcp add safari -- npx safari-mcp\n```\n\nOr edit `~/.mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"safari\": {\n      \"command\": \"npx\",\n      \"args\": [\"safari-mcp\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Desktop\u003c/b\u003e\u003c/summary\u003e\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"safari\": {\n      \"command\": \"npx\",\n      \"args\": [\"safari-mcp\"]\n    }\n  }\n}\n```\n\nRestart Claude Desktop after saving.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCursor\u003c/b\u003e\u003c/summary\u003e\n\nOne-click: [**Install in Cursor**](cursor://anysphere.cursor-deeplink/mcp/install?name=safari-mcp\u0026config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22safari-mcp%22%5D%7D)\n\nOr edit `.cursor/mcp.json` in your project:\n\n```json\n{\n  \"mcpServers\": {\n    \"safari\": {\n      \"command\": \"npx\",\n      \"args\": [\"safari-mcp\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eVS Code / VS Code Insiders\u003c/b\u003e\u003c/summary\u003e\n\nOne-click: [**Install in VS Code**](vscode:mcp/install?%7B%22safari-mcp%22%3A%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22safari-mcp%22%5D%7D%7D)\n\nOr edit `.vscode/mcp.json`:\n\n```json\n{\n  \"servers\": {\n    \"safari\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"safari-mcp\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eWindsurf\u003c/b\u003e\u003c/summary\u003e\n\nEdit `.windsurf/mcp.json` in your project (or `~/.codeium/windsurf/mcp_config.json` globally):\n\n```json\n{\n  \"mcpServers\": {\n    \"safari\": {\n      \"command\": \"npx\",\n      \"args\": [\"safari-mcp\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCline\u003c/b\u003e\u003c/summary\u003e\n\nOpen Cline in VS Code → click the MCP icon → **Edit MCP Settings** → add:\n\n```json\n{\n  \"mcpServers\": {\n    \"safari\": {\n      \"command\": \"npx\",\n      \"args\": [\"safari-mcp\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eContinue\u003c/b\u003e\u003c/summary\u003e\n\nEdit `~/.continue/config.yaml` (or `.continue/config.yaml` in workspace):\n\n```yaml\nmcpServers:\n  - name: safari\n    command: npx\n    args:\n      - safari-mcp\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eGoose\u003c/b\u003e\u003c/summary\u003e\n\nEdit `~/.config/goose/config.yaml`:\n\n```yaml\nextensions:\n  safari:\n    name: safari\n    type: stdio\n    cmd: npx\n    args:\n      - safari-mcp\n    enabled: true\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eLM Studio\u003c/b\u003e\u003c/summary\u003e\n\nOpen LM Studio → **Settings** → **MCP Servers** → **Add Server**:\n\n- **Name:** `safari`\n- **Command:** `npx`\n- **Args:** `safari-mcp`\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eZed\u003c/b\u003e\u003c/summary\u003e\n\nOpen Zed → **Settings** → search for \"Context Servers\" and add:\n\n```json\n{\n  \"context_servers\": {\n    \"safari\": {\n      \"command\": {\n        \"path\": \"npx\",\n        \"args\": [\"safari-mcp\"]\n      }\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAlternative: Homebrew\u003c/b\u003e\u003c/summary\u003e\n\n```bash\nbrew install achiya-automation/tap/safari-mcp\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAlternative: from source\u003c/b\u003e\u003c/summary\u003e\n\n```bash\ngit clone https://github.com/achiya-automation/safari-mcp.git\ncd safari-mcp \u0026\u0026 npm install\n```\n\u003c/details\u003e\n\n---\n\n## Usage Workflow\n\nThe recommended pattern for AI agents using Safari MCP:\n\n```\n1. safari_snapshot        → Get page state (accessibility tree)\n2. safari_click/fill/...  → Interact with elements by ref\n3. safari_snapshot        → Verify the result\n```\n\n**Element targeting** — tools accept multiple targeting strategies:\n\n| Strategy | Example | Best for |\n|----------|---------|----------|\n| CSS selector | `#login-btn`, `.submit` | Unique elements |\n| Visible text | `\"Sign In\"`, `\"Submit\"` | Buttons, links |\n| Coordinates | `x: 100, y: 200` | Canvas, custom widgets |\n| Ref from snapshot | `ref: \"e42\"` | Any element from accessibility tree |\n\n\u003e **Tip:** Start with `safari_snapshot` to get element refs, then use refs for precise targeting. This is faster and more reliable than CSS selectors.\n\n---\n\n## Tools (97)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClick to expand the full tool list — organized by category\u003c/b\u003e\u003c/summary\u003e\n\n### Navigation (4)\n| Tool | Description |\n|------|-------------|\n| `safari_navigate` | Navigate to URL (auto HTTPS, wait for load) |\n| `safari_go_back` | Go back in history |\n| `safari_go_forward` | Go forward in history |\n| `safari_reload` | Reload page (optional hard reload) |\n\n### Page Reading (3)\n| Tool | Description |\n|------|-------------|\n| `safari_read_page` | Get title, URL, and text content |\n| `safari_get_source` | Get full HTML source |\n| `safari_navigate_and_read` | Navigate + read in one call |\n\n### Click \u0026 Interaction (6)\n| Tool | Description |\n|------|-------------|\n| `safari_click` | Click by CSS selector, visible text, or coordinates |\n| `safari_double_click` | Double-click (select word, etc.) |\n| `safari_right_click` | Right-click (context menu) |\n| `safari_hover` | Hover over element |\n| `safari_click_and_wait` | Click + wait for navigation |\n| `safari_click_and_read` | Click then return the updated page — saves a round-trip (React Router + full loads) |\n\n### Form Input (11)\n| Tool | Description |\n|------|-------------|\n| `safari_fill` | Fill input (React/Vue/Angular compatible) |\n| `safari_clear_field` | Clear input field |\n| `safari_select_option` | Select dropdown option |\n| `safari_fill_form` | Batch fill multiple fields |\n| `safari_fill_and_submit` | Fill form + submit in one call |\n| `safari_type_text` | Type real keystrokes (JS-based, no System Events) |\n| `safari_press_key` | Press key with modifiers |\n| `safari_react_select_set` | Set a react-select v5 value via React fiber — bypasses the menu UI |\n| `safari_react_select_list_options` | List a react-select v5 dropdown's options without opening it |\n| `safari_replace_editor` | Replace all content in a code editor (Monaco, CodeMirror, Ace, ProseMirror) |\n| `safari_verify_state` | Verify an editor's framework-level state matches expected — catch stale DOM before Submit |\n\n### Screenshots \u0026 PDF (3)\n| Tool | Description |\n|------|-------------|\n| `safari_screenshot` | Screenshot as PNG (viewport or full page) |\n| `safari_screenshot_element` | Screenshot a specific element |\n| `safari_save_pdf` | Export page as PDF |\n\n### Scroll (3)\n| Tool | Description |\n|------|-------------|\n| `safari_scroll` | Scroll up/down by pixels |\n| `safari_scroll_to` | Scroll to exact position |\n| `safari_scroll_to_element` | Smooth scroll to element |\n\n### Tab Management (5)\n| Tool | Description |\n|------|-------------|\n| `safari_list_tabs` | List all tabs (index, title, URL) |\n| `safari_new_tab` | Open new tab (background, no focus steal) |\n| `safari_close_tab` | Close tab |\n| `safari_switch_tab` | Switch to tab by index |\n| `safari_wait_for_new_tab` | Wait for a new tab (e.g. OAuth popup) and auto-switch to it |\n\n### Wait (2)\n| Tool | Description |\n|------|-------------|\n| `safari_wait_for` | Wait for element, text, or URL change |\n| `safari_wait` | Wait for specified milliseconds |\n\n### JavaScript (1)\n| Tool | Description |\n|------|-------------|\n| `safari_evaluate` | Execute arbitrary JavaScript, return result |\n| `safari_eval_file` | Execute JavaScript read from a file path (avoids huge inline scripts) |\n\n### Element Inspection (4)\n| Tool | Description |\n|------|-------------|\n| `safari_get_element` | Element details (tag, rect, attrs, visibility) |\n| `safari_query_all` | Find all matching elements |\n| `safari_get_computed_style` | Computed CSS styles |\n| `safari_detect_forms` | Auto-detect all forms with field selectors |\n\n### Accessibility (2)\n| Tool | Description |\n|------|-------------|\n| `safari_accessibility_snapshot` | Full a11y tree: roles, ARIA, focusable elements |\n| `safari_snapshot` | Accessibility tree with ref IDs for every interactive element — preferred way to see page state |\n\n### Drag \u0026 Drop (1)\n| Tool | Description |\n|------|-------------|\n| `safari_drag` | Drag between elements or coordinates |\n\n### File Operations (2)\n| Tool | Description |\n|------|-------------|\n| `safari_upload_file` | Upload file via JS DataTransfer (no file dialog!) |\n| `safari_paste_image` | Paste image into editor (no clipboard touch!) |\n\n### Dialog \u0026 Window (2)\n| Tool | Description |\n|------|-------------|\n| `safari_handle_dialog` | Handle alert/confirm/prompt |\n| `safari_resize` | Resize browser window |\n\n### Device Emulation (2)\n| Tool | Description |\n|------|-------------|\n| `safari_emulate` | Emulate device (iPhone, iPad, Pixel, Galaxy) |\n| `safari_reset_emulation` | Reset to desktop |\n\n### Cookies \u0026 Storage (11)\n| Tool | Description |\n|------|-------------|\n| `safari_get_cookies` | Get all cookies |\n| `safari_set_cookie` | Set cookie with all options |\n| `safari_delete_cookies` | Delete one or all cookies |\n| `safari_local_storage` | Read localStorage |\n| `safari_set_local_storage` | Write localStorage |\n| `safari_delete_local_storage` | Delete/clear localStorage |\n| `safari_session_storage` | Read sessionStorage |\n| `safari_set_session_storage` | Write sessionStorage |\n| `safari_delete_session_storage` | Delete/clear sessionStorage |\n| `safari_export_storage` | Export all storage as JSON (backup/restore sessions) |\n| `safari_import_storage` | Import storage state from JSON |\n\n### Clipboard (2)\n| Tool | Description |\n|------|-------------|\n| `safari_clipboard_read` | Read clipboard text |\n| `safari_clipboard_write` | Write text to clipboard |\n\n### Network (6)\n| Tool | Description |\n|------|-------------|\n| `safari_network` | Quick network requests via Performance API |\n| `safari_start_network_capture` | Start detailed capture (fetch + XHR) |\n| `safari_network_details` | Get captured requests with headers/timing |\n| `safari_clear_network` | Clear captured requests |\n| `safari_mock_route` | Mock network responses (intercept fetch/XHR) |\n| `safari_clear_mocks` | Remove all network mocks |\n\n### Console (4)\n| Tool | Description |\n|------|-------------|\n| `safari_start_console` | Start capturing console messages |\n| `safari_get_console` | Get all captured messages |\n| `safari_clear_console` | Clear captured messages |\n| `safari_console_filter` | Filter by level (log/warn/error) |\n\n### Performance (2)\n| Tool | Description |\n|------|-------------|\n| `safari_performance_metrics` | Navigation timing, Web Vitals, memory |\n| `safari_throttle_network` | Simulate slow-3g/fast-3g/4g/offline |\n\n### Data Extraction (4)\n| Tool | Description |\n|------|-------------|\n| `safari_extract_tables` | Tables as structured JSON |\n| `safari_extract_meta` | All meta: OG, Twitter, JSON-LD, canonical |\n| `safari_extract_images` | Images with dimensions and loading info |\n| `safari_extract_links` | Links with rel, external/nofollow detection |\n\n### Advanced (7)\n| Tool | Description |\n|------|-------------|\n| `safari_override_geolocation` | Override browser geolocation |\n| `safari_list_indexed_dbs` | List IndexedDB databases |\n| `safari_get_indexed_db` | Read IndexedDB records |\n| `safari_css_coverage` | Find unused CSS rules |\n| `safari_analyze_page` | Full page analysis in one call |\n| `safari_doctor` | Diagnose the macOS permission + daemon chain (Apple Events, Accessibility, Screen Recording, codesign) with per-failure fixes |\n| `safari_reload_extension` | Hot-reload the Safari MCP Bridge extension without a manual toggle |\n\n### Automation (1)\n| Tool | Description |\n|------|-------------|\n| `safari_run_script` | Run multiple actions in a single call (batch) |\n\n### Native Input — CGEvent (4)\n| Tool | Description |\n|------|-------------|\n| `safari_native_click` | OS-level mouse click (CGEvent, `isTrusted: true`) — bypasses WAF/bot detection when `safari_click` is blocked (405/403) |\n| `safari_native_hover` | OS-level cursor hover — triggers real `:hover`/`mouseenter` for tooltips and obfuscated UIs |\n| `safari_native_type` | Insert text via the real paste pipeline — ProseMirror/Slate/Draft.js process it natively so Submit sends real data |\n| `safari_native_keyboard` | OS-level keypress + modifiers to Safari, no focus steal — reaches React trust-gated handlers (Discord/Slack send) |\n\n### iOS \u0026 WebKit Validation (4)\n| Tool | Description |\n|------|-------------|\n| `safari_inspect_viewport` | Validate the `\u003cmeta name=viewport\u003e` tag for iOS Safari (device-width, zoom/WCAG, viewport-fit) |\n| `safari_safe_area_insets` | Read live safe-area-inset values + viewport-fit / `env()` usage (notch / Dynamic Island) |\n| `safari_check_pwa` | Audit iOS \"Add to Home Screen\" / PWA readiness (apple-touch-icon, manifest, theme-color, splash) |\n| `safari_webkit_compat` | Check page CSS against this Safari via `CSS.supports()` — unsupported props, missing `-webkit-` prefixes, known quirks |\n\n\u003c/details\u003e\n\n---\n\n## Security\n\nSafari MCP runs locally on your Mac with minimal attack surface:\n\n| Aspect | Detail |\n|--------|--------|\n| Network | **No remote connections** — all communication is local (stdio + localhost) |\n| Permissions | macOS system permissions required (Screen Recording for screenshots) |\n| Data | No telemetry, no analytics, no data sent anywhere |\n| Extension | Communicates only with `localhost:9224`, validated by Safari |\n| Code | Fully open source (MIT) — audit every line |\n\n---\n\n## Safari MCP vs Alternatives\n\n| Feature | Safari MCP | Chrome DevTools MCP | Playwright MCP |\n|---------|:----------:|:-------------------:|:--------------:|\n| CPU/Heat | 🟢 Minimal | 🔴 High | 🟡 Medium |\n| Your logins | ✅ Yes | ✅ Yes | ❌ No |\n| macOS native | ✅ WebKit | ❌ Chromium | ❌ Chromium/WebKit |\n| Browser dependencies | None | Chrome + debug port | Playwright runtime |\n| Tools | 97 | ~30 | ~25 |\n| File upload | JS (no dialog) | CDP | Playwright API |\n| Image paste | JS (no clipboard) | CDP | Playwright API |\n| Focus steal | ❌ Background | ❌ Background | ❌ Headless |\n| Network mocking | ✅ | ❌ | ✅ |\n| Lighthouse | ❌ | ✅ | ❌ |\n| Performance trace | ❌ | ✅ | ❌ |\n\n\u003e **Tip:** Use Safari MCP for daily browsing tasks (95% of work) and Chrome DevTools MCP only for Lighthouse/Performance audits.\n\n### vs Apple's Official Safari MCP (safaridriver)\n\nIn Safari Technology Preview 247 (July 2026), Apple shipped an **official** Safari MCP server built on `safaridriver`. That's great validation for the category — and it's built for a different job. Apple's server drives an **isolated WebDriver automation session** for debugging; safari-mcp drives the **real Safari you're already logged into**.\n\n| | 🦁 safari-mcp *(this repo)* | Apple `safaridriver --mcp` |\n|---|:---:|:---:|\n| **Your real logins / cookies** | ✅ Your actual Safari | ⚠️ Isolated automation session — no access to AutoFill or browsing activity |\n| **Runs on** | ✅ Stable Safari, every Mac | ❌ Safari Technology Preview 247 only |\n| **Background (no focus steal)** | ✅ Yes | ❌ Dedicated window with a \"controlled by automation\" banner |\n| **Tools** | **97** | ~17 |\n| **Storage** (cookies, localStorage, IndexedDB) | ✅ 10 tools | ❌ |\n| **Network mocking + throttling** | ✅ Yes | ❌ Read-only network inspection |\n| **Device emulation** (iPhone, iPad) | ✅ Yes | ⚠️ Viewport + media type only |\n| **Setup** | `npx safari-mcp` | Enable \"remote automation and external agents\" in STP |\n| **Official Apple support** | ❌ Community (MIT) | ✅ Apple, WebDriver-standard |\n\n\u003e **When Apple's server is the right pick:** you specifically want a clean-room, WebDriver-standard session for compatibility debugging and you already run STP. **For everything else — daily automation on the browser you're already signed into, on stable Safari — safari-mcp is built for exactly that.**\n\n### Why Safari MCP and Not the Other Safari MCP Projects?\n\nThere are several \"safari-mcp\" projects floating around. Here's how they compare:\n\n| Feature | **🦁 safari-mcp** *(this repo)* | [lxman/safari-mcp-server](https://github.com/lxman/safari-mcp-server) | [Epistates/MCPSafari](https://github.com/Epistates/MCPSafari) | [HayoDev/safari-devtools-mcp](https://github.com/HayoDev/safari-devtools-mcp) |\n|---------|:------------------------------:|:----------------------:|:------------:|:----------------------:|\n| **Tools** | **97** | ~10 | 23 | ~15 |\n| **Install** | `npx safari-mcp` | Manual | Binary | `npx` |\n| **Engine** | **Dual** (Extension + AppleScript) | WebDriver | Extension only | DevTools Protocol |\n| **Keeps your real Safari logins** | ✅ Yes | ⚠️ Limited | ✅ Yes | ❌ Debug session |\n| **Background (no focus steal)** | ✅ Yes | ❌ No | ⚠️ Sometimes | ✅ Yes |\n| **Storage tools** (cookies, localStorage, IndexedDB) | **10** | 0 | 0 | 2 |\n| **Data extraction** (tables, meta, images, links) | **4** | 0 | 0 | 0 |\n| **Network mocking** | ✅ Yes | ❌ No | ❌ No | ❌ No |\n| **Device emulation** (iPhone, iPad, Pixel) | ✅ Yes | ❌ No | ❌ No | ❌ No |\n| **File upload** (no dialog) | ✅ JS DataTransfer | ❌ No | ❌ No | ❌ No |\n| **Image paste** (no clipboard touch) | ✅ Yes | ❌ No | ❌ No | ❌ No |\n| **PDF export** | ✅ Yes | ❌ No | ❌ No | ❌ No |\n| **Console capture** | **4 tools** | 0 | 1 | 1 |\n| **Performance metrics + Web Vitals** | ✅ Yes | ❌ No | ❌ No | ⚠️ Partial |\n| **Active maintenance** | ✅ Multiple releases/week | 🟡 Sporadic | 🟡 Slow | 🟡 Slow |\n| **License** | **MIT** | MIT | None specified | MIT |\n| **In MCP Registry** | ✅ | ❌ | ❌ | ✅ |\n| **In Awesome MCP** | ✅ | ❌ | ❌ | ❌ |\n\n\u003e **TL;DR** — if you want the most complete Safari MCP with the smoothest install, the most tools, and active maintenance, **this is the one**.\n\n---\n\n## Architecture\n\nSafari MCP uses a **dual-engine** architecture — the Extension is preferred for speed and advanced capabilities, with AppleScript as an always-available fallback:\n\n```\nClaude/Cursor/AI Agent\n        ↓ MCP Protocol (stdio)\n   Safari MCP Server (Node.js)\n        ↓                    ↓\n   Extension (HTTP)     AppleScript + Swift daemon\n   (~5-20ms/cmd)        (~5ms/cmd, always available)\n        ↓                    ↓\n   Content Script       do JavaScript in tab N\n        ↓                    ↓\n   Page DOM ←←←←←←←←←← Page DOM\n```\n\n**Key design decisions:**\n- **Dual engine with automatic fallback** — Extension is preferred; if not connected, AppleScript handles everything seamlessly\n- **Persistent Swift helper** — one long-running process instead of spawning per command (16x faster)\n- **Tab-indexed operations** — all JS runs on a specific tab by index, never steals visual focus\n- **JS-first approach** — typing, clicking, file upload all use JavaScript events (no System Events keyboard conflicts)\n- **No `activate`** — Safari is never brought to foreground\n\n---\n\n## Safari Extension (Optional)\n\nThe Safari MCP Extension is **optional but recommended**. Without it, ~80% of functionality works via AppleScript alone. The extension adds capabilities that AppleScript cannot provide:\n\n### What the Extension Adds\n\n| Capability | With Extension | AppleScript Only |\n|-----------|:--------------:|:----------------:|\n| Closed Shadow DOM (Reddit, Web Components) | ✅ Full access | ❌ Invisible |\n| Strict CSP sites | ✅ Bypasses via MAIN world | ❌ Often blocked |\n| React/Vue/Angular state manipulation | ✅ Deep (Fiber, ProseMirror) | ⚠️ Basic |\n| Loading state detection (spinners, skeletons) | ✅ Smart detection | ❌ No |\n| Dialog handling (alert/confirm) | ❌ | ✅ Only AppleScript |\n| Native OS-level click (CGEvent) | ❌ | ✅ Only AppleScript |\n| PDF export | ❌ | ✅ Only AppleScript |\n\n\u003e **When do you need the extension?** If you're automating modern SPAs with closed shadow DOM (e.g., Reddit), sites with strict Content Security Policy, or framework-heavy editors (Draft.js, ProseMirror, Slate).\n\n### Installing the Extension\n\nThe extension requires a one-time build with Xcode (free, included with macOS).\n\n\u003e **Note for npm users:** The `xcode/` directory is not included in the npm package.\n\u003e Clone the [GitHub repository](https://github.com/achiya-automation/safari-mcp) to build from source.\n\n**Prerequisites:** Xcode (install from App Store — free)\n\n```bash\n# 1. Clone the repo (the npm package does not include the Xcode project)\ngit clone https://github.com/achiya-automation/safari-mcp.git\ncd safari-mcp\n\n# 2. Build the extension\nxcodebuild -project \"xcode/Safari MCP/Safari MCP.xcodeproj\" \\\n  -scheme \"Safari MCP (macOS)\" -configuration Release build\n\n# 3. Ad-hoc sign the built app so Safari will load it\n# (xcodebuild without a signing identity produces a bundle Safari silently rejects)\nAPP_PATH=$(find ~/Library/Developer/Xcode/DerivedData/Safari_MCP-*/Build/Products/Release -name \"Safari MCP.app\" -maxdepth 2 | head -1)\ncodesign --sign - --force --deep \"$APP_PATH\"\n\n# 4. Re-sign safari-helper with the Apple Events entitlement\n# (helps macOS surface the TCC Automation prompt reliably)\ncodesign --sign - --force --entitlements safari-helper.entitlements safari-helper\n\n# 4. Open the app (needed once so Safari registers the extension)\nopen \"$APP_PATH\"\n```\n\nAlternatively, open `xcode/Safari MCP/Safari MCP.xcodeproj` directly in Xcode, select your Apple ID under Signing \u0026 Capabilities, and click Run. A free personal Apple Developer account is sufficient for local use.\n\nThen in Safari:\n1. Safari → Settings → Advanced → enable **Show features for web developers**\n2. Safari → Develop → **Allow Unsigned Extensions** (required each Safari restart)\n3. Safari → Settings → Extensions → enable **Safari MCP Bridge**\n\nThe extension connects automatically to the MCP server on port `9224`.\n\n\u003e **Note:** \"Allow Unsigned Extensions\" resets every time Safari restarts. You'll need to re-enable it in the Develop menu after each restart. The extension itself stays installed.\n\n**Toolbar icon status:**\n- **ON** — connected to MCP server\n- **OFF** — manually disabled via popup\n- *(no badge)* — server not running, will auto-reconnect\n\n---\n\n## macOS Permissions\n\nSafari MCP needs these one-time permissions:\n\n| Permission | Where | Why |\n|-----------|-------|-----|\n| JavaScript from Apple Events | Safari → Develop menu | Required for `do JavaScript` |\n| Automation → Safari | System Settings → Privacy \u0026 Security → Automation | Required for all AppleScript-backed tools |\n| Screen Recording | System Settings → Privacy \u0026 Security → Screen Recording | Required for `safari_screenshot` |\n| Accessibility (safari-helper) | System Settings → Privacy \u0026 Security → Accessibility | Required for `safari_native_click`, `safari_native_keyboard`, `safari_native_hover` and `safari_save_pdf` |\n\n### Granting Accessibility to safari-helper (required for `safari_native_*`)\n\nThe `safari_native_click`, `safari_native_keyboard` and `safari_native_hover` tools inject OS-level `CGEvent` events into Safari without stealing focus. macOS requires the underlying helper binary to be approved in **Accessibility** before those events can reach a non-frontmost window.\n\n1. Open **System Settings → Privacy \u0026 Security → Accessibility**.\n2. Click `+` (unlock with your password if needed).\n3. Navigate to the helper binary and add it:\n   - npm global install: `$(npm root -g)/safari-mcp/safari-helper`\n   - npx / project install: `./node_modules/safari-mcp/safari-helper`\n   - From source clone: `/path/to/safari-mcp/safari-helper`\n4. Make sure the toggle next to it is **ON**.\n\nThe postinstall script re-signs the helper with a stable identifier (`com.achiya-automation.safari-mcp`) so this permission survives future upgrades — without that step, every `npm update` would silently revoke approval because the binary's adhoc-signed identifier changes per build.\n\nIf `safari_native_click` reports success but the page doesn't react (no `isTrusted: true` click events fire), the helper is most likely missing this approval. The `safari_*` (non-`native_`) tools don't need it.\n\n### Granting Automation → Safari (important for IDE users)\n\nmacOS TCC grants Automation permission to the **parent process** that spawns the MCP server, not to `safari-mcp` itself. So you need to grant **Automation → Safari** to the app that runs Claude Code / Cursor / Windsurf — typically **Visual Studio Code** or **Terminal**.\n\nIf the permission dialog never appears automatically, run this command once from a Terminal that already has Automation permission:\n\n```bash\nosascript -e 'tell application \"Safari\" to get URL of current tab of window 1'\n```\n\nThat call registers the Terminal app in the Automation database and then triggers the prompt for Safari. After you approve it, subsequent MCP calls from any child process chain will work.\n\n---\n\n## Troubleshooting\n\n| Issue | Fix |\n|-------|-----|\n| \"AppleScript error\" | Enable \"Allow JavaScript from Apple Events\" in Safari → Develop |\n| \"Not authorized to send Apple events to Safari\" | Grant Automation → Safari to your IDE (see above) |\n| \"Not authorized\" after `npm update` | Updating changes the binary's cdhash — macOS silently revokes Automation permission. Re-run the `osascript` one-liner above to re-grant it |\n| `safari_native_click` reports success but page doesn't react | Add `safari-helper` to **System Settings → Privacy \u0026 Security → Accessibility** (see [Granting Accessibility](#granting-accessibility-to-safari-helper-required-for-safari_native_) above). Confirm by attaching a `click` listener with `{capture:true}` in the page console — without the grant, no `isTrusted: true` event fires |\n| Screenshots empty | Grant Screen Recording permission to Terminal/VS Code |\n| Tab not found | Call `safari_list_tabs` to refresh tab indices |\n| Hebrew keyboard issues | All typing uses JS events — immune to keyboard layout |\n| HTTPS blocked | `safari_navigate` auto-tries HTTPS first, falls back to HTTP |\n| Safari steals focus | Ensure you're on latest version — `newTab` restores your active tab |\n\n---\n\n## Works With\n\nSafari MCP works with any MCP-compatible client:\n\n| Client | Status |\n|--------|--------|\n| [Claude Code](https://claude.ai/claude-code) | ✅ Tested daily |\n| [Claude Desktop](https://claude.ai/download) | ✅ Tested |\n| [Cursor](https://cursor.sh) | ✅ Tested |\n| [Windsurf](https://codeium.com/windsurf) | ✅ Compatible |\n| [VS Code + Continue](https://continue.dev) | ✅ Compatible |\n\n---\n\n## Contributing\n\nPRs welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions.\n\nThe codebase is two files:\n- `safari.js` — Safari automation layer (AppleScript + JavaScript)\n- `index.js` — MCP server with tool definitions\n\n---\n\n## Sponsors\n\nSafari MCP is free and open source. If it saves you time or CPU cycles, consider supporting its development:\n\n\u003ca href=\"https://paypal.me/achiyaC123\"\u003e\u003cimg src=\"https://img.shields.io/badge/Sponsor-PayPal-blue?logo=paypal\" alt=\"Sponsor via PayPal\"\u003e\u003c/a\u003e\n\nYour support funds:\n- 🧪 Testing across macOS versions and Safari releases\n- 🛠️ New tools and features\n- 📖 Documentation and examples\n\n[Become the first sponsor!](https://paypal.me/achiyaC123)\n\n---\n\n## Commercial Support\n\n**Need Safari MCP integrated into your product or agent stack?** [Achiya Automation](https://achiya-automation.com/en/blog/safari-mcp-browser-automation/) offers:\n\n- **Priority bug fixes** and custom tool development for your use case\n- **Integration consulting** — wiring Safari MCP into production agent systems (Claude, Cursor, n8n, custom)\n- **Private deployment support** — multi-user Safari MCP, non-standard macOS environments, CI/CD\n- **Training workshops** for engineering teams adopting MCP-based automation\n\nBuilt by the author of Safari MCP. [Start a conversation →](https://achiya-automation.com/en/contact/)\n\n---\n\n## What agents unlock with Safari MCP\n\nWhen an AI agent drives Safari MCP, it gets things a headless browser can't:\n\n- **Real authenticated sessions** — Gmail, GitHub, Ahrefs, Slack, banking dashboards are all already logged in\n- **Framework-aware form filling** — `safari_fill_and_submit` calls React/Vue/Angular setters natively, no guessing whether `input` events fired\n- **Background operation** — the agent works in parallel while you keep using your Mac\n- **One MCP call per workflow** — `safari_run_script` batches navigation + clicks + extraction into a single roundtrip\n\nThe pattern holds across models: **drive the browser the human already trusts** — you inherit logins, cookies, extensions, and the user's exact environment in one step.\n\n---\n\n## Community\n\n**6,000+ monthly npm downloads** — developers are building AI agents on macOS with Safari MCP.\n\n- [GitHub Discussions](https://github.com/achiya-automation/safari-mcp/discussions) — ask questions, share use cases\n- [Issues](https://github.com/achiya-automation/safari-mcp/issues) — bug reports and feature requests\n- [![Good First Issues](https://img.shields.io/github/issues/achiya-automation/safari-mcp/good%20first%20issue?color=7057ff\u0026label=good%20first%20issues)](https://github.com/achiya-automation/safari-mcp/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) — start contributing\n\n---\n\n## Ecosystem\n\nOther macOS MCP servers that complement Safari MCP:\n\n| Project | What it does | When to use |\n|---------|-------------|-------------|\n| [mcp-server-macos-use](https://github.com/mediar-ai/mcp-server-macos-use) | OS-level macOS automation (accessibility, screen control) | System-wide interactions beyond Safari |\n| [chrome-devtools-mcp](https://github.com/anthropics/chrome-devtools-mcp) | Chrome DevTools Protocol | Lighthouse audits, Chrome-specific performance traces |\n\n\u003e Using Safari MCP alongside Chrome DevTools MCP? Safari handles 95% of daily browsing (zero overhead), Chrome handles the 5% that needs Lighthouse or Chrome-specific traces.\n\n---\n\n## Like it? Give it a ⭐\n\nIf Safari MCP saves you from Chrome overhead, **a star helps others discover it:**\n\n[![Star this repo](https://img.shields.io/github/stars/achiya-automation/safari-mcp?style=social)](https://github.com/achiya-automation/safari-mcp)\n\n[Share on Twitter/X](https://twitter.com/intent/tweet?text=Safari%20MCP%20%E2%80%94%20Stop%20running%20Chrome%20just%20so%20your%20AI%20agent%20can%20browse.%2096%20tools%2C%20native%20Safari%2C%2060%25%20less%20CPU.\u0026url=https%3A%2F%2Fgithub.com%2Fachiya-automation%2Fsafari-mcp) · [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fachiya-automation%2Fsafari-mcp) · [Write about it](https://dev.to/)\n\n[![Star History Chart](https://api.star-history.com/svg?repos=achiya-automation/safari-mcp\u0026type=Date)](https://star-history.com/#achiya-automation/safari-mcp\u0026Date)\n\n---\n\n## Listed On\n\n[![Glama](https://glama.ai/mcp/servers/achiya-automation/safari-mcp/badges/score.svg)](https://glama.ai/mcp/servers/achiya-automation/safari-mcp) [![MCP Registry](https://img.shields.io/badge/MCP-Registry-purple)](https://registry.modelcontextprotocol.io/) [![MCP Scoreboard](https://mcpscoreboard.com/badge/05977769-8762-4e89-aff3-a0c5776843bb.svg)](https://mcpscoreboard.com/server/05977769-8762-4e89-aff3-a0c5776843bb/) [![CI](https://github.com/achiya-automation/safari-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/achiya-automation/safari-mcp/actions/workflows/ci.yml)\n\n---\n\n## License\n\nMIT — use it however you want.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachiya-automation%2Fsafari-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fachiya-automation%2Fsafari-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachiya-automation%2Fsafari-mcp/lists"}