← Back to directory
S

Safari MCP

Community
Drive the real Safari you are already logged into.
GitHub source repository ↗
★ 158 Stars Category · Browser Very popular
50FMRS · D
Reliability
8/20
Security and permissions
6/20
Maintenance
12/20
Documentation
13/20
Setup experience
11/20

Safari MCP is a community-maintained MIT-licensed server for stable Safari on macOS, offering 97 browser-automation tools over stdio. Its strengths are real-session reuse, background operation, and broad storage, network, console, extraction, and WebKit-validation coverage; its main limitations are macOS-only support and the need for several system permissions.

Read the FMRS scoring method →

Safari MCP is a macOS Safari browser-automation MCP server with 97 tools delivered through AppleScript and an optional Safari extension. It uses native WebKit, reuses the current Safari login state, cookies, and sessions, and can operate in the background. The Node.js npm package runs over stdio.

Tools

safari_navigate
Navigate to a URL.
safari_go_back
Go back in history.
safari_go_forward
Go forward in history.
safari_reload
Reload the page, optionally with a hard reload.
safari_read_page
Read the page title, URL, and text content.
safari_get_source
Get the full HTML source.
safari_navigate_and_read
Navigate and read the page.
safari_click
Click by CSS selector, visible text, or coordinates.
safari_double_click
Double-click an element.
safari_right_click
Right-click an element.
safari_hover
Hover over an element.
safari_click_and_wait
Click and wait for navigation.
safari_click_and_read
Click and return the updated page.
safari_fill
Fill an input with React, Vue, and Angular compatibility.
safari_clear_field
Clear an input field.
safari_select_option
Select a dropdown option.
safari_fill_form
Batch-fill multiple fields.
safari_fill_and_submit
Fill and submit a form.
safari_type_text
Type real keystrokes.
safari_press_key
Press a key with optional modifiers.
safari_react_select_set
Set a react-select v5 value through React fiber.
safari_react_select_list_options
List react-select v5 dropdown options.
safari_replace_editor
Replace all content in a code editor.
safari_verify_state
Verify an editor's framework-level state.
safari_screenshot
Capture a viewport or full-page PNG.
safari_screenshot_element
Capture a specific element.
safari_save_pdf
Export the page as a PDF.
safari_scroll
Scroll up or down by pixels.
safari_scroll_to
Scroll to an exact position.
safari_scroll_to_element
Smoothly scroll to an element.
safari_list_tabs
List all tabs.
safari_new_tab
Open a new background tab.
safari_close_tab
Close a tab.
safari_switch_tab
Switch tabs by index.
safari_wait_for_new_tab
Wait for a new tab and switch to it.
safari_wait_for
Wait for an element, text, or URL change.
safari_wait
Wait for a specified number of milliseconds.
safari_evaluate
Execute JavaScript and return the result.
safari_eval_file
Execute JavaScript from a file.
safari_get_element
Get an element's tag, rectangle, attributes, and visibility.
safari_query_all
Find all matching elements.
safari_get_computed_style
Get computed CSS styles.
safari_detect_forms
Automatically detect forms and field selectors.
safari_accessibility_snapshot
Get the full accessibility tree.
safari_snapshot
Get an accessibility tree with reference IDs for interactive elements.
safari_drag
Drag between elements or coordinates.
safari_upload_file
Upload a file through JavaScript DataTransfer.
safari_paste_image
Paste an image into an editor.
safari_handle_dialog
Handle alert, confirm, and prompt dialogs.
safari_resize
Resize the browser window.
safari_emulate
Emulate iPhone, iPad, Pixel, or Galaxy devices.
safari_reset_emulation
Reset to desktop mode.
safari_get_cookies
Get all cookies.
safari_set_cookie
Set a 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 or clear localStorage.
safari_session_storage
Read sessionStorage.
safari_set_session_storage
Write sessionStorage.
safari_delete_session_storage
Delete or clear sessionStorage.
safari_export_storage
Export all storage as JSON.
safari_import_storage
Import storage state from JSON.
safari_clipboard_read
Read clipboard text.
safari_clipboard_write
Write text to the clipboard.
safari_network
Make quick network requests through the Performance API.
safari_start_network_capture
Start capturing fetch and XHR requests.
safari_network_details
Get headers and timing for captured requests.
safari_clear_network
Clear captured requests.
safari_mock_route
Mock network responses and intercept fetch or XHR.
safari_clear_mocks
Remove all network mocks.
safari_start_console
Start capturing console messages.
safari_get_console
Get captured console messages.
safari_clear_console
Clear console messages.
safari_console_filter
Filter console messages by level.
safari_performance_metrics
Get navigation timing, Web Vitals, and memory metrics.
safari_throttle_network
Simulate slow networks or offline mode.
safari_extract_tables
Extract tables as structured JSON.
safari_extract_meta
Extract OG, Twitter, JSON-LD, and canonical metadata.
safari_extract_images
Extract images with dimensions and loading information.
safari_extract_links
Extract links with rel, external, and nofollow information.
safari_override_geolocation
Override browser geolocation.
safari_list_indexed_dbs
List IndexedDB databases.
safari_get_indexed_db
Read IndexedDB records.
safari_css_coverage
Find unused CSS rules.
safari_analyze_page
Analyze the full page in one call.
safari_doctor
Diagnose the macOS permission and daemon chain.
safari_reload_extension
Hot-reload the Safari MCP Bridge extension.
safari_run_script
Run multiple actions in one call.
safari_native_click
Send an OS-level mouse click.
safari_native_hover
Send an OS-level cursor hover.
safari_native_type
Insert text through the real paste pipeline.
safari_native_keyboard
Send OS-level keypresses to Safari.
safari_inspect_viewport
Validate the iOS Safari viewport meta tag.
safari_safe_area_insets
Read safe-area insets and viewport-fit usage.
safari_check_pwa
Audit iOS Add to Home Screen and PWA readiness.
safari_webkit_compat
Check Safari WebKit compatibility with CSS.supports.

