EvidenceChain answer
How can I install and configure the Safari MCP server to connect my AI coding assistant with a live Safari browser windo
What the Safari MCP Server Does
The Safari MCP server lets your AI coding assistant (Claude, Cursor, Copilot, and others) control a live Safari window on macOS [32][33][27]. It uses your real Safari—logins, cookies, sessions and all—so you skip headless browsers and heavy emulation [13][40][29]. The server talks to your client locally over stdio and exposes about 80 tools for automation and debugging [12][19][39][27][48].
Before You Start
Make sure you have these ready:
- A Mac running macOS [2][20][28].
- Node.js version 18 or newer [2][20][36].
- Two Safari developer toggles turned on:
- Safari → Settings → Advanced → “Show features for web developers” [2][11][17][38].
- Safari → Develop → “Allow JavaScript from Apple Events” [2][11][17][37].
- Any MCP‑compatible AI assistant (most modern coding agents work) [20][42].
Installing the Server
There are a few paths—pick the one that fits your workflow.
Quick‑and‑easy with npx
Open Terminal and run:
npx safari-mcp
No global install needed; the server starts right up [4][18][35].
If you prefer a persistent, globally available version:
npm install -g safari-mcp
Then just type safari-mcp [5].
Apple’s Official Server
Install Safari Technology Preview 247 or later, then enable the same two developer settings listed above [15][41]. The MCP server is built into that preview [15].
MCPSafari All‑in‑One Installer
Download the installer from the MCPSafari GitHub page. It places both the MCP server binary and the Safari extension into /Applications and removes any previous installation [1][31]. After install, don’t forget to activate the extension: Safari → Settings → Extensions → MCPSafari Extension [20].
Manual Build (stevenayl’s Variant)
Clone the repository, then:
cd mcp-safari-server
npm install
npm run build
This gives you a compiled server ready to configure [22]. (Some community servers also require a one‑time Xcode build of the Safari extension; the npx and MCPSafari installers handle that for you [3].)
Hosted on Glama
On the Glama platform, click “Install Server” and wait for it to show “Started.” Then you can invoke it in chat with @MCP Safari Server [25].
Connecting Your AI Coding Assistant
Once the server is running, tell your AI client where to find it. The setup depends on your editor or agent.
Generic MCP Client Configuration
Many clients accept a JSON entry like this:
{
"mcpServers": {
"safari": {
"command": "npx",
"args": ["safari-mcp"]
}
}
}
[6][23][24]
Claude Code
Run this one‑liner in your terminal:
claude mcp add safari -- npx safari-mcp
[7]
Claude Desktop
Edit the file at:~/Library/Application Support/Claude/claude_desktop_config.json
Paste the same JSON snippet shown above [8].
Cursor
Use the Install in Cursor one‑click button on the MCP.Directory page, or create a .cursor/mcp.json file in your project with the JSON block [9][10][16].
Other Editors (VS Code, etc.)
Visit the safari‑mcp page on MCP.Directory; it includes a one‑click setup panel for Cursor, Claude Desktop, VS Code, and other MCP‑compatible clients [10][16].
MCPSafari Connection Details
When you use the MCPSafari installer, the server already communicates over stdio and bridges tool calls to the Safari extension through a local WebSocket [14]. You still need to enable the extension in Safari’s preferences (see above) [20].
What You Get for Automated Debugging
After configuration, your AI assistant can perform a wide range of debug tasks inside a real browser:
- Navigate, refresh, go back/forward [26].
- Execute JavaScript on the page [26][45].
- Grab console logs and watch for errors [26][43].
- Take screenshots of any viewport or state [26].
- Click, type, scroll, select, and wait for elements [26].
- Inspect the DOM, network requests, and performance metrics (navigation timing, resource loads) [43][45].
- Check accessibility—missing labels, poor contrast, ARIA issues [46].
- Verify UI states—form fields, checkout flows, specific element selectors [47].
Because everything runs through your existing Safari, authenticated sessions and real‑world rendering behave exactly as a user would experience, without the overhead of headless setups [13][29][32][40].
A Quick Note on Troubleshooting
If the agent can’t control the browser, double‑check the two Safari developer settings are enabled, and make sure no other tool is blocking the stdio connection. For Apple’s official server, you must be running Safari Technology Preview 247 or later [41]. The evidence does not cover detailed error‑message diagnosis; it only confirms the setup steps above.
Discussion
Comments
Sign in to join the discussion
Comments are open to registered users so replies and notifications stay tied to a real account.
No comments yet. Be the first to add a useful angle.