safari-browser-mcp
Drives the user's real Safari browser on macOS, allowing tabs to be listed, created, selected and closed; pages to be navigated, read as text or outlined with stable element refs; and interactions such as clicking, filling forms, pressing keys, scrolling, running JavaScript and capturing window screenshots.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@safari-browser-mcp Open a new tab, search Hacker News for MCP, and summarize the top three results."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
safari-browser-mcp
Let Claude drive Safari the way Claude in Chrome drives Chrome.
This is an MCP server for macOS. Hook it up to Claude Code, the Claude desktop app or any other MCP client, and Claude can open tabs, read pages, click, fill forms, press keys, run JavaScript and take screenshots in your real Safari, with your real sign-ins.
Unofficial community project. Not affiliated with or endorsed by Anthropic or Apple.
How it works
Claude in Chrome is a Chrome extension. Safari can't run it, but Safari has a built-in scripting interface, so this server controls Safari from the outside:
Tabs and navigation go through Safari's JavaScript for Automation API (
osascript -l JavaScript).Reading and interacting with pages uses Safari's
do JavaScriptto run small scripts inside the tab. Elements get stableref_Nids so Claude can click or type into them later.Screenshots use
screencaptureon the Safari window.Key presses use System Events.
No browser extension and no Safari WebDriver session is needed. Claude works in the Safari you already have open.
Related MCP server: Browser Agent MCP Server
Tools
Tool | What it does |
| List open tabs ( |
| Open a new tab, optionally at a URL |
| Bring a tab to the front / close it |
| Load a URL, or |
| Readable text of the page |
| Outline of the page with |
| Search elements by role, name or text |
| Click by ref or CSS selector |
| Set inputs, textareas, selects, checkboxes; optionally submit |
| Real key presses, e.g. |
| Scroll the page or scroll an element into view |
| Run JS in the page ( |
| PNG of the Safari window |
Every page tool takes an optional tab. Without it, it uses the active tab of the front window.
Setup
Requires macOS and Node.js 18 or newer.
git clone https://github.com/riguillen1972/safari-browser-mcp.git
cd safari-browser-mcp
npm install1. Let Safari run JavaScript from automation
Safari > Settings > Advanced > turn on Show features for web developers.
In the menu bar: Develop > Allow JavaScript from Apple Events.
2. Add it to Claude
Claude Code:
claude mcp add safari -- node /absolute/path/to/safari-browser-mcp/src/index.jsClaude desktop app: add this to ~/Library/Application Support/Claude/claude_desktop_config.json, then restart the app:
{
"mcpServers": {
"safari": {
"command": "node",
"args": ["/absolute/path/to/safari-browser-mcp/src/index.js"]
}
}
}3. Approve the macOS prompts
The first time Claude uses it, macOS asks for permission for the app that runs the server (Terminal, iTerm, Claude, …):
Permission | Needed for | Where |
Automation → Safari | everything | prompted automatically |
Screen Recording |
| System Settings > Privacy & Security |
Accessibility |
| System Settings > Privacy & Security |
Check it works
With Safari open:
npm run smokeIt prints the tool list and your open tabs.
Try it
Open a new Safari tab, search Hacker News for "MCP" and summarise the top three results.
In my current Safari tab, fill in the contact form with test data but don't submit it.
Limits
clickandform_inputdispatch DOM events. They work on almost all sites, but a site that checksevent.isTrustedwill ignore them. Usepress_keyorjavascriptas a fallback.Pages inside cross-origin iframes can't be read or controlled.
screenshotandpress_keybring Safari to the front.Private windows can't be scripted.
Safety
Claude acts as you, in your signed-in browser. Watch what it does, keep sensitive tabs closed, and don't let it act on instructions it reads on web pages.
License
MIT
Available Tools
14 toolsclickB
Click an element by ref (from read_page/find) or CSS selector.
Inputs: ref, tab, selector.
findB
Find visible elements whose role/name/text contains the query. Returns up to 20 refs.
Inputs: query (required), tab.
form_inputB
Set the value of an input, textarea, select, checkbox or contenteditable. Optionally submit its form.
Inputs: value (required), ref, tab, submit, +1 more.
get_page_textB
Get the readable text of the page (main/article first, else body).
Inputs: tab, max_chars.
javascriptA
Run JavaScript in the page. Write a function body and return the value you want (await is allowed). Result is JSON-serialised.
Inputs: code (required), tab, timeout_ms.
press_keyA
Send real key presses to Safari, e.g. "Return", "Tab", "cmd+l", "shift+tab". Needs Accessibility permission.
Inputs: key (required), repeat.
read_pageB
Read the page as an outline. Interactive elements get [ref_N] ids usable with click / form_input / scroll.
Inputs: tab, filter, max_chars.
screenshotA
Screenshot the Safari window (brings it to the front). Needs Screen Recording permission.
Inputs: tab.
scrollB
Scroll the page by ticks in a direction, or scroll an element (ref) into view.
Inputs: ref, tab, amount, direction.
tabs_closeC
Close a tab.
Inputs: tab (required).
tabs_createA
Open a new Safari tab (optionally at a URL) and make it active.
Inputs: url.
tabs_listA
List every open Safari tab with its id, title and URL.
Inputs: no named parameters.
tabs_selectC
Bring a tab to the front.
Inputs: tab (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Tab lifecycle tools (tabs_*) are cleanly separated from page-interaction tools, and click/find/read_page have clear distinct roles. Minor overlaps exist: get_page_text vs read_page both return page content, find returns refs like read_page does, and tabs_create can open a URL that navigate also handles, but descriptions make the intended split reasonably clear.
Everything is snake_case, with a coherent noun_verb grouping for tab operations (tabs_list, tabs_create, tabs_select, tabs_close). The rest are bare verbs (navigate, click, find, scroll, screenshot), which is a deviation from the verb_noun pattern but is a systematic and readable split between tab management and page actions.
14 tools is squarely in the well-scoped range for a browser automation server. Each tool maps to a distinct capability (tab control, navigation, reading, interaction, scripting, capture) with no obvious redundancy.
Covers the full loop of tab management, navigation, reading (text/outline/find), interaction (click, form_input, press_key, scroll), JS execution, and screenshots. Minor gaps remain: no explicit wait-for-load tool, no hover, and no history/cookie or window management, though javascript can work around some of these.
Maintenance
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Hosted browser for agents: open pages, search the web, extract data, read PDFs and take screenshots.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Let AI agents use your real, signed-in Chrome: tabs, clicks, forms, screenshots and video.
Related MCP Servers
- AlicenseAqualityBmaintenanceSafari Web Extension + Node.js MCP bridge giving Claude Desktop full control over Safari — navigate, read pages, click elements, fill forms, and manage tabs. No Playwright or WebDriver dependency.4131MIT
- FlicenseNot gradedqualityDmaintenanceProvides browser automation capabilities through Claude Desktop and other MCP clients, enabling navigation, screenshot capture, content extraction, and interactive control.-
- AlicenseNot gradedqualityCmaintenanceMCP server that drives the user's real signed-in Chrome on macOS via AppleScript (Apple Events). 32 tools covering tab/window control, navigation, DOM extraction, form interaction, and arbitrary JS execution. Same engine as the familiar Claude Code skill in the repository.1MIT
- AlicenseBqualityCmaintenanceEnables AI agents to control the user's real Safari on macOS, reading pages, taking screenshots, clicking, typing, and recording GIFs, with a per-host read-only policy and prompt-injection safeguards.21MIT