safari-mcp — Claude Code MCP server: Safari for your agent
An MCP server that lets your AI agent drive the real Safari on macOS: 98 tools, no Chrome, no Playwright, no headless.
claude mcp add safari-mcp -- npx -y safari-mcpWhat safari-mcp does
The server talks to Safari over Apple Events and runs native WebKit commands. Your agent opens tabs, clicks, fills forms, takes screenshots, reads network traffic and storage — inside the browser you are already logged into. Cookies and sessions stay yours, and Safari keeps running in the background without stealing the window.
There are 98 tools behind a single persistent osascript process, so a command lands in roughly 5 ms. No Puppeteer, Playwright or WebDriver in the dependency tree. Form filling on React, Vue, Angular and Svelte goes through native setters, which is why framework inputs actually receive the value.
Install is one command, npx safari-mcp, but two Safari settings have to be on first: “Show features for web developers” under Advanced and “Allow JavaScript from Apple Events” under Developer. Without the second one the server cannot push commands into the page. macOS and Node.js 20+ are required.
What it helps with
- walk a logged-in dashboard and pull data without signing in again
- fill a React form and confirm the submit went through
- capture a screenshot after a chain of clicks
- inspect network requests and grab a specific response
- check whether elements are reachable via the accessibility tree
Example prompts for the agent
- Open my GitHub tab in Safari and list the open pull requests
- Fill the order form on the current page and screenshot the result
- Check the network requests on this tab and show me which responses returned 404
How to install safari-mcp
Platform CLI
claude mcp add safari-mcp -- npx -y safari-mcpPlatform CLI
codex mcp add safari-mcp -- npx -y safari-mcpConfig file
{
"mcpServers": {
"safari-mcp": {
"command": "npx",
"args": [
"-y",
"safari-mcp"
]
}
}
}Config file
{
"servers": {
"safari-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"safari-mcp"
]
}
}
}Platform CLI
gemini mcp add safari-mcp npx -y safari-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about safari-mcp
How do I install safari-mcp in Claude Code?
Run claude mcp add safari-mcp -- npx -y safari-mcp. The server then shows up in your Claude MCP server list.
What does safari-mcp do?
It gives your agent 98 tools to control the real Safari on macOS: navigation, clicks, forms, screenshots, network, storage and accessibility. It runs in the background and keeps your logins and cookies.
What has to be enabled in Safari first?
Two settings: “Show features for web developers” under Advanced and “Allow JavaScript from Apple Events” under Developer. You also need macOS and Node.js 20+.