mcp-safari-server

stevenayl/mcp-safari-server

3.4

If you are the rightful owner of mcp-safari-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server that provides programmatic control of Safari browser on macOS, ideal for web automation, testing, and debugging with AI assistants like Claude.

The Safari MCP Server is designed to enable AI assistants to interact with the Safari browser through a standardized protocol. It offers a suite of tools for navigation, element interaction, JavaScript execution, and page monitoring. This makes it particularly useful for AI-assisted web development and debugging, automated testing and quality assurance, web scraping and data extraction, real-time error monitoring, and visual regression testing. By leveraging the capabilities of the Safari MCP Server, developers can automate repetitive tasks, streamline testing processes, and enhance the efficiency of web development workflows. The server's integration with Claude Code further enhances its utility by providing real-time error monitoring and automatic error reporting, allowing for immediate fixes and continuous improvement of web applications.

Features

  • Navigate: Open URLs in Safari
  • Execute JavaScript: Run JS code in the current page context
  • Get Page Info: Retrieve current URL and page title
  • Take Screenshots: Capture the current Safari window
  • Automatic Error Monitoring: Monitor JavaScript errors and send them to Claude Code for immediate fixing

Usages

usage with Claude

{
  "mcpServers": {
    "safari": {
      "command": "node",
      "args": ["/path/to/mcp-safari-server/dist/index.js"],
      "env": {}
    }
  }
}

usage with Claude development

{
  "mcpServers": {
    "safari": {
      "command": "npx",
      "args": ["tsx", "/path/to/mcp-safari-server/src/index.ts"],
      "env": {}
    }
  }
}

Tools

  1. navigate

    Navigate Safari to a URL

  2. execute_script

    Execute JavaScript in the current page

  3. get_page_info

    Get information about the current page

  4. take_screenshot

    Take a screenshot of the current Safari window

  5. get_console_logs

    Retrieve console logs from the page

  6. refresh_page

    Refresh the current page

  7. go_back

    Navigate to the previous page

  8. go_forward

    Navigate to the next page

  9. start_error_monitoring

    Start monitoring JavaScript errors

  10. stop_error_monitoring

    Stop error monitoring

  11. click_element

    Click on an element in the page

  12. type_text

    Type text into an input field

  13. scroll_to

    Scroll to an element or position

  14. select_option

    Select an option from a dropdown

  15. get_element_text

    Get the text content of an element

  16. wait_for_element

    Wait for an element to appear