
Safari DevTools MCP
io.github.HayoDev由 GitHub 帳號 HayoDev 發布v1.8.1更新於 Oct 24, 2026
MCP server for Safari DevTools — browser debugging and automation for AI coding agents
概覽
讓編碼代理在 macOS 上控制並檢查執行中的 Safari 瀏覽器,用於除錯、自動化與測試。
- 可以做什麼
- 透過 SafariDriver 與 AppleScript 提供約 45 個工具來驅動 Safari。它能擷取主控台記錄與網路請求、執行 JavaScript、產生無障礙樹快照與元素截圖,並檢查計算後的 CSS。它也支援點擊、輸入、表單填寫、拖放、鍵盤快速鍵、分頁管理以及 Cookie 與 localStorage 操作,並提供 iOS Safari 與 WebKit 相容性檢查。
- 適用情境
- 適合在 Safari 中除錯或測試網頁的開發者,尤其是已熟悉 Chrome DevTools 工具鏈、希望取得對等 Safari 工作流程的人。也適用於無障礙稽核、效能分析以及 iOS Safari 或 PWA 就緒檢查。
- 執行需求
- macOS,需安裝 Safari 與 SafariDriver;Node.js 18 或更新版本(建議 22+),透過 npx 執行。Safari 需啟用開發者功能與「允許遠端自動化」,並以 sudo safaridriver --enable 授權 SafariDriver。需要可見的瀏覽器視窗,不支援無頭模式。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Safari DevTools MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Safari DevTools MCP
[npm version] [npm downloads] [license] [node]
safari-devtools-mcp lets your coding agent (such as Claude, Cursor, Copilot or Gemini) control and inspect a live Safari browser on macOS. It acts as a Model-Context-Protocol (MCP) server, giving your AI coding assistant access to Safari DevTools for debugging, automation, and testing.
Chrome developers get powerful AI debugging through chrome-devtools-mcp by Google. Safari developers should have something equivalent — this project brings that same experience to Safari, with matching tool names and parameter schemas so you can swap between browsers with minimal friction.
Changelog | Contributing
Note: This server exposes browser content (page data, console logs, network traffic) to MCP clients. Avoid browsing sensitive websites or entering credentials while a session is active.
Why safari-devtools-mcp?
This project uses WebDriver for capabilities that scripting alone cannot provide:
- Network request/response body capture — intercepts fetch and XHR calls with full headers, payloads, and timing
- DOM snapshots via accessibility tree — stable element UIDs that survive page re-renders, not brittle CSS selectors
- CSS computed style inspection — read any computed property from any element
- Cookie and storage management — read, write, and delete cookies, localStorage, and sessionStorage
- Element-level screenshots — capture individual elements, not just the full viewport
- Session auto-recovery — detects dead SafariDriver sessions and reconnects transparently
Key features
- Browser debugging: Capture console logs, inspect network requests, and evaluate JavaScript — with stack traces and full request/response details.
- Reliable automation: Click, type, fill forms, drag and drop, and press keyboard shortcuts using accessibility-tree snapshots with stable UIDs.
- Native macOS integration: Tab management via AppleScript for listing, switching, and controlling Safari tabs across windows
Requirements
- macOS (Safari and SafariDriver are Apple-exclusive)
- Node.js 18+ (22+ recommended)
- Safari with remote automation enabled
Safari setup
- Open Safari > Settings > Advanced > check "Show features for web developers"
- Develop menu > check "Allow Remote Automation"
- Authorize SafariDriver:
Getting started
Standard MCP config:
Claude Code
Or add to your project's .mcp.json using the standard config above.
Claude Desktop
Add the standard config to ~/Library/Application Support/Claude/claude_desktop_config.json.
Cursor
Add the standard config to your Cursor MCP settings.
VS Code
Add the standard config to .vscode/mcp.json.
Copilot CLI
Gemini CLI
Or add the standard config to your ~/.gemini/settings.json.
Gemini Code Assist
Add the standard config to your .gemini/settings.json in the project root.
JetBrains AI Assistant & Junie
Add the standard config to your .junie/mcp.json in the project root.
Raycast
Open "Install MCP Server" in Raycast and fill in:
- Command:
npx - Arguments:
-y safari-devtools-mcp@latest
Or copy the standard config JSON above before opening the command — Raycast will auto-fill the form.
Visual Studio
Add the standard config to your .vs/mcp.json in the solution root.
Warp
Add the standard config to your Warp MCP settings file at ~/.warp/mcp.json.
From source
Then point your MCP client to the built entry point:
Your first prompt
Navigate to https://example.com, take a snapshot, and list any console errors.
Slim mode
Use --slim to reduce token usage with shorter tool descriptions. Useful when working with context-limited models or long conversations:
Prompts (skills)
The server exposes guided debugging workflows as MCP prompts. Clients that support prompts (e.g. Claude Desktop, Claude Code) can invoke them by name:
Tools (45)
Debugging
Page content
Navigation
Scroll
CSS inspection
Cookies & storage
Input automation
iOS Safari validation
Architecture
Known limitations
- Single session: Safari only allows one WebDriver session at a time. Running multiple instances is not supported.
- macOS only: Safari and SafariDriver are Apple-exclusive — this server does not work on Linux or Windows.
- No headless mode: Safari does not support headless operation. A visible browser window is required.
- Console pre-injection gap: Console messages logged before the capture script is injected are not captured.
- Network pre-injection gap: Network requests made before injection are backfilled via the Performance API with limited detail (timing and size, but no headers or status codes).
- PNG only: Safari WebDriver only supports PNG screenshots — no JPEG or WebP. Full-page capture is not available.
- AppleScript permissions: Tab management features require macOS Accessibility permissions for
osascript.
Credits
- chrome-devtools-mcp by Google/ChromeDevTools — the inspiration and interface standard this project mirrors. Tool names and schemas are intentionally compatible so you can switch between Chrome and Safari seamlessly.
- safari-mcp-server — prior art for Safari MCP integration that we studied during development.
License
來源:README.md,提交 9bc2afb
工具
0版本歷史
1- v1.8.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分