Featured

Deploy OpenClaw in 60 seconds β€” 20% off logoDeploy OpenClaw in 60 seconds β€” 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger β†’
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger β†’
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free β†’
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now β†’
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data β€” no proxies, no parsers, no maintenance.

Start building free β†’
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it β€” secured from day one.

Get it set up for you β†’
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free β†’
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here β†’

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Lyosis/claudeForSafari MCP server](https://glama.ai/mcp/servers/Lyosis/claudeForSafari/badges/score.svg)](https://glama.ai/mcp/servers/Lyosis/claudeForSafari) πŸ“‡ 🏠 🍎 - Safari Web Extension + Node.js MCP bridge giving Claude Desktop full control over...

README.md

Claude for Safari

Gives Claude Desktop the ability to control Safari β€” navigate pages, read content, click elements, fill forms β€” via the MCP protocol, just like "Claude in Chrome".

![claudeForSafari MCP server](https://glama.ai/mcp/servers/Lyosis/claudeForSafari) ![claudeForSafari MCP server](https://glama.ai/mcp/servers/Lyosis/claudeForSafari)

Architecture

Claude Desktop  (MCP stdio)
      ↕  JSON-RPC
  bridge/bridge.js  (Node.js)
      ↕  WebSocket  ws://localhost:45678
Safari Extension background.js  (MV2)
      ↕  browser.tabs / executeScript
    Active Safari tab

---

Repository structure

claudeForSafari/                  ← git root
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
β”œβ”€β”€ bridge/                       ← Node.js bridge (MCP ↔ WebSocket)
β”‚   β”œβ”€β”€ bridge.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── package-lock.json
└── app/                          ← Xcode project
    β”œβ”€β”€ claudeExtension.xcodeproj
    β”œβ”€β”€ claudeExtension/          ← Swift host app (macOS)
    └── claudeExtension Extension/
        └── Resources/            ← SINGLE SOURCE for extension files
            β”œβ”€β”€ manifest.json
            β”œβ”€β”€ background.js
            β”œβ”€β”€ content.js
            β”œβ”€β”€ popup.html / popup.js / popup.css
            β”œβ”€β”€ images/
            └── _locales/

Rule: all extension file edits go directly in app/claudeExtension Extension/Resources/. There is no separate safari-extension/ folder.

---

Requirements

  • macOS 14+ (Sonoma or later)
  • Xcode 16+
  • Node.js v18+ β€” nodejs.org if not yet installed
  • An Apple developer account (free account is enough for local use)
  • Claude Desktop with MCP support

---

Installation

Step 1 β€” Clone the repository

git clone git@github.com:Lyosis/claudeForSafari.git
cd claudeForSafari

Step 2 β€” Install bridge dependencies

cd bridge
npm install
cd ..

Step 3 β€” Build the extension in Xcode

  1. Open app/claudeExtension.xcodeproj in Xcode
  2. Select the claudeExtension scheme (the host app)
  3. Choose My Mac as the destination
  4. Press Cmd+R β€” Xcode builds and launches 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

  1. Safari β†’ Settings (Cmd+,) β†’ Extensions tab
  2. Check claudeExtension
  3. In the right column β†’ Allow on all websites

Without this permission, script injection into pages will fail silently.

Step 5 β€” Configure Claude Desktop

Open (or create):

~/Library/Application Support/Claude/claude_desktop_config.json

Add the safari entry under mcpServers:

{
  "mcpServers": {
    "safari": {
      "command": "node",
      "args": [
        "/absolute/path/to/claudeForSafari/bridge/bridge.js"
      ]
    }
  }
}

Replace /absolute/path/to/ with the actual path where you cloned the repo.

If node is not in Claude Desktop's PATH, use its full path:

which node   # e.g. /usr/local/bin/node or /opt/homebrew/bin/node

Then restart Claude Desktop.

---

Usage

The bridge starts automatically with Claude Desktop. Safari must be open with the extension enabled.

The extension reconnects automatically to the bridge after sleep or after visiting Safari Settings β€” no manual action required.

---

Available tools (13)

| Tool | Description | |---|---| | 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 |

safari_form_input supports <input> and <textarea> fields. Rich text editors using contenteditable (Notion, Gmail compose, etc.) are not yet supported.

---

Troubleshooting

"Safari extension not connected"

  • Is Safari open? Is the extension checked in Safari β†’ Extensions?
  • Check the bridge is running: ps aux | grep bridge.js
  • Check logs: Console.app β†’ filter by claude-safari

Permission denied on script injection β†’ Safari β†’ Settings β†’ Extensions β†’ claudeExtension β†’ Allow on all websites

safari_get_page_text fails on an internal tab β†’ Internal Safari pages (favorites://, about:blank, etc.) cannot be injected. Navigate to an http:// or https:// URL first.

Bridge won't start β†’ Check Node.js: node -v (v18+ required) β†’ Use the absolute path to node in claude_desktop_config.json

Xcode β€” "No signing certificate" β†’ Xcode β†’ Settings β†’ Accounts β†’ add your Apple ID β†’ Download Manual Profiles

---

Security model

The bridge listens on ws://localhost:45678 β€” localhost only, never exposed to the network.

However, any local process can connect to that port. There is no cryptographic authentication between the bridge and the Safari extension. The threat model assumes that other processes running under your user account are trusted. If you run untrusted local software, be aware that it could theoretically connect to the bridge.

safari_javascript executes arbitrary JavaScript in the active tab by design. Treat it like browser DevTools β€” only use it on pages you trust.

Development

All extension file edits go in:

app/claudeExtension Extension/Resources/

After editing background.js or manifest.json:

  1. Rebuild in Xcode (Cmd+R)
  2. Safari β†’ Settings β†’ Extensions β†’ disable then re-enable the extension

(or restart Safari)

The bridge (bridge/bridge.js) does not need a rebuild β€” Node.js picks up changes on the next Claude Desktop restart.

---

License

MIT

See related servers & alternatives β†’

Related MCP servers

Browse all β†’

Related guides

Hand-picked reading to help you choose and use Browser & Scraping servers.