safari-mcp 2.1.2 → 2.1.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.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/index.js +14 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -17,6 +17,8 @@
17
17
 
18
18
  [Quick Start](#quick-start) · [All 80 Tools](#tools-80) · [Why Safari MCP?](#safari-mcp-vs-alternatives) · [Architecture](#architecture)
19
19
 
20
+ ![Safari MCP Demo](https://github.com/achiya-automation/safari-mcp/releases/download/v2.1.2/safari-mcp-showcase.gif)
21
+
20
22
  </div>
21
23
 
22
24
  ---
package/index.js CHANGED
@@ -12,6 +12,20 @@ import * as safari from "./safari.js";
12
12
  import { WebSocketServer } from "ws";
13
13
  import { createServer } from "node:http";
14
14
  import { randomUUID } from "node:crypto";
15
+ import { execFileSync } from "node:child_process";
16
+
17
+ // ========== SINGLETON: kill stale instances from previous sessions ==========
18
+ try {
19
+ const myPid = process.pid;
20
+ const lines = execFileSync("pgrep", ["-af", "node.*/safari-mcp/index\\.js"], { encoding: "utf8" }).trim().split("\n");
21
+ for (const line of lines) {
22
+ const pid = parseInt(line.split(/\s+/)[0], 10);
23
+ if (pid && pid !== myPid) {
24
+ try { process.kill(pid, "SIGTERM"); } catch {}
25
+ console.error(`[Safari MCP] Killed stale instance PID ${pid}`);
26
+ }
27
+ }
28
+ } catch {}
15
29
 
16
30
  // ========== SESSION ID (unique per MCP process — enables per-session tab tracking) ==========
17
31
  const SESSION_ID = randomUUID().slice(0, 8);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safari-mcp",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
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",