mcp-safari
MCP server that provides programmatic control of Safari browser on macOS. Perfect for web automation, testing, and debugging with AI assistants like Claude.
claude mcp add --transport stdio iclaudiumihaila-mcp-safari-server node /path/to/mcp-safari-server/dist/index.js
How to use
The MCP Safari Server exposes a standardized interface to control and interact with the Safari browser on macOS. It provides tools for navigation, JS execution, element interaction, form input, scrolling, screenshots, and real-time error monitoring, all accessible through the MCP protocol. This enables AI assistants (like Claude) to automate web tasks, test pages, extract data, and monitor page errors in a consistent, scriptable way. You configure Claude to talk to this server via your Claude configuration file, and then invoke the provided tools to drive Safari programmatically.
Once running, you can use tools such as navigate to open URLs, execute_script to run JavaScript in the current page context, get_page_info to read the current URL and title, and take_screenshot to capture the visible Safari window. There are also utilities for interacting with page elements (click_element, type_text, scroll_to, select_option, get_element_text) and for page navigation (refresh_page, go_back, go_forward). The server can also monitor JavaScript errors and forward them to Claude Code for debugging, enabling an integrated development workflow.
How to install
Prerequisites:
- macOS with Safari installed
- Node.js 16+ (recommended) or a compatible Node.js runtime
- Ability to run npm install and npm run build
Installation steps:
- Clone or download the mcp-safari-server project:
git clone https://github.com/your-org/mcp-safari-server.git
cd mcp-safari-server
- Install dependencies:
npm install
- Build the server for distribution:
npm run build
- Configure Claude to use the server (example in Claude config):
{
"mcpServers": {
"safari": {
"command": "node",
"args": ["/path/to/mcp-safari-server/dist/index.js"],
"env": {}
}
}
}
- Run the server (path adjusted to where you built it):
node dist/index.js
- Validate connectivity from Claude and start using the provided tools.
Additional notes
Notes and tips:
- The server uses AppleScript under the hood to control Safari; ensure you grant Terminal/your IDE automation permissions in System Preferences > Security & Privacy > Privacy > Automation.
- If you see permission or automation errors, re-check Safari automation settings and macOS privacy shields.
- For development builds, you can run the TypeScript source directly via npx tsx as shown in the README’s development example, but for production use point Claude at the built dist/index.js.
- The error monitoring feature can be configured with interval (ms) and autoSendToClaude to tailor notifications to your workflow.
- When integrating with Claude, ensure your configuration references the correct path to the built server and that network access between Claude and Safari is permitted.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.