MCP Directory

How to add Safari MCP to Windsurf

Native Safari browser automation for AI agents on macOS — 80 tools, your real logged-in browser, no Chrome. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

Last updated June 14, 2026 · 116 · stdio · no auth

Windsurf config for Safari MCP

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

Setup steps

  1. 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the Safari MCP config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5Safari MCP's tools become available to Cascade.

Before you start

  • macOS (any version with Safari)
  • Node.js 18+
  • Safari → Settings → Advanced → Show features for web developers enabled
  • Safari → Develop → Allow JavaScript from Apple Events enabled
  • Automation → Safari permission granted to the MCP client's parent process (e.g. VS Code or Terminal)
  • Optional: Safari MCP extension (built via Xcode) for closed Shadow DOM, strict CSP, and framework-heavy editors

What Safari MCP can do in Windsurf

safari_navigate

Navigate to a URL (auto HTTPS, wait for load).

safari_go_back

Go back in browser history.

safari_go_forward

Go forward in browser history.

safari_reload

Reload the page (optional hard reload).

safari_read_page

Get the page title, URL, and text content.

safari_get_source

Get the full HTML source of the page.

safari_navigate_and_read

Navigate to a URL and read the page in one call.

safari_click

Click an element by CSS selector, visible text, or coordinates.

Security

Runs locally on macOS with no remote connections (stdio + localhost only) and no telemetry. The optional Safari extension communicates only with localhost:9224. Requires macOS system permissions: Automation → Safari (granted to the parent process running the MCP client, e.g. VS Code/Terminal), "Allow JavaScript from Apple Events" in Safari's Develop menu, Screen Recording (for screenshots), and Accessibility for safari-helper (for native CGEvent click/keyboard tools). The safari_evaluate tool runs arbitrary JavaScript in your real, logged-in Safari, so it has access to authenticated sessions.

Safari MCP + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the Safari MCP config there under the "mcpServers" key and restart the client.

Is Safari MCP safe to use with Windsurf?

Runs locally on macOS with no remote connections (stdio + localhost only) and no telemetry. The optional Safari extension communicates only with localhost:9224. Requires macOS system permissions: Automation → Safari (granted to the parent process running the MCP client, e.g. VS Code/Terminal), "Allow JavaScript from Apple Events" in Safari's Develop menu, Screen Recording (for screenshots), and Accessibility for safari-helper (for native CGEvent click/keyboard tools). The safari_evaluate tool runs arbitrary JavaScript in your real, logged-in Safari, so it has access to authenticated sessions.

Does Safari MCP work without installing the Safari extension?

Yes. Roughly 80% of functionality works through the AppleScript engine alone. The optional extension adds closed Shadow DOM access, strict-CSP bypass via the MAIN world, deeper framework state manipulation, and smart loading-state detection.

Is it cross-platform?

No. Safari MCP is macOS only, since it drives Safari via AppleScript/WebKit. It requires Node.js 18+ and enabling 'Allow JavaScript from Apple Events' in Safari's Develop menu.

Why does Automation permission need to be granted to my IDE rather than to safari-mcp?

macOS TCC grants Automation permission to the parent process that spawns the MCP server (e.g. VS Code or Terminal), not to safari-mcp itself. If the prompt doesn't appear, run `osascript -e 'tell application "Safari" to get URL of current tab of window 1'` once from a Terminal that already has Automation permission to register it.

View repo Full Safari MCP page