
How to add Safari MCP to Cursor
Native Safari browser automation for AI agents on macOS — 80 tools, your real logged-in browser, no Chrome. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 116★ · stdio · no auth
Cursor config for Safari MCP
npx safari-mcp{
"mcpServers": {
"safari-mcp": {
"command": "npx",
"args": [
"safari-mcp"
]
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the Safari MCP config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of Safari MCP's tools to confirm it's connected.
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 Cursor
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 + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Safari MCP config there under the "mcpServers" key and restart the client.
Is Safari MCP safe to use with Cursor?
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.