JS

jasonpaulso/safari-mcp-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

0 stars 6 forks 品質 61 トレンド 0MIT

A node MCP server for controlling safari with an AI

概要

A Model Context Protocol (MCP) server that provides AI assistants with Safari browser automation and developer tools access. This server enables LLMs to interact with Safari, access console logs, monitor network activity, and perform browser automation tasks. - 🚀 : Start, control, and manage Safari sessions - 🔍 : Get console logs, network logs, and performance metrics - 📸 : Capture page screenshots for visual analysis - 🕵️ : Inspect DOM elements and their properties - ⚡ : Run custom JavaScript in the browser context - 📊 : Access timing metrics and performance data - 🔧 : Manage multiple Safari automation sessions - (Safari and SafariDriver are only available on macOS) - - (comes with built-in WebDriver support) Before using this MCP server, you need to enable Safari's automation features: 1. : - Open Safari → Preferences → Advanced - Check "Show Develop menu in menu bar" 2. : - In Safari's menu bar: Develop → Allow Remote Automation 3.

README

以下は原文 README の抜粋です。原文を見る。

Safari MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with Safari browser automation and developer tools access. This server enables LLMs to interact with Safari, access console logs, monitor network activity, and perform browser automation tasks.

Features

  • 🚀 Safari Browser Automation: Start, control, and manage Safari sessions
  • 🔍 Developer Tools Access: Get console logs, network logs, and performance metrics
  • 📸 Screenshots: Capture page screenshots for visual analysis
  • 🕵️ Element Inspection: Inspect DOM elements and their properties
  • ⚡ JavaScript Execution: Run custom JavaScript in the browser context
  • 📊 Performance Monitoring: Access timing metrics and performance data
  • 🔧 Multiple Sessions: Manage multiple Safari automation sessions

Prerequisites

System Requirements

  • macOS only (Safari and SafariDriver are only available on macOS)
  • Node.js 18+
  • Safari 10+ (comes with built-in WebDriver support)

Safari Setup

Before using this MCP server, you need to enable Safari’s automation features:

  1. Enable Developer Menu:

    • Open Safari → Preferences → Advanced
    • Check “Show Develop menu in menu bar”
  2. Enable Remote Automation:

    • In Safari’s menu bar: Develop → Allow Remote Automation
  3. Authorize SafariDriver:

    sudo safaridriver --enable
    

    Enter your admin password when prompted.

Installation

  1. Clone or navigate to the project directory:

    cd C:\Users\\RiderProjects\AIPacketAnalyzer\safari-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Usage

Running the Server

npm start

The server will start and listen for MCP protocol messages on stdio.

Development Mode

npm run dev

Available Tools

Session Management

  • safari_start_session - Start a new Safari automation session
  • safari_close_session - Close a Safari session
  • safari_list_sessions - List all active sessions
  • safari_navigate - Navigate to a URL
  • safari_get_page_info - Get current page URL and title

Developer Tools Access

  • safari_get_console_logs - Get browser console logs
  • safari_get_network_logs - Get network activity logs
  • safari_get_performance_metrics - Get page performance metrics

Browser Interaction

  • safari_execute_script - Execute JavaScript in the browser
  • safari_take_screenshot - Capture page screenshots
  • safari_inspect_element - Inspect DOM elements

Example Usage with Claude Desktop

Add this configuration to your Claude Desktop config file:

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

{
  "mcpServers": {
    "safari-devtools": {
      "command": "node",
      "args": ["C:/Users//RiderProjects/AIPacketAnalyzer/safari-mcp-server/build/index.js"]
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "safari-devtools": { "command": "node", "args": ["C:/Users/<USERNAME>/RiderProjects/AIPacketAnalyzer/safari-mcp-server/build/index.js"] } } }