能力标签
Safari MCP
🔌
MCP工具

Safari MCP

基于 JavaScript · 让 AI 助手直接操作你的系统与工具
英文名:safari-mcp
⭐ 93 Stars 🍴 13 Forks 💻 JavaScript 📄 MIT 🏷 AI 7.5分
7.5AI 综合评分
ai-agentsapple-siliconapplescriptautomation
✦ AI Skill Hub 推荐

经 AI Skill Hub 精选评估,Safari MCP 获评「推荐使用」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。

📚 深度解析
Safari MCP 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 Safari MCP,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。Safari MCP 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 Safari MCP 评为 AI 评分 7.5 分,属于同类工具中的优质选择。
📋 工具概览

Safari MCP 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 93
开发语言
JavaScript
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
MIT
AI 综合评分
7.5 分
工具类型
MCP工具
Forks
13
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

Safari MCP 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/achiya-automation/safari-mcp

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "safari-mcp": {
      "command": "npx",
      "args": ["-y", "safari-mcp"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 Safari MCP 执行以下任务...
Claude: [自动调用 Safari MCP MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "safari_mcp": {
      "command": "npx",
      "args": ["-y", "safari-mcp"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 88/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

<img src="social-preview.png" alt="Safari MCP Server — 80 native browser automation tools for AI agents on macOS" width="100%">

<br/>

Highlights

  • 80 tools — navigation, clicks, forms, screenshots, network, storage, accessibility, and more
  • Zero heat — native WebKit on Apple Silicon, ~60% less CPU than Chrome
  • Your real browser — keeps all logins, cookies, sessions (Gmail, GitHub, Ahrefs, etc.)
  • Background operation — Safari stays in the background, no window stealing
  • No browser dependencies — no Puppeteer, no Playwright, no WebDriver, no Chrome
  • Persistent process — reuses a single osascript process (~5ms per command vs ~80ms)
  • Framework-compatible — React, Vue, Angular, Svelte form filling via native setters

---

Prerequisites

  • macOS (any version with Safari)
  • Node.js 18+
  • Safari → Settings → Advanced → Show features for web developers
  • Safari → Develop → Allow JavaScript from Apple Events

Granting Accessibility to safari-helper (required for `safari_native_*`)

The safari_native_click, safari_native_keyboard and safari_native_hover tools inject OS-level CGEvent events into Safari without stealing focus. macOS requires the underlying helper binary to be approved in Accessibility before those events can reach a non-frontmost window.

1. Open System Settings → Privacy & Security → Accessibility. 2. Click + (unlock with your password if needed). 3. Navigate to the helper binary and add it: - npm global install: $(npm root -g)/safari-mcp/safari-helper - npx / project install: ./node_modules/safari-mcp/safari-helper - From source clone: /path/to/safari-mcp/safari-helper 4. Make sure the toggle next to it is ON.

The postinstall script re-signs the helper with a stable identifier (com.achiya-automation.safari-mcp) so this permission survives future upgrades — without that step, every npm update would silently revoke approval because the binary's adhoc-signed identifier changes per build.

If safari_native_click reports success but the page doesn't react (no isTrusted: true click events fire), the helper is most likely missing this approval. The safari_* (non-native_) tools don't need it.

Install (one command)

npx safari-mcp

That's it — no global install needed. Or install permanently:

npm install -g safari-mcp

Installing the Extension

The extension requires a one-time build with Xcode (free, included with macOS).

Note for npm users: The xcode/ directory is not included in the npm package. Clone the GitHub repository to build from source.

Prerequisites: Xcode (install from App Store — free)

```bash

2. Build the extension

xcodebuild -project "xcode/Safari MCP/Safari MCP.xcodeproj" \ -scheme "Safari MCP (macOS)" -configuration Release build

(xcodebuild without a signing identity produces a bundle Safari silently rejects)

APP_PATH=$(find ~/Library/Developer/Xcode/DerivedData/Safari_MCP-*/Build/Products/Release -name "Safari MCP.app" -maxdepth 2 | head -1) codesign --sign - --force --deep "$APP_PATH"

Quick Start

Usage Workflow

The recommended pattern for AI agents using Safari MCP:

1. safari_snapshot        → Get page state (accessibility tree)
2. safari_click/fill/...  → Interact with elements by ref
3. safari_snapshot        → Verify the result

Element targeting — tools accept multiple targeting strategies:

StrategyExampleBest for
CSS selector#login-btn, .submitUnique elements
Visible text"Sign In", "Submit"Buttons, links
Coordinatesx: 100, y: 200Canvas, custom widgets
Ref from snapshotref: "e42"Any element from accessibility tree
Tip: Start with safari_snapshot to get element refs, then use refs for precise targeting. This is faster and more reliable than CSS selectors.

---

Screenshots & PDF (3)

ToolDescription
safari_screenshotScreenshot as PNG (viewport or full page)
safari_screenshot_elementScreenshot a specific element
safari_save_pdfExport page as PDF

Configure your MCP client

All clients run Safari MCP the same way — npx safari-mcp. Pick your editor:

<details> <summary><b>Claude Code</b></summary>

claude mcp add safari -- npx safari-mcp

Or edit ~/.mcp.json:

{
  "mcpServers": {
    "safari": {
      "command": "npx",
      "args": ["safari-mcp"]
    }
  }
}
</details>

<details> <summary><b>Claude Desktop</b></summary>

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

{
  "mcpServers": {
    "safari": {
      "command": "npx",
      "args": ["safari-mcp"]
    }
  }
}

Restart Claude Desktop after saving. </details>

<details> <summary><b>Cursor</b></summary>

One-click: Install in Cursor

Or edit .cursor/mcp.json in your project:

{
  "mcpServers": {
    "safari": {
      "command": "npx",
      "args": ["safari-mcp"]
    }
  }
}
</details>

<details> <summary><b>VS Code / VS Code Insiders</b></summary>

One-click: Install in VS Code

Or edit .vscode/mcp.json:

{
  "servers": {
    "safari": {
      "type": "stdio",
      "command": "npx",
      "args": ["safari-mcp"]
    }
  }
}
</details>

<details> <summary><b>Windsurf</b></summary>

Edit .windsurf/mcp.json in your project (or ~/.codeium/windsurf/mcp_config.json globally):

{
  "mcpServers": {
    "safari": {
      "command": "npx",
      "args": ["safari-mcp"]
    }
  }
}
</details>

<details> <summary><b>Cline</b></summary>

Open Cline in VS Code → click the MCP icon → Edit MCP Settings → add:

{
  "mcpServers": {
    "safari": {
      "command": "npx",
      "args": ["safari-mcp"]
    }
  }
}
</details>

<details> <summary><b>Continue</b></summary>

Edit ~/.continue/config.yaml (or .continue/config.yaml in workspace):

mcpServers:
  - name: safari
    command: npx
    args:
      - safari-mcp
</details>

<details> <summary><b>Goose</b></summary>

Edit ~/.config/goose/config.yaml:

extensions:
  safari:
    name: safari
    type: stdio
    cmd: npx
    args:
      - safari-mcp
    enabled: true
</details>

<details> <summary><b>LM Studio</b></summary>

Open LM Studio → SettingsMCP ServersAdd Server:

- Name: safari - Command: npx - Args: safari-mcp </details>

<details> <summary><b>Zed</b></summary>

Open Zed → Settings → search for "Context Servers" and add:

{
  "context_servers": {
    "safari": {
      "command": {
        "path": "npx",
        "args": ["safari-mcp"]
      }
    }
  }
}
</details>

<details> <summary><b>Alternative: Homebrew</b></summary>

brew install achiya-automation/tap/safari-mcp
</details>

<details> <summary><b>Alternative: from source</b></summary>

git clone https://github.com/achiya-automation/safari-mcp.git
cd safari-mcp && npm install
</details>

---

Safari Extension (Optional)

The Safari MCP Extension is optional but recommended. Without it, ~80% of functionality works via AppleScript alone. The extension adds capabilities that AppleScript cannot provide:

What the Extension Adds

CapabilityWith ExtensionAppleScript Only
Closed Shadow DOM (Reddit, Web Components)✅ Full access❌ Invisible
Strict CSP sites✅ Bypasses via MAIN world❌ Often blocked
React/Vue/Angular state manipulation✅ Deep (Fiber, ProseMirror)⚠️ Basic
Loading state detection (spinners, skeletons)✅ Smart detection❌ No
Dialog handling (alert/confirm)✅ Only AppleScript
Native OS-level click (CGEvent)✅ Only AppleScript
PDF export✅ Only AppleScript
When do you need the extension? If you're automating modern SPAs with closed shadow DOM (e.g., Reddit), sites with strict Content Security Policy, or framework-heavy editors (Draft.js, ProseMirror, Slate).

1. Clone the repo (the npm package does not include the Xcode project)

git clone https://github.com/achiya-automation/safari-mcp.git cd safari-mcp

4. Open the app (needed once so Safari registers the extension)

open "$APP_PATH" ```

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.

Then in Safari: 1. Safari → Settings → Advanced → enable Show features for web developers 2. Safari → Develop → Allow Unsigned Extensions (required each Safari restart) 3. Safari → Settings → Extensions → enable Safari MCP Bridge

The extension connects automatically to the MCP server on port 9224.

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.

Toolbar icon status: - ON — connected to MCP server - OFF — manually disabled via popup - (no badge) — server not running, will auto-reconnect

---

Safari MCP vs Alternatives

FeatureSafari MCPChrome DevTools MCPPlaywright MCP
CPU/Heat🟢 Minimal🔴 High🟡 Medium
Your logins✅ Yes✅ Yes❌ No
macOS native✅ WebKit❌ Chromium❌ Chromium/WebKit
Browser dependenciesNoneChrome + debug portPlaywright runtime
Tools80~30~25
File uploadJS (no dialog)CDPPlaywright API
Image pasteJS (no clipboard)CDPPlaywright API
Focus steal❌ Background❌ Background❌ Headless
Network mocking
Lighthouse
Performance trace
Tip: Use Safari MCP for daily browsing tasks (95% of work) and Chrome DevTools MCP only for Lighthouse/Performance audits.

Troubleshooting

IssueFix
"AppleScript error"Enable "Allow JavaScript from Apple Events" in Safari → Develop
"Not authorized to send Apple events to Safari"Grant Automation → Safari to your IDE (see above)
"Not authorized" after npm updateUpdating changes the binary's cdhash — macOS silently revokes Automation permission. Re-run the osascript one-liner above to re-grant it
safari_native_click reports success but page doesn't reactAdd safari-helper to **System Settings → Privacy & Security → Accessibility** (see [Granting Accessibility](#granting-accessibility-to-safari-helper-required-for-safari_native_) above). Confirm by attaching a click listener with {capture:true} in the page console — without the grant, no isTrusted: true event fires
Screenshots emptyGrant Screen Recording permission to Terminal/VS Code
Tab not foundCall safari_list_tabs to refresh tab indices
Hebrew keyboard issuesAll typing uses JS events — immune to keyboard layout
HTTPS blockedsafari_navigate auto-tries HTTPS first, falls back to HTTP
Safari steals focusEnsure you're on latest version — newTab restores your active tab

---

🎯 aiskill88 AI 点评 A 级 2026-05-27

高质量的MCP工具,实现Safari自动化

⚡ 核心功能
👥 适合人群
Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师
🎯 使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
⚖️ 优点与不足
✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合
❓ 常见问题 FAQ
参考项目文档和示例代码
💡 AI Skill Hub 点评

AI Skill Hub 点评:Safari MCP 的核心功能完整,质量良好。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 Safari MCP
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 safari-mcp
原始描述 开源MCP工具:Native Safari browser automation for AI agents. 80 tools via AppleScript — zero 。⭐93 · JavaScript
Topics ai-agentsapple-siliconapplescriptautomation
GitHub https://github.com/achiya-automation/safari-mcp
License MIT
语言 JavaScript
🔗 原始来源
🐙 GitHub 仓库  https://github.com/achiya-automation/safari-mcp 🌐 官方网站  https://achiya-automation.com

收录时间:2026-05-27 · 更新时间:2026-05-27 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。