Purpose
claudeForSafari provides Claude Desktop with the ability to control Safari, enabling it to operate the browser like "Claude in Chrome": navigating pages, reading page content, clicking elements, filling out forms, and so on, with the entire process completed through the MCP protocol, without relying on Playwright or WebDriver.
Main Capabilities
According to the materials, the repository provides 13 available tools (apart from safari_form_input, safari_get_page_text, and safari_javascript, the specific tool names are not listed one by one in the materials). The functionality covers:
- Page navigation
- Reading page content
- Clicking elements
- Filling out forms
- Managing tabs
Form Input Limitations
safari_form_input supports <input> and <textarea> fields. Rich text editors based on contenteditable (such as Notion, the Gmail compose interface, etc.) are not currently supported.
JavaScript Execution
safari_javascript is designed to execute arbitrary JavaScript in the currently active tab and should be used only on trusted pages, just like using the browser developer tools.
Environment Requirements
- macOS 14+ (Sonoma or later)
- Node.js v18+ (if not installed, it can be obtained from nodejs.org)
- Apple Developer account (a free account is sufficient for local use)
- Claude Desktop that supports MCP
How to Use
Step 1 — Clone the repository
Clone the project locally.
Step 2 — Install bridge dependencies
Install the dependencies for the bridge.
Step 3 — Build the extension in Xcode
- Open app/claudeExtension.xcodeproj in Xcode
- Select the claudeExtension scheme (the host app)
- Select My Mac as the target
- Press Cmd+R — Xcode will build and launch the app
- macOS will show a banner: "claudeExtension wants to add a Safari extension" → click "Open Safari Preferences" and enable the extension
Step 4 — Enable the extension in Safari
- Safari → Settings (Cmd+,) → Extensions tab
- Check claudeExtension
- In the right column → Allow on All Websites
If this permission is not granted, injecting scripts into pages will silently fail.
Step 5 — Configure Claude Desktop
Open (or create) the Claude Desktop configuration file, add a safari entry under mcpServers, and replace /absolute/path/to/ with the actual clone path. If node is not in Claude Desktop's PATH, use its full path.
Then restart Claude Desktop. The bridge will start automatically with Claude Desktop, and Safari must remain open with the extension enabled. After sleep or after visiting Safari settings, the extension will automatically reconnect to the bridge without manual action.
Use Cases
- Automating web navigation and information reading in Safari
- Automatically clicking page elements and filling out ordinary form fields
- Letting Claude Desktop directly operate browser tabs through MCP
- Scenarios that require replacing Playwright/WebDriver with a Safari extension on macOS
Limitations and Security Notes
- The bridge listens on ws://localhost:45678, local only, and is not exposed to the network.
- Any local process can connect to this port, and there is no cryptographic authentication between the bridge and the Safari extension. The threat model assumes that other processes running under the same user account are trusted; if untrusted local software is running, note that it could in theory connect to the bridge.
- safari_javascript executes arbitrary JavaScript, so use it with the same caution as the browser developer tools.
- safari_get_page_text will fail on internal tabs (such as favorites://, about:blank, etc.) because scripts cannot be injected into internal Safari pages; you must first navigate to http:// or https:// address.
- The contenteditable-based rich text editor does not support form input.
Troubleshooting
- "Safari extension not connected": Confirm whether Safari is open and whether the extension is checked in Safari → Extensions; use ps aux | grep bridge.js to check whether the bridge is running; use Console.app filtered by claude-safari to view logs.
- Script injection permission denied: Safari → Settings → Extensions → claudeExtension → Allow on All Websites.
- The bridge fails to start: Check the Node.js version (node -v, requires v18+), and use the absolute path to node in claude_desktop_config.json.
- Xcode reports "No signing certificate": Add an Apple ID in Xcode → Settings → Accounts, and download Manual Profiles.
File editing rules
All extension file modifications are made directly in app/claudeExtension Extension/Resources/; there is no separate safari-extension/ folder. After modifying background.js or manifest.json, you need to rebuild in Xcode (Cmd+R), then disable and re-enable the extension in Safari → Settings → Extensions (or restart Safari). The bridge file bridge/bridge.js does not need to be rebuilt; Node.js will load the changes the next time Claude Desktop is restarted.
Information not yet provided
The materials do not explain the complete names and parameters of each of the 13 tools, the project license type, the specific version number, or more usage examples besides the GitHub address.