Safari MCP Server
Provides tools for controlling and automating the Safari browser, enabling visual web access, tab management, navigation, element interaction, and screenshots through Safari's automation interfaces.
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 MCP Server Navigate to example.com"
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 MCP Server
A MCP (Model Context Protocol) server for visual web access through Safari.
Features
Visual Web Access: Viewport screenshots for visual inspection
Full Authentication State: Operates on the user's actual Safari session with cookies preserved
Tab-Aware Targeting: Act operations target a captured working tab, observe operations follow the user's focus
Viewport Scrolling: Pixel amount or viewport-page index
Element Inspection: Tag, visibility, attributes, bounding rect for any CSS selector
Interaction Tools: Click, type, hover, select option
Wait Conditions: Selector to appear, disappear, or page text to render
Link Extraction: Anchor links as
{ text, href }pairsBrowser History: Back and forward navigation
Console Error Capture: Two-phase injection during and after page load
Prerequisites
macOS → System Settings → Desktop & Dock → Windows → "Prefer tabs when opening documents" option must be set to Always
macOS → System Settings → Privacy & Security → Screen & System Audio Recording → Terminal app must be enabled
Safari → Settings → Developer → Automation → "Allow JavaScript from Apple Events" option must be enabled
MCP Server Configuration
Add to mcp.json servers configuration:
{
"mcpServers": {
"safari": {
"command": "npx",
"args": ["-y", "@axivo/mcp-safari"],
"env": {
"SAFARI_WINDOW_HEIGHT": "1600"
}
}
}
}Environment Variables
All variables are optional:
SAFARI_PAGE_TIMEOUT- Page load and selector wait timeout, in milliseconds (default:10000)SAFARI_WINDOW_BOUNDS- Browser window margin offset from top-left corner, in pixels (default:20)SAFARI_WINDOW_HEIGHT- Browser window height, in pixels (default:1024)SAFARI_WINDOW_WIDTH- Browser window width, in pixels (default:1280)
Prompt Examples
"Open Safari and use
statustool for guidelines""Navigate to
example.com""Search for
example query""Take a screenshot of the current page"
"Read the page content to understand what's on the page"
"Click the 'Sign In' button"
"Type my email into the login form and submit"
"Refresh the page to see the latest changes"
"Go back to the previous page"
"Navigate forward two steps in browser history"
"Scroll down 500 pixels"
"Scroll to page 3 of this article"
"Search for 'Claude AI' and click the first result"
"List all open browser tabs"
"Open a new browser tab and go to
example.com""Switch to the first browser tab"
"Close the second browser tab"
"Inspect the submit button before clicking it"
"Hover over the Products menu"
"Choose 'Canada' in the country dropdown"
"Wait for the loading spinner to disappear"
"Read all links on this page"
The "use status tool" instruction helps Claude pause and process the _meta.usage guidelines before interacting with the browser.
MCP Tools
Call status first at session start to get the runtime state and full tool surface:
Act tools target a captured working tab
Observe tools target the front window's current tab
clickClick an element on the working tab
Type:
acttoolOptional inputs:
key(string): Key to press (e.g., Escape, ArrowRight, Enter, Tab)selector(string): CSS selector for the target elementtext(string): Visible text or aria-label to matchwait(string): CSS selector to wait for after clickx(number): X coordinate in pixelsy(number): Y coordinate in pixels
Returns: Result with change detection
closeClose the working tab
Type:
acttool
executeExecute JavaScript in the working tab
Type:
acttoolRequired inputs:
script(string): JavaScript code
hoverDispatch hover events to reveal hover-triggered UI
Type:
acttoolOptional inputs (one is required):
selector(string): CSS selector for the target elementtext(string): Visible text to match
inspectReturn element metadata for a CSS selector
Type:
observetoolRequired inputs:
selector(string): CSS selector for the target element
Optional inputs:
index(number): Tab index in the front window
Returns:
{ found, tag, text, visible, disabled, attributes, rect }
navigateNavigate the working tab to a URL or through history
Type:
acttoolOptional inputs (
urlordirectionrequired):direction(string:backorforward)selector(string): CSS selector to wait for after loadsteps(number, default: 1): Steps for history navigationurl(string): URL to navigate to
openOpen a blank tab as the working target
Type:
acttool
readGet page title, URL, and text or links from a tab
Type:
observetoolOptional inputs:
index(number): Tab index in the front windowmode(string:textorlinks, default:text)selector(string): CSS selector to scope extraction
refreshRefresh the working tab
Type:
acttoolOptional inputs:
hard(boolean, default: false): Bypass cacheselector(string): CSS selector to wait for after reload
screenshotCapture the Safari window, an element, the full page, or the screen
Type:
observetoolOptional inputs:
display(number): Display index forscreenmode, 1-based, defaults to the main displaymode(string:element,page,screen,window, default:window): Capture modeselector(string): CSS selector forelementmodesettle(number): Forpagemode, milliseconds to wait after each scroll for content to settle (default:500). Raise for slow dynamic sites, lower for static sites.share(boolean, default:false): Save to disk and return only the file path instead of the inline image
Returns: Inline base64 image when
shareisfalse, or{ path, width, height, mimeType, ... }whenshareistrue. Browser metadata{ innerHeight, scrollHeight, pages }is included for non-screenmodes.
scrollScroll by direction or to a viewport-page index
Type:
observetoolOptional inputs:
direction(string:upordown)page(number): Viewport-page index to scroll topixels(number): Pixels to scroll, paired withdirection
searchSearch using the browser's default engine
Type:
acttoolRequired inputs:
text(string): Search query
selectChoose an option in a
<select>elementType:
acttoolRequired inputs:
selector(string): CSS selector for the<select>
Optional inputs (one is required):
text(string): Option visible textvalue(string): Option value attribute
statusReturn current Safari tabs and full tool surface
Type:
observetoolReturns:
{ tabs, tools }
typeType text into an input field
Type:
acttoolRequired inputs:
text(string): Text to type
Optional inputs:
append(boolean, default: false): Append instead of replaceselector(string): CSS selector for the inputsubmit(boolean, default: false): Press Enter after typing
waitWait for selector or page text condition
Type:
observetoolOptional inputs (exactly one of the first three required):
selector(string): CSS selector to wait forselectorGone(string): CSS selector to wait absenttext(string): Page text to wait fortimeoutMs(number): Timeout in milliseconds
Returns:
{ matched, elapsedMs }
windowManage browser window tabs
Type:
observetoolRequired inputs:
action(string:close,list,open,switch)
Optional inputs:
index(number): Tab index forcloseandswitchurl(string): URL foropen
Available Tools
17 toolsclickCDestructive
Click an element on the browser window
Inputs: key, selector, text, wait, +2 more.
closeADestructiveIdempotent
Close the working tab
Inputs: no named parameters. Returns: closed
executeADestructive
Execute JavaScript in the browser context
Inputs: script (required).
hoverAIdempotent
Hover over an element to reveal hover-triggered UI
Inputs: selector, text.
inspectARead-onlyIdempotent
Inspect a page element by CSS selector
Inputs: selector (required), index. Returns: found, tag, text, visible, +3 more
openA
Open a blank tab as the working target
Inputs: no named parameters. Returns: opened
readARead-onlyIdempotent
Get the page title, URL, and either text content or anchor links
Inputs: index, mode, selector. Returns: title, url, text, links, +3 more
refreshBIdempotent
Refresh the current browser page
Inputs: hard, selector. Returns: title, url, innerHeight, scrollHeight, +4 more
screenshotARead-onlyIdempotent
Capture a screenshot of the browser window, an element, the full page, or the screen
Inputs: display, mode, selector, settle, +1 more.
scrollA
Scroll to specific viewport page or by direction with pixel amount
Inputs: direction, page, pixels. Returns: innerHeight, scrollHeight, scrollOffset, pages
searchA
Search the web using browser's default search engine
Inputs: text (required). Returns: title, url, innerHeight, scrollHeight, +3 more
selectADestructive
Choose an option in a element
Inputs: selector (required), text, value.
statusARead-onlyIdempotent
Get the current Safari tabs and the full tool surface with usage guidance
Inputs: no named parameters. Returns: tabs, tools
typeBDestructive
Type text into a page input field
Inputs: text (required), append, selector, submit.
waitARead-onlyIdempotent
Wait for a selector to appear, disappear, or text to appear
Inputs: selector, selectorGone, text, timeoutMs. Returns: matched, elapsedMs
windowCDestructive
Manage browser window tabs
Inputs: action (required), index, url. Returns: tabs
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool has a clearly distinct purpose: click, hover, select, type, scroll are all different interactions; navigate, open, close, refresh, window manage tabs/navigation; read, inspect, screenshot extract data; execute runs JS; wait adds synchronization. No overlapping tools.
All tool names are single lowercase words, predominantly verbs (click, navigate, type) with 'screenshot' as a slight exception but still consistent in style. No mixing of conventions.
17 tools is slightly above the ideal range of 3-15, but the set covers a wide range of browser actions without feeling bloated. Each tool serves a distinct need in web automation.
The tool set covers navigation, element interaction, information retrieval, execution, and basic synchronization. Missing advanced features like file upload or alert handling, but core workflows for browsing and testing are well-supported.
Maintenance
Related MCP Connectors
Hosted browser for agents: open pages, search the web, extract data, read PDFs and take screenshots.
A real browser for your agent: screenshots, page checks, Markdown and PDFs.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Give your agent eyes: screenshots of any web page it can see, pages as markdown, and PDFs.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides AI assistants with Safari browser automation and developer tools access, enabling LLMs to control Safari, access console logs, monitor network activity, and perform browser automation tasks.139 npm33MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to control a browser for web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to control a browser for web automation tasks such as navigation, typing, clicking, and taking screenshots.Apache 2.0
- AlicenseAqualityDmaintenanceLets your coding agent control and inspect a live Safari browser on macOS. Provides access to Safari DevTools for debugging, automation, and testing.4951 npm3MIT