
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
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the Safari MCP config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 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_navigateNavigate to a URL (auto HTTPS, wait for load).
safari_go_backGo back in browser history.
safari_go_forwardGo forward in browser history.
safari_reloadReload the page (optional hard reload).
safari_read_pageGet the page title, URL, and text content.
safari_get_sourceGet the full HTML source of the page.
safari_navigate_and_readNavigate to a URL and read the page in one call.
safari_clickClick 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.