MCPSafari
A native Safari MCP server for macOS that lets an agent work in the user's real, logged-in browser, including existing cookies, history and profiles, through an extension.
View on GitHub ↗- Stars
- ★ 70
- Last commit
- 30 Nov 2026
- Maintenance
- Active
- Licence
- MIT
- Category
- MCP Servers
- GitHub
- Epistates/
MCPSafari
Overview
MCPSafari is a Model Context Protocol server for Safari on macOS, built in Swift with a Manifest V3 Safari extension. An MCP-compatible client can open and drive tabs in the user's existing Safari session, on allowed sites, using the logins and cookies already in that profile.
The server can read a page, take an accessibility snapshot, click, type, fill forms, run JavaScript, capture screenshots, and read console and network activity. Several MCP clients can share one Safari at once, taking turns at the keyboard and pointer, and can work in separate windows or Safari profiles. Tab handles such as p0t5 name both the profile and the tab, so an agent can work in one profile while the user stays in another.
The README contrasts this with Safari 27's built-in MCP server, safaridriver --mcp, which Apple describes as a way for an agent to see how a site renders. MCPSafari is the option that stays in the user's existing windows, profiles and signed-in sessions, and only on sites where the extension has been granted access.
Background DOM tasks do not need native input. Hover styling, real keyboard events, and native clicks and drags need Safari in front. Native input waits until the keyboard and mouse have been left alone for 5 seconds, and native typing stops if the mouse is touched, so the agent does not fight the user for control.
The project is licensed under the MIT licence. It requires macOS 14 or later and Safari 17 or later. Xcode is needed only to build from source.
The current GitHub main branch is documented as 0.4.2. The latest published GitHub Release, and the Homebrew package, are still v0.3.2. The 0.3 and 0.4 lines do not interoperate, so the app and the mcp-safari server need to come from the same release. The README and tool reference describe main, which may include features not yet in the published release.
Features
- 28 tools on main, covering diagnostics, tabs, navigation, page reading, clicks and form filling, synthetic and native input, dialogs, screenshots, JavaScript, console and network logs, window size, cookies, and a short action batch (run_steps).
- Element targeting by snapshot UID, CSS, text or coordinates, including shadow DOM and iframes, with structured tool results as well as text.
- Support for every Safari profile, and a clear_cookies tool that can drop a site's cookies in a profile, subject to Safari's host-access rules.
- Several MCP clients at once, each starting its own mcp-safari server and taking turns at native input.
- mcp-safari doctor checks the installation, including mismatched app and server versions and extra copies of the extension, without changing anything.
Requirements
- macOS 14 (Sonoma) or later, and Safari 17 or later.
- Accessibility permission for native typing, key presses, clicks, hover and drag.
- An MCP client, such as Claude Code, Codex, Cursor, Windsurf, Claude Desktop, OpenCode or another MCP-compatible client.
- Extension access granted to each site the agent should use, or allowed on every website in a dedicated Safari profile.
- To build from source: Xcode, as described in the development guide.
Install
The published release, which Homebrew currently installs, is v0.3.2. The commands below are the project's recommended install. After Homebrew 6, a third-party formula has to be trusted first.
Trust the server formula and install the cask: brew trust --formula epistates/tap/mcp-safari-server, then brew install --cask epistates/tap/mcp-safari.
Open MCPSafari.app once so Safari picks up the extension, then enable MCPSafari Extension in Safari Settings, Extensions. The app does not need to stay open afterwards.
Grant site access from the MCPSafari toolbar button when a site has not yet been allowed (Always Allow on This Website).
Connect a client, for example claude mcp add --scope user mcp-safari mcp-safari, or codex mcp add mcp-safari -- mcp-safari. Other clients use a standard MCP config whose command is mcp-safari. Start a new client session after adding the server.
To upgrade, name both parts in full, server first: brew upgrade epistates/tap/mcp-safari-server, then brew upgrade --cask epistates/tap/mcp-safari. Reload the Safari tabs the agent will use, because open pages can keep the previous extension version until they are refreshed.
Manual install from a GitHub Release, and source builds, are documented in docs/setup.md and docs/development.md. Check the installed version against the release notes, because the docs on main may be ahead of the published package.
Example
Ask an agent: "Open example.com in a new Safari tab, read the page heading, and take a screenshot." The heading should be "Example Domain". If the connection fails, mcp-safari doctor checks the installation without changing it.
Works with
Listed in
- github.com/Epistates/MCPSafari
- github.com/Epistates/MCPSafari/blob/main/README.md
- github.com/Epistates/MCPSafari/blob/main/docs/setup.md
- github.com/Epistates/MCPSafari/blob/main/docs/tools.md
- github.com/Epistates/MCPSafari/releases
- github.com/Epistates/homebrew-tap
- webkit.org/blog/18136/introducing-the-safari-mcp-server-for-web-developers/
Read the code before you install anything. SwiftAgents doesn't review or endorse the tools listed here. Active: a commit in the last 90 days. Slowing: last commit within the past year. Stale: older than a year, or archived.
More in this category
Mobile MCP
Drives native mobile apps on simulators, emulators and real devices over MCP, for iOS and Android alike.
MobileBuildMCP
Sentry's MCP server and CLI for building, testing, running and debugging iOS and macOS projects from an agent. Formerly XcodeBuildMCP.
agent-device
Lets coding agents see and drive apps on iOS simulators and real devices (Android too) through accessibility snapshots, taps, typing and screenshots. Comes as a CLI, MCP server and Node API.
SwiftAgents