safari-mcp 2.7.16 โ 2.8.1
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 +58 -16
- package/index.js +22 -0
- package/package.json +5 -3
- package/scripts/postinstall.cjs +31 -0
package/README.md
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
[](https://opensource.org/licenses/MIT)
|
|
14
14
|
[](https://www.apple.com/macos/)
|
|
15
15
|
[](https://github.com/achiya-automation/safari-mcp/stargazers)
|
|
16
|
+
|
|
17
|
+
[](https://registry.modelcontextprotocol.io/)
|
|
18
|
+
[](https://glama.ai/mcp/servers/g0upg7gyex)
|
|
19
|
+
[](https://github.com/punkpeye/awesome-mcp-servers)
|
|
16
20
|
[](https://github.com/HKUDS/CLI-Anything/pull/212)
|
|
17
21
|
|
|
18
22
|
<a href="vscode:mcp/install?%7B%22safari-mcp%22%3A%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22safari-mcp%22%5D%7D%7D"><img src="https://img.shields.io/badge/VS_Code-Install_Server-0078d4?logo=visual-studio-code&logoColor=white" alt="Install in VS Code"></a>
|
|
@@ -121,6 +125,21 @@ cd safari-mcp && npm install
|
|
|
121
125
|
|
|
122
126
|
---
|
|
123
127
|
|
|
128
|
+
<div align="center">
|
|
129
|
+
|
|
130
|
+
### โญ Found Safari MCP useful?
|
|
131
|
+
|
|
132
|
+
**A star takes 2 seconds and helps other macOS developers discover this.**
|
|
133
|
+
|
|
134
|
+
[](https://github.com/achiya-automation/safari-mcp)
|
|
135
|
+
|
|
136
|
+
*4,000+ developers install Safari MCP every month. Less than 1% star it.*
|
|
137
|
+
*If it saves you Chrome heat, give it back a click.*
|
|
138
|
+
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
124
143
|
## Usage Workflow
|
|
125
144
|
|
|
126
145
|
The recommended pattern for AI agents using Safari MCP:
|
|
@@ -351,22 +370,32 @@ Safari MCP runs locally on your Mac with minimal attack surface:
|
|
|
351
370
|
|
|
352
371
|
> **Tip:** Use Safari MCP for daily browsing tasks (95% of work) and Chrome DevTools MCP only for Lighthouse/Performance audits.
|
|
353
372
|
|
|
354
|
-
### Safari MCP
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
|
359
|
-
|
|
360
|
-
|
|
|
361
|
-
|
|
|
362
|
-
|
|
|
363
|
-
|
|
|
364
|
-
|
|
|
365
|
-
|
|
|
366
|
-
|
|
|
367
|
-
|
|
|
368
|
-
|
|
|
369
|
-
|
|
|
373
|
+
### Why Safari MCP and Not the Other Safari MCP Projects?
|
|
374
|
+
|
|
375
|
+
There are several "safari-mcp" projects floating around. Here's how they compare:
|
|
376
|
+
|
|
377
|
+
| Feature | **๐ฆ safari-mcp** *(this repo)* | [lxman/safari-mcp-server](https://github.com/lxman/safari-mcp-server) | [Epistates/MCPSafari](https://github.com/Epistates/MCPSafari) | [HayoDev/safari-devtools-mcp](https://github.com/HayoDev/safari-devtools-mcp) |
|
|
378
|
+
|---------|:------------------------------:|:----------------------:|:------------:|:----------------------:|
|
|
379
|
+
| **Tools** | **80** | ~10 | 23 | ~15 |
|
|
380
|
+
| **Install** | `npx safari-mcp` | Manual | Binary | `npx` |
|
|
381
|
+
| **Engine** | **Dual** (Extension + AppleScript) | WebDriver | Extension only | DevTools Protocol |
|
|
382
|
+
| **Keeps your real Safari logins** | โ
Yes | โ ๏ธ Limited | โ
Yes | โ Debug session |
|
|
383
|
+
| **Background (no focus steal)** | โ
Yes | โ No | โ ๏ธ Sometimes | โ
Yes |
|
|
384
|
+
| **Storage tools** (cookies, localStorage, IndexedDB) | **10** | 0 | 0 | 2 |
|
|
385
|
+
| **Data extraction** (tables, meta, images, links) | **4** | 0 | 0 | 0 |
|
|
386
|
+
| **Network mocking** | โ
Yes | โ No | โ No | โ No |
|
|
387
|
+
| **Device emulation** (iPhone, iPad, Pixel) | โ
Yes | โ No | โ No | โ No |
|
|
388
|
+
| **File upload** (no dialog) | โ
JS DataTransfer | โ No | โ No | โ No |
|
|
389
|
+
| **Image paste** (no clipboard touch) | โ
Yes | โ No | โ No | โ No |
|
|
390
|
+
| **PDF export** | โ
Yes | โ No | โ No | โ No |
|
|
391
|
+
| **Console capture** | **4 tools** | 0 | 1 | 1 |
|
|
392
|
+
| **Performance metrics + Web Vitals** | โ
Yes | โ No | โ No | โ ๏ธ Partial |
|
|
393
|
+
| **Active maintenance** | โ
Multiple releases/week | ๐ก Sporadic | ๐ก Slow | ๐ก Slow |
|
|
394
|
+
| **License** | **MIT** | MIT | None specified | MIT |
|
|
395
|
+
| **In MCP Registry** | โ
| โ | โ | โ
|
|
|
396
|
+
| **In Awesome MCP** | โ
| โ | โ | โ |
|
|
397
|
+
|
|
398
|
+
> **TL;DR** โ if you want the most complete Safari MCP with the smoothest install, the most tools, and active maintenance, **this is the one**.
|
|
370
399
|
|
|
371
400
|
---
|
|
372
401
|
|
|
@@ -552,6 +581,19 @@ Your support funds:
|
|
|
552
581
|
|
|
553
582
|
---
|
|
554
583
|
|
|
584
|
+
## Ecosystem
|
|
585
|
+
|
|
586
|
+
Other macOS MCP servers that complement Safari MCP:
|
|
587
|
+
|
|
588
|
+
| Project | What it does | When to use |
|
|
589
|
+
|---------|-------------|-------------|
|
|
590
|
+
| [mcp-server-macos-use](https://github.com/mediar-ai/mcp-server-macos-use) | OS-level macOS automation (accessibility, screen control) | System-wide interactions beyond Safari |
|
|
591
|
+
| [chrome-devtools-mcp](https://github.com/anthropics/chrome-devtools-mcp) | Chrome DevTools Protocol | Lighthouse audits, Chrome-specific performance traces |
|
|
592
|
+
|
|
593
|
+
> Using Safari MCP alongside Chrome DevTools MCP? Safari handles 95% of daily browsing (zero overhead), Chrome handles the 5% that needs Lighthouse or Chrome-specific traces.
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
|
|
555
597
|
## Like it? Give it a โญ
|
|
556
598
|
|
|
557
599
|
If Safari MCP saves you from Chrome overhead, **a star helps others discover it:**
|
package/index.js
CHANGED
|
@@ -2159,6 +2159,28 @@ server.tool(
|
|
|
2159
2159
|
|
|
2160
2160
|
// ========== START SERVER ==========
|
|
2161
2161
|
|
|
2162
|
+
// One-time-per-day startup banner โ visible CTA without spamming MCP logs.
|
|
2163
|
+
// Stderr only (stdout is reserved for MCP protocol). Skipped if SAFARI_MCP_QUIET=1.
|
|
2164
|
+
try {
|
|
2165
|
+
if (process.env.SAFARI_MCP_QUIET !== "1") {
|
|
2166
|
+
const bannerStateFile = join(homedir(), ".safari-mcp", "last-banner");
|
|
2167
|
+
if (!existsSync(OWNERSHIP_DIR)) mkdirSync(OWNERSHIP_DIR, { recursive: true });
|
|
2168
|
+
let lastShown = 0;
|
|
2169
|
+
try { lastShown = parseInt(readFileSync(bannerStateFile, "utf8"), 10) || 0; } catch {}
|
|
2170
|
+
const ONE_DAY_MS = 24 * 60 * 60 * 1000;
|
|
2171
|
+
if (Date.now() - lastShown > ONE_DAY_MS) {
|
|
2172
|
+
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "package.json");
|
|
2173
|
+
let version = "?";
|
|
2174
|
+
try { version = JSON.parse(readFileSync(pkgPath, "utf8")).version; } catch {}
|
|
2175
|
+
console.error("");
|
|
2176
|
+
console.error(`[Safari MCP] ๐ฆ v${version} ready โ 80 tools, native WebKit, zero Chrome.`);
|
|
2177
|
+
console.error(`[Safari MCP] โญ Like it? Star: https://github.com/achiya-automation/safari-mcp`);
|
|
2178
|
+
console.error("");
|
|
2179
|
+
try { writeFileSync(bannerStateFile, String(Date.now()), { mode: 0o600 }); } catch {}
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
} catch { /* banner is best-effort, never block startup */ }
|
|
2183
|
+
|
|
2162
2184
|
_startMemoryMonitor();
|
|
2163
2185
|
const transport = new StdioServerTransport();
|
|
2164
2186
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "safari-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"mcpName": "io.github.achiya-automation/safari-mcp",
|
|
5
5
|
"description": "Safari browser automation for AI agents โ native macOS, zero Chrome overhead. 80 tools via AppleScript + JavaScript.",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"safari-mcp": "index.js"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"start": "node index.js"
|
|
13
|
+
"start": "node index.js",
|
|
14
|
+
"postinstall": "node scripts/postinstall.cjs || true"
|
|
14
15
|
},
|
|
15
16
|
"keywords": [
|
|
16
17
|
"safari",
|
|
@@ -67,7 +68,8 @@
|
|
|
67
68
|
"glama.json",
|
|
68
69
|
"LICENSE",
|
|
69
70
|
"README.md",
|
|
70
|
-
"index.d.ts"
|
|
71
|
+
"index.d.ts",
|
|
72
|
+
"scripts/postinstall.cjs"
|
|
71
73
|
],
|
|
72
74
|
"dependencies": {
|
|
73
75
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Safari MCP โ postinstall welcome message
|
|
3
|
+
// Skipped silently in CI and when stdout is not a TTY (npm install in scripts).
|
|
4
|
+
|
|
5
|
+
if (process.env.CI || process.env.SAFARI_MCP_SILENT_INSTALL === "1") process.exit(0);
|
|
6
|
+
|
|
7
|
+
const c = {
|
|
8
|
+
reset: "\x1b[0m",
|
|
9
|
+
bold: "\x1b[1m",
|
|
10
|
+
dim: "\x1b[2m",
|
|
11
|
+
cyan: "\x1b[36m",
|
|
12
|
+
yellow: "\x1b[33m",
|
|
13
|
+
magenta: "\x1b[35m",
|
|
14
|
+
green: "\x1b[32m",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const msg = `
|
|
18
|
+
${c.bold}${c.cyan}๐ฆ Safari MCP installed${c.reset} ${c.dim}โ 80 native browser tools for AI agents${c.reset}
|
|
19
|
+
|
|
20
|
+
${c.bold}Next steps:${c.reset}
|
|
21
|
+
1. Enable Safari โ Develop โ ${c.yellow}Allow JavaScript from Apple Events${c.reset}
|
|
22
|
+
2. Add to your MCP client config:
|
|
23
|
+
${c.dim}{ "mcpServers": { "safari": { "command": "npx", "args": ["safari-mcp"] } } }${c.reset}
|
|
24
|
+
|
|
25
|
+
${c.bold}${c.magenta}โญ Found this useful?${c.reset} A star helps others discover it:
|
|
26
|
+
${c.cyan}https://github.com/achiya-automation/safari-mcp${c.reset}
|
|
27
|
+
|
|
28
|
+
${c.dim}Docs ยท Examples ยท Issues โ github.com/achiya-automation/safari-mcp${c.reset}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
try { process.stdout.write(msg); } catch { /* ignore */ }
|