safari-mcp 2.16.1 → 2.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -10
- package/extension/background.js +638 -142
- package/extension/command-content.js +195 -0
- package/extension/manifest.json +24 -17
- package/glama.json +1 -1
- package/index.js +220 -51
- package/injected-escape.js +11 -1
- package/ownership-state.js +8 -0
- package/package.json +2 -2
- package/scripts/postinstall.cjs +9 -4
package/README.md
CHANGED
|
@@ -64,12 +64,27 @@ Native WebKit. ~60% less CPU. Background operation. 97 tools. One `npx` command.
|
|
|
64
64
|
|
|
65
65
|
---
|
|
66
66
|
|
|
67
|
+
## In users' own words
|
|
68
|
+
|
|
69
|
+
Not solicited testimonials — quotes lifted from the public issue tracker, each linked to the thread it came from.
|
|
70
|
+
|
|
71
|
+
> "I run multiple Pi sessions/subagents against my normal Safari profile in parallel. **Sharing its cookies and logins is intentional.**"
|
|
72
|
+
> — [@maxim](https://github.com/achiya-automation/safari-mcp/issues/76), on running concurrent agents against a real browser
|
|
73
|
+
|
|
74
|
+
> "The server has a deliberate tab-ownership model … **the code is careful about this, and for the default case that's the right safety posture.**"
|
|
75
|
+
> — [@turner-moore](https://github.com/achiya-automation/safari-mcp/issues/92), on why the guards refuse to touch your tabs
|
|
76
|
+
|
|
77
|
+
> "Direct local validation from the package: **Safari MCP doctor 6/6.**"
|
|
78
|
+
> — [@jrepp](https://github.com/achiya-automation/safari-mcp/pull/53), who found and fixed a queue-alignment bug in the focus helper
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
67
82
|
## Quick Start
|
|
68
83
|
|
|
69
84
|
### Prerequisites
|
|
70
85
|
|
|
71
86
|
- macOS (any version with Safari)
|
|
72
|
-
- Node.js
|
|
87
|
+
- Node.js 20+
|
|
73
88
|
- Safari → Settings → Advanced → **Show features for web developers** ✓
|
|
74
89
|
- Safari → Develop → **Allow JavaScript from Apple Events** ✓
|
|
75
90
|
|
|
@@ -553,7 +568,7 @@ Safari MCP runs locally on your Mac with minimal attack surface:
|
|
|
553
568
|
| Network | **No remote connections** — all communication is local (stdio + localhost) |
|
|
554
569
|
| Permissions | macOS system permissions required (Screen Recording for screenshots) |
|
|
555
570
|
| Data | No telemetry, no analytics, no data sent anywhere |
|
|
556
|
-
| Extension | Communicates only with `localhost:9224
|
|
571
|
+
| Extension | Communicates only with the local profile bridges (`localhost:9224/9228/9232/9236`), validated by Safari |
|
|
557
572
|
| Code | Fully open source (MIT) — audit every line |
|
|
558
573
|
|
|
559
574
|
---
|
|
@@ -683,23 +698,25 @@ The extension requires a one-time build with Xcode (free, included with macOS).
|
|
|
683
698
|
git clone https://github.com/achiya-automation/safari-mcp.git
|
|
684
699
|
cd safari-mcp
|
|
685
700
|
|
|
686
|
-
# 2. Build
|
|
701
|
+
# 2. Build a clean, Apple Development-signed app
|
|
702
|
+
# If needed, first choose your Team in Xcode → Signing & Capabilities.
|
|
687
703
|
xcodebuild -project "xcode/Safari MCP/Safari MCP.xcodeproj" \
|
|
688
|
-
-scheme "Safari MCP (macOS)" -configuration Release
|
|
704
|
+
-scheme "Safari MCP (macOS)" -configuration Release \
|
|
705
|
+
-allowProvisioningUpdates clean build
|
|
689
706
|
|
|
690
|
-
# 3.
|
|
691
|
-
# (xcodebuild without a signing identity produces a bundle Safari silently rejects)
|
|
707
|
+
# 3. Locate the signed app
|
|
692
708
|
APP_PATH=$(find ~/Library/Developer/Xcode/DerivedData/Safari_MCP-*/Build/Products/Release -name "Safari MCP.app" -maxdepth 2 | head -1)
|
|
693
|
-
codesign --sign - --force --deep "$APP_PATH"
|
|
694
709
|
|
|
695
710
|
# 4. Re-sign safari-helper with the Apple Events entitlement
|
|
696
711
|
# (helps macOS surface the TCC Automation prompt reliably)
|
|
697
712
|
codesign --sign - --force --entitlements safari-helper.entitlements safari-helper
|
|
698
713
|
|
|
699
|
-
#
|
|
714
|
+
# 5. Open the app (needed once so Safari registers the extension)
|
|
700
715
|
open "$APP_PATH"
|
|
701
716
|
```
|
|
702
717
|
|
|
718
|
+
> **Do not ad-hoc re-sign `Safari MCP.app` with `codesign --deep --sign -`.** That replaces the Apple Development identity on the wrapper and embedded extension; current Safari can then silently disable or mark the extension as removed. If a previous build was ad-hoc signed, run the `clean build` command above again.
|
|
719
|
+
|
|
703
720
|
Alternatively, open `xcode/Safari MCP/Safari MCP.xcodeproj` directly in Xcode, select your Apple ID under Signing & Capabilities, and click Run. A free personal Apple Developer account is sufficient for local use.
|
|
704
721
|
|
|
705
722
|
Then in Safari:
|
|
@@ -707,7 +724,7 @@ Then in Safari:
|
|
|
707
724
|
2. Safari → Develop → **Allow Unsigned Extensions** (required each Safari restart)
|
|
708
725
|
3. Safari → Settings → Extensions → enable **Safari MCP Bridge**
|
|
709
726
|
|
|
710
|
-
The extension connects automatically to the
|
|
727
|
+
The extension connects automatically to the first local bridge whose declared Safari profile matches its own. The default bridge ports are `9224`, `9228`, `9232`, and `9236`; a single-profile setup normally uses `9224`.
|
|
711
728
|
|
|
712
729
|
> **Note:** "Allow Unsigned Extensions" resets every time Safari restarts. You'll need to re-enable it in the Develop menu after each restart. The extension itself stays installed.
|
|
713
730
|
|
|
@@ -869,7 +886,7 @@ If Safari MCP saves you from Chrome overhead, **a star helps others discover it:
|
|
|
869
886
|
|
|
870
887
|
[](https://github.com/achiya-automation/safari-mcp)
|
|
871
888
|
|
|
872
|
-
[Share on Twitter/X](https://twitter.com/intent/tweet?text=Safari%20MCP%20%E2%80%94%20Stop%20running%20Chrome%20just%20so%20your%20AI%20agent%20can%20browse.%
|
|
889
|
+
[Share on Twitter/X](https://twitter.com/intent/tweet?text=Safari%20MCP%20%E2%80%94%20Stop%20running%20Chrome%20just%20so%20your%20AI%20agent%20can%20browse.%2097%20tools%2C%20native%20Safari%2C%2060%25%20less%20CPU.&url=https%3A%2F%2Fgithub.com%2Fachiya-automation%2Fsafari-mcp) · [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fachiya-automation%2Fsafari-mcp) · [Write about it](https://dev.to/)
|
|
873
890
|
|
|
874
891
|
[](https://star-history.com/#achiya-automation/safari-mcp&Date)
|
|
875
892
|
|