Apple Safari — Claude Code MCP server: what it does, install
This MCP server lets an agent inspect Safari history, tabs, bookmarks, reading list, and page content. Browser writes stay off by default.
claude mcp add --env APPLE_SAFARI_ALLOW_WRITES=<APPLE_SAFARI_ALLOW_WRITES> --env APPLE_SAFARI_ALLOW_CODES=<APPLE_SAFARI_ALLOW_CODES> --env APPLE_SAFARI_ALLOW_NETWORK=<APPLE_SAFARI_ALLOW_NETWORK> --env APPLE_SAFARI_DOWNLOAD_DIR=<APPLE_SAFARI_DOWNLOAD_DIR> --env APPLE_SAFARI_NETWORK_CHUNK_CHARS=<APPLE_SAFARI_NETWORK_CHUNK_CHARS> --transport stdio safari -- npx -y @mgcrea/mcp-apple-safariWhat Apple Safari does
The server connects an agent to Safari on macOS. It can search browsing history by text or date range, resolve a history item, list open tabs, inspect bookmarks, and show saved reading-list entries. For a live page, it can return captured text or HTML and describe elements that accept clicks or input.
The data comes through three separate access paths. History, bookmarks, and the reading list use Full Disk Access. Open tabs use Apple Events, a running Safari session, and an Automation grant. Page content uses the browser extension, which must be enabled and allowed on that site. Without Full Disk Access, the history and bookmark path cannot work.
Actions are disabled by default. APPLE_SAFARI_ALLOW_WRITES enables URL opening, clicks, typing, scrolling, and adding reading-list items. APPLE_SAFARI_ALLOW_CODES and APPLE_SAFARI_ALLOW_NETWORK separately enable one-time-code lookup and network capture. Passwords, card numbers, and CVC values are returned without their contents.
What it helps with
- search Safari history by text or date range
- list the tabs currently open in Safari
- read a page as captured text or HTML
- inspect bookmarks and unread reading-list items
- identify clickable and typeable elements on a live page
Example prompts for the agent
- Search Safari history for visits matching
exampleand show their dates. - List the tabs currently open in Safari, including their URLs.
- Read the current Safari page and identify its available input fields.
How to install Apple Safari
Platform CLI
claude mcp add --env APPLE_SAFARI_ALLOW_WRITES=<APPLE_SAFARI_ALLOW_WRITES> --env APPLE_SAFARI_ALLOW_CODES=<APPLE_SAFARI_ALLOW_CODES> --env APPLE_SAFARI_ALLOW_NETWORK=<APPLE_SAFARI_ALLOW_NETWORK> --env APPLE_SAFARI_DOWNLOAD_DIR=<APPLE_SAFARI_DOWNLOAD_DIR> --env APPLE_SAFARI_NETWORK_CHUNK_CHARS=<APPLE_SAFARI_NETWORK_CHUNK_CHARS> --transport stdio safari -- npx -y @mgcrea/mcp-apple-safariReplace <…> with your own values
Platform CLI
codex mcp add safari --env APPLE_SAFARI_ALLOW_WRITES=<APPLE_SAFARI_ALLOW_WRITES> --env APPLE_SAFARI_ALLOW_CODES=<APPLE_SAFARI_ALLOW_CODES> --env APPLE_SAFARI_ALLOW_NETWORK=<APPLE_SAFARI_ALLOW_NETWORK> --env APPLE_SAFARI_DOWNLOAD_DIR=<APPLE_SAFARI_DOWNLOAD_DIR> --env APPLE_SAFARI_NETWORK_CHUNK_CHARS=<APPLE_SAFARI_NETWORK_CHUNK_CHARS> -- npx -y @mgcrea/mcp-apple-safariReplace <…> with your own values
Config file
{
"mcpServers": {
"safari": {
"command": "npx",
"args": [
"-y",
"@mgcrea/mcp-apple-safari"
],
"env": {
"APPLE_SAFARI_ALLOW_WRITES": "<APPLE_SAFARI_ALLOW_WRITES>",
"APPLE_SAFARI_ALLOW_CODES": "<APPLE_SAFARI_ALLOW_CODES>",
"APPLE_SAFARI_ALLOW_NETWORK": "<APPLE_SAFARI_ALLOW_NETWORK>",
"APPLE_SAFARI_DOWNLOAD_DIR": "<APPLE_SAFARI_DOWNLOAD_DIR>",
"APPLE_SAFARI_NETWORK_CHUNK_CHARS": "<APPLE_SAFARI_NETWORK_CHUNK_CHARS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"safari": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mgcrea/mcp-apple-safari"
],
"env": {
"APPLE_SAFARI_ALLOW_WRITES": "<APPLE_SAFARI_ALLOW_WRITES>",
"APPLE_SAFARI_ALLOW_CODES": "<APPLE_SAFARI_ALLOW_CODES>",
"APPLE_SAFARI_ALLOW_NETWORK": "<APPLE_SAFARI_ALLOW_NETWORK>",
"APPLE_SAFARI_DOWNLOAD_DIR": "<APPLE_SAFARI_DOWNLOAD_DIR>",
"APPLE_SAFARI_NETWORK_CHUNK_CHARS": "<APPLE_SAFARI_NETWORK_CHUNK_CHARS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e APPLE_SAFARI_ALLOW_WRITES=<APPLE_SAFARI_ALLOW_WRITES> -e APPLE_SAFARI_ALLOW_CODES=<APPLE_SAFARI_ALLOW_CODES> -e APPLE_SAFARI_ALLOW_NETWORK=<APPLE_SAFARI_ALLOW_NETWORK> -e APPLE_SAFARI_DOWNLOAD_DIR=<APPLE_SAFARI_DOWNLOAD_DIR> -e APPLE_SAFARI_NETWORK_CHUNK_CHARS=<APPLE_SAFARI_NETWORK_CHUNK_CHARS> safari npx -y @mgcrea/mcp-apple-safariReplace <…> with your own values
Step 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 Apple Safari
How do I install Apple Safari in Claude Code?
Run claude mcp add mcp-apple-safari -- npx -y @mgcrea/mcp-apple-safari, then run `claude mcp add --env APPLE_SAFARI_ALLOW_WRITES=<APPLE_SAFARI_ALLOW_WRITES> --env APPLE_SAFARI_ALLOW_CODES=<APPLE_SAFARI_ALLOW_CODES> --env APPLE_SAFARI_ALLOW_NETWORK=<APPLE_SAFARI_ALLOW_NETWORK> --env APPLE_SAFARI_DOWNLOAD_DIR=<APPLE_SAFARI_DOWNLOAD_DIR> --env APPLE_SAFARI_NETWORK_CHUNK_CHARS=<APPLE_SAFARI_NETWORK_CHUNK_CHARS> --transport stdio safari -- npx -y @mgcrea/mcp-apple-safari`.
What does Apple Safari do?
It lets an agent inspect Safari history, bookmarks, reading-list entries, open tabs, and page content. With the relevant permissions enabled, it can also inspect page controls and perform browser actions.
Which permissions does Apple Safari need?
Full Disk Access is used for history and bookmarks. Open tabs require Safari to be running with Automation access, while page content requires the extension to be enabled for the target site.