Setup

Requires macOS, Node.js 18+, Safari's “Show features for web developers,” and Safari's “Allow JavaScript from Apple Events.” Run npx safari-mcp, or install with npm install -g safari-mcp or Homebrew. Add the supplied stdio configuration to an MCP client. The extension is optional; building it requires cloning the repository, installing Xcode, building and signing the project, then enabling Safari MCP Bridge in Safari. “Allow Unsigned Extensions” may need to be re-enabled after each Safari restart.

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

Fit and risk

Best for

  • AI coding agents running on macOS with Safari
  • Automation that must reuse real Safari logins, cookies, and sessions
  • Users who want background browser operation with lower additional CPU usage
  • Developers validating Safari, WebKit, or iOS pages

Not for

  • Non-macOS environments
  • Tasks requiring Chrome-specific debugging, Lighthouse, or performance tracing
  • Clean, isolated WebDriver sessions without the user's browser state
  • Users unwilling to grant Safari automation, screen-recording, or accessibility permissions

Required permissions

  • Safari: Allow JavaScript from Apple Events
  • macOS Automation access to Safari for the parent app running the MCP server
  • Screen Recording for screenshots
  • Accessibility for safari_native_* tools and safari_save_pdf

Risks and side effects

  • The tools can operate the real logged-in Safari and may access accounts, cookies, clipboard contents, and page data
  • safari_evaluate and related script tools can execute arbitrary JavaScript in the current page
  • Exported or imported storage may contain session information
  • Native input tools can produce real click, keyboard, and hover events in a non-frontmost Safari window
  • Automation of financial, social, or other sensitive sites should be reviewed before execution

Troubleshooting

  1. For AppleScript errors, enable Safari's Allow JavaScript from Apple Events
  2. For Apple Events authorization errors, grant Safari Automation access to the IDE or Terminal launching MCP
  3. For empty screenshots, grant Screen Recording to Terminal or VS Code
  4. If a tab is not found, call safari_list_tabs to refresh tab indexes
  5. If safari_native_* reports success but the page does not react, add and enable safari-helper under Accessibility
  6. If permissions disappear after npm update, rerun the source-provided osascript permission-trigger command
  7. For modern SPAs, closed Shadow DOM, or strict CSP sites, verify that the optional extension is installed and connected

Use cases

Automating browsing and page reading
Acting on already authenticated Gmail, GitHub, Slack, and other websites
Filling React, Vue, and Angular forms and code editors
Capturing screenshots, exporting PDFs, and extracting tables or metadata
Testing network behavior, console output, storage, performance, and WebKit compatibility

Supported clients

Claude CodeFull support
Claude DesktopFull support
CursorFull support
WindsurfPartial support
VS CodePartial support
ClinePartial support
ContinuePartial support
GoosePartial support
LM StudioPartial support
ZedPartial support