# Apple Safari

This MCP server lets an agent inspect Safari history, tabs, bookmarks, reading list, and page content. Browser writes stay off by default.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: mgcrea
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mgcrea/cupertino/tree/HEAD/packages/safari
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/apple-safari

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `APPLE_SAFARI_ALLOW_WRITES`, `APPLE_SAFARI_ALLOW_CODES`, `APPLE_SAFARI_ALLOW_NETWORK`, `APPLE_SAFARI_DOWNLOAD_DIR`, `APPLE_SAFARI_NETWORK_CHUNK_CHARS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
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-safari
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
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-safari
```
Replace <…> with your own values

## When to use it
- 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
- Search Safari history for visits matching `example` and show their dates.
- List the tabs currently open in Safari, including their URLs.
- Read the current Safari page and identify its available input fields.

## Similar
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32260
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23283
- [SeleniumBase MCP](https://affpapa.org/en/nevibecode/mcp/seleniumbase-mcp.md) — MCP server · ★ 13181
- [apify-mcp-server](https://affpapa.org/en/nevibecode/mcp/apify-mcp-server.md) — MCP server · ★ 13345

From the same set: [mgcrea/cupertino](https://affpapa.org/en/nevibecode/by/mgcrea/cupertino.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
