close_tab
Close a tab by ID
How to use it
close_tab is exposed by the MCPSafari MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the close_tab tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install MCPSafari
claude mcp add --scope user mcp-safari mcp-safariOther tools in MCPSafari (27)
Click by UID, CSS selector, text, or coordinates
Drag and drop between elements
Drop local files onto an element
Find elements by CSS selector, visible text or accessible name, or ARIA role (up to 50 matches)
Batch fill form fields (CSS selector → value map)
Accept or dismiss alerts, confirms, and prompts
Hover to trigger tooltips, menus, or hover states
Execute arbitrary JS in the page context and return expression results; multi-statement code must end in an explicit return to produce a value
Go to a URL, or use back / forward / reload actions
Press key combinations (e.g., Enter, Meta+a, Control+c)
Read console messages with level and regex filtering
Read captured XHR/fetch requests with type filtering
Get page content as text, html, or snapshot
Resize the browser window to specific dimensions
Run up to 10 interaction or wait steps sequentially, stopping on the first failure
Capture the visible tab area as a PNG image, with viewport, scale, page visibility, and window focus
Scroll page or element in any direction
Select a dropdown option by value or label
Pin a tab as the default context for future calls
Accessibility tree with element UIDs for interaction
Report listener, authenticated bridge, version, and token health without requiring a Safari connection
List all open tabs with IDs, URLs, and titles
Open a new tab, optionally with a URL
Type into an element with optional clearFirst and submitKey
Attach local files to an <input type="file">
Wait for a duration, CSS selector, or text to appear