Safari's built-in MCP server for AI coding agents Safari 27 ships a native Model Context Protocol server inside /usr/bin/safaridriver, a 167 KB binary that also runs as /usr/bin/safarimcp and exposes 17 tools to AI coding agents over stdio JSON-RPC, according to Flavio Copes' hands-on test on macOS 27.2.1 with Safari 27.2. The server requires users to enable 'Allow remote automation and external agents' in Safari's Developer settings, otherwise the MCP handshake and tool listing succeed but the first navigate_to_url call fails with WebDriverErrorDomain Code 6. Copes connected Claude Code, OpenAI Codex and Cursor via `claude mcp add safari-mcp -- "/usr/bin/safaridriver" --mcp` and compared the setup to Playwright MCP. Safari's built-in MCP server for AI coding agents By Flavio https://flaviocopes.com/about/ Tagged: AI https://flaviocopes.com/tags/ai/ Safari 27 ships with a native MCP server inside safaridriver. Here's how to enable it, connect Claude Code, Codex, or Cursor, inspect its 17 tools, and see how it compares to Playwright MCP. I saw a post on X by Florian Beer https://x.com/azath0th/status/2125918094438564220 pointing out something that flew completely under my radar: Safari now ships with its own built-in Model Context Protocol https://flaviocopes.com/what-is-mcp/ server. No npm package, no Node.js runtime, no separate Chromium download. Apple baked it straight into macOS starting with Safari 27 and Safari Technology Preview 247 , inside /usr/bin/safaridriver . I tested the binary directly on my Mac macOS 27.2.1, Safari 27.2 , probed its JSON-RPC handshake, and ran a live session against flaviocopes.com to see what works well and what still has rough edges. What’s already sitting in /usr/bin If you’re on macOS 27, the server is already on disk. Listing /usr/bin/safari on my Mac shows 2 symlinks pointing to the same 167 KB binary inside /System/Cryptexes/App/usr/bin/safaridriver : ls -l /usr/bin/safari php lrwxr-xr-x 1 root wheel 42 Nov 6 06:22 /usr/bin/safaridriver - /System/Cryptexes/App/usr/bin/safaridriver lrwxr-xr-x 1 root wheel 42 Nov 6 06:22 /usr/bin/safarimcp - /System/Cryptexes/App/usr/bin/safaridriver Running --version and --help shows the exact Safari build and the new --mcp flag along with -b, --bidi for WebDriver BiDi : /usr/bin/safaridriver --version /usr/bin/safaridriver --help Included with Safari 27.2 22625.2.8.11.9 Usage: safaridriver options -h, --help Prints out this usage information. --version Prints out version information and exits. -p, --port Port number the driver should use... -b, --bidi Port number the driver should use to listen for incoming WebSocket connections... --enable Applies configuration changes so that subsequent WebDriver sessions will run without further authentication. --diagnose Causes safaridriver to log diagnostic information... --mcp Run as an MCP Model Context Protocol server using stdio transport. Reads JSON-RPC from stdin, writes to stdout. There’s a nice detail the official docs don’t mention. You can run /usr/bin/safarimcp directly without passing --mcp . Both commands invoke the same binary, and calling it as safarimcp drops you directly into JSON-RPC over stdin and stdout. How to turn it on and connect an agent Before any agent can open a page, Safari requires an explicit opt-in inside its settings: 1. Open Safari Settings Advanced and check Show features for web developers . 2. Open Safari Settings Developer and check Allow remote automation and external agents or run safaridriver --enable in Terminal . Be careful with that second checkbox. If you leave it unchecked, /usr/bin/safaridriver --mcp still boots up, performs the MCP handshake, and lists all 17 tools to your agent. Everything seems to work, until the first navigate to url call fails with this error: Error Domain=WebDriverErrorDomain Code=6 "Could not create a session: You must enable 'Allow remote automation' in the Developer section of Safari Settings to control Safari via WebDriver." Once the toggle is on, register the server with your agent. For Claude Code https://flaviocopes.com/claude-code-guide/ which I explain in the Claude Code Handbook https://flaviocopes.com/ebooks/claude-code-handbook/ : claude mcp add safari-mcp -- "/usr/bin/safaridriver" --mcp For OpenAI Codex https://flaviocopes.com/codex/ covered in the OpenAI Codex Handbook https://flaviocopes.com/ebooks/codex-handbook/ : codex mcp add safari-mcp -- "/usr/bin/safaridriver" --mcp For Cursor https://flaviocopes.com/cursor/ or any other client that reads mcp.json : { "mcpServers": { "safari-mcp": { "command": "/usr/bin/safaridriver", "args": "--mcp" } } } If you’re testing with Safari Technology Preview version 247 or later , point command at "/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver" with the same --mcp argument. When your agent runs its first navigation prompt, Safari opens a window with a banner right below the toolbar saying "This window is controlled by