# Lyosis/claudeForSafari [Health: Active]

**Category:** 📂 Browser Automation  
**Repository:** https://github.com/Lyosis/claudeForSafari  
**GitHub Stars:** 1  
**Views:** 6  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/lyosis-claudeforsafari

## Description
Safari Web Extension + Node.js MCP bridge giving Claude Desktop full control over Safari — navigate, read pages, click elements, fill forms, and manage tabs. No Playwright or WebDriver dependency.

## Tools
Capabilities this server exposes over MCP:

- **safari_list_profiles** — List available Safari profiles
- **safari_navigate** — Navigate to a URL
- **safari_get_page_text** — Read the visible text of the current page
- **safari_read_page** — Get the full HTML of the current page
- **safari_javascript** — Execute arbitrary JavaScript
- **safari_find** — Find elements by CSS selector or text content
- **safari_click** — Click an element
- **safari_form_input** — Fill an `<input>` or `<textarea>` field
- **safari_scroll** — Scroll the page
- **safari_tabs_list** — List open tabs
- **safari_tabs_create** — Open a new tab
- **safari_tabs_close** — Close a tab
- **safari_tabs_switch** — Switch to a tab by ID

## Claude Desktop Quick Installation
Heuristic fallback — verify the package name and runner against the repository README before running it. Uses `npx` (confidence: low):

```json
"mcpServers": {
  "claudeforsafari": {
    "command": "npx",
    "args": ["-y","lyosis-claudeforsafari"]
  }
}
```

## Documentation

## What the Lyosis/claudeForSafari MCP server does

The Lyosis/claudeForSafari MCP server connects Claude Desktop to Safari. It exposes browser actions through MCP, allowing an agent to inspect pages, navigate between URLs, interact with page elements, and manage open tabs. The project is intended for macOS users who need Safari-specific browser control rather than automation through Playwright or WebDriver.

Available operations include listing Safari profiles, navigating to a URL, reading visible page text, retrieving the current page's HTML, running JavaScript, locating elements by CSS selector or text, clicking elements, entering values into inputs and textareas, scrolling, and listing, creating, closing, or switching tabs.

## How it works

Claude Desktop starts the Node.js bridge as an MCP stdio process. The bridge exchanges JSON-RPC messages with Claude Desktop and forwards browser requests through a WebSocket at `ws://localhost:45678`. The Safari extension receives those requests and uses Safari tab APIs and script execution to act on the active tab.

Safari must be open and the extension must be enabled. The extension reconnects to the bridge after sleep or after Safari Settings has been opened. Page script injection requires the extension's permission to run on all websites. Internal Safari pages such as `favorites://` and `about:blank` cannot be injected; an HTTP or HTTPS page is required for operations that depend on page injection.

## Setup and configuration

The Lyosis/claudeForSafari MCP server requires macOS 14 or later, Xcode 16 or later, Node.js 18 or later, an Apple developer account, and Claude Desktop with MCP support. A free Apple developer account is sufficient for local use.

Install the bridge dependencies from the repository's `bridge` directory with `npm install`. Open `app/claudeExtension.xcodeproj` in Xcode, select the `claudeExtension` scheme, choose My Mac, and run the host app. When macOS prompts to add the Safari extension, open Safari Preferences and enable it. In Safari Settings, open Extensions, enable `claudeExtension`, and allow it on all websites.

Add an `safari` entry to Claude Desktop's `claude_desktop_config.json`. Its command must invoke Node.js with the absolute path to `bridge/bridge.js`; use the full Node.js path if `node` is not available in Claude Desktop's PATH. Restart Claude Desktop after saving the configuration. The bridge then starts with the MCP client, provided Safari is running with the extension enabled.

## Tools and capabilities

The MCP tools cover four main areas:

- Inspecting pages with visible-text and full-HTML reads.
- Navigating, scrolling, finding, clicking, and running JavaScript.
- Filling standard `<input>` and `<textarea>` controls.
- Listing profiles and managing browser tabs.

`safari_javascript` can execute arbitrary JavaScript in the active tab. `safari_form_input` does not support rich-text editors based on `contenteditable`, including the examples noted in the project documentation such as Notion and Gmail compose.

## Limitations and notes

The Lyosis/claudeForSafari MCP server is designed for local Safari control. Its bridge listens only on localhost, but it has no cryptographic authentication, so any local process that can reach the port may connect. The security model assumes other processes under the same user account are trusted.

Because arbitrary JavaScript execution is available, use the tool only on pages and content you trust. If the extension is not connected, verify that Safari is open, the extension is enabled, and the bridge process is running. Changes to extension resources require rebuilding in Xcode and usually disabling and re-enabling the extension, while bridge changes take effect after Claude Desktop restarts. The project is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/lyosis-claudeforsafari/readme_

