Click Safari Elements with AI on Mac
Let your AI assistant click buttons and links in Safari by CSS selector. safari_click runs locally on your Mac through LMCP — no API keys, no cloud.
safari_click lets your AI assistant click the first element matching a CSS selector in your current Safari tab. Instead of describing where a button is, you just tell the AI what to press and LMCP performs the real click inside Safari on your Mac. A typical prompt looks like: "In my current Safari tab, click the button with selector .add-to-cart." The AI translates your request into a precise selector-based click and Safari responds exactly as if you had clicked it yourself.
This is the building block for hands-free browsing: accepting cookie banners, expanding "Show more" sections, submitting forms, opening dropdowns, or triggering any interactive control on a page — all driven by natural language. Because it targets real DOM elements by selector, it is far more reliable than guessing pixel coordinates.
Which AI agents work?
LMCP exposes safari_click to every major MCP-compatible AI client. Desktop clients auto-configure over local stdio, so the tool appears automatically once LMCP is installed:
- Claude Desktop — auto-configured via local stdio
- Cursor — auto-configured via local stdio
- VS Code (GitHub Copilot) — auto-configured via local stdio
- Windsurf — auto-configured via local stdio
- Zed — auto-configured via local stdio
Web-based AIs connect through the LMCP Cloud Relay connector, which securely bridges to the LMCP server running on your Mac:
- ChatGPT
- Claude.ai (web)
- Grok
- Perplexity
Automation
The real power comes from chaining safari_click with the other 150+ tools LMCP provides. Combine it with safari_get_current_url to confirm where you are, safari_open_url to navigate first, safari_run_javascript to read values, and safari_get_page_text to verify the result of a click. A full flow might be: open a URL, click "Accept cookies", click "Log in", then read back the confirmation text — all in one AI conversation, with no manual switching between windows.
Context
Because LMCP drives your actual Safari session, the AI works with your real browsing context: your logged-in accounts, your open tab, your cookies and session state. There is no separate headless browser and no need to re-authenticate. The AI clicks inside the page you already have open, so it sees exactly what you see.
Productivity
Repetitive web tasks that normally cost minutes — dismissing banners, paging through results, toggling settings across dozens of pages — collapse into a single sentence. Ask once and let the AI click through the sequence. For QA, support, and research workflows where you repeat the same clicks on many pages, safari_click turns a tedious manual loop into an instruction you say out loud.
Privacy & GDPR
Everything runs locally on your Mac. safari_click talks directly to Safari on your machine — no page content, selectors, or session data are copied to any server, and nothing is stored in the cloud. LMCP is private and GDPR-compliant by architecture because your data never leaves your computer. Download LMCP to get started — it is free and native to macOS.