Skip to content

MCPSafari v0.4.2

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Nov 14:27
· 85 commits to main since this release
Immutable release. Only release title and notes can be modified.
137f1b6

MCPSafari v0.4.2

Added

  • Release downloads now carry a signed SLSA build provenance attestation, so gh attestation verify <file> --repo Epistates/MCPSafari ties a download to the commit and the workflow run that built it. It covers the three mcp-safari binaries and both extension archives, alongside SHA256SUMS and Apple's notarization.
  • Structured results now cover every tool's success path, including status, profile-qualified tab listings, interactions, screenshots, timed waits, and nested batch results. Text and HTML page reads preserve JSON-looking text verbatim, JavaScript results preserve JSON primitive types, and screenshot metadata avoids duplicating image bytes. Protocol-level tests exercise all 27 advertised tools against the actual server.
  • Every tool result now carries its answer as data as well as prose. Failures have carried structuredContent since tool error codes shipped, so a caller got something parseable only when something went wrong; successes returned a paragraph. Each success now sets structuredContent to an object whose keys name its payload (status, tabs, tab, page, snapshot, matches, messages, requests, result, results, wait, window, screenshot), with anything that qualifies the payload beside it, such as profileFailures or unreachableFrames; docs/tools.md lists each tool's fields. A JSON listing arrives as an array a caller can index rather than a string they have to parse again. Text that is not JSON stays text, including a page whose whole content is 42 or null, which a parser alone would have retyped into a number or an absent value. The wrapping object is required rather than stylistic: structuredContent may only be a JSON object before protocol revision 2026-07-28, and this server negotiates 2025-11-25. No outputSchema is declared to go with it, deliberately, since a declared schema makes clients reject any result that does not match and would turn every later shape change into a hard break while the tool surface is still settling.
  • The extension popup names the current site and whether MCPSafari can reach it: allowed, asking, or no access. Safari grants website access one site at a time and reports that nowhere the user is looking, so "the agent cannot read this page" and "the server is not connected" used to look identical from outside. Opening the popup is also what prompts Safari to ask if it has not already, which puts its dialog in front of someone who is already looking at MCPSafari rather than behind a window mid-task.
  • mcp-safari doctor warns when more than one copy of the Safari extension is registered, names each copy, and gives the command that unregisters the extra ones. Xcode registers every app it builds, so a build left beside the installed app was enough: Safari can run both copies, each numbering tabs its own way, and tab handles then changed between calls, with calls failing as if the tab had closed.
  • mcp-safari doctor reports which extension Safari is actually loading. Safari's own Uninstall button deletes MCPSafari.app, and on a machine with an Xcode checkout PlugInKit then falls back to whatever debug build is sitting in DerivedData. Neighbouring versions share a bridge protocol, so the handshake accepts the old build and nothing else in the product notices; the new extension_location check warns when the registered extension lives outside the installed app and says how to get back. It stays quiet when the app is installed somewhere else entirely, since app_installed already covers that.
  • Every connected Safari profile is drivable. tabs_context now asks all of them and returns one merged listing, and each tool call goes to the profile its tab handle names. A profile that fails to answer tabs_context is named in the result rather than dropped, so a short listing is not mistaken for a closed tab. status gains a handle (p0) and a selected flag per profile, and select_tab moves the selection; it falls through to another profile if the pinned one goes away, so closing a window does not break calls that name no tab. Naming a profile that is not connected fails with profile_not_connected rather than answering from a different browser window.
  • The number of ports the server tries is configurable (#155). --port-range <n> or MCP_SAFARI_PORT_RANGE sets it from 1 to 64, and the default stays ten, so 8089 and the next nine. The flag wins over the variable, and a value outside 1 to 64, or a range that would run past port 65535, stops the server with a message naming where it came from. status reports the range as requestedPort through a new lastPort, and the bind failure message says which ports were tried and points at --port-range. The extension needs no matching setting, since it connects to every port that has a token file; see the next entry.
  • MCP_SAFARI_TOKEN_ROOT moves the server's token files to another absolute path, for tests that start the real server. The Safari extension reads only the standard location, so it can't find a test server started this way, and a test that clicks or navigates can't reach your real browser. status reports the override as tokenRootOverride, mcp-safari doctor warns with token_root_override, and the protected-path checks follow it.
  • tabs_create takes newWindow: true to open the tab in a new window of its own, for agents running side by side. A window shows one tab at a time, so agents sharing one hide each other's pages, and a page whose window is completely covered stops drawing. The new window is the size of the window in front and 40 points down and to the right of it, so a strip of each stays visible. An extension older than the server ignores the option and opens the tab in the window in front, and the result then says so. The new tab is found as the one that wasn't there before the call, in a window that wasn't either: what Safari answers windows.create with can point at an existing tab. If no single tab qualifies, the call fails and says how to find the window, rather than return a tab the caller didn't open.
  • A reply the server cannot read now fails its request at once with malformed_response, and a result too large to send fails with response_too_large. Both are documented in the tools reference.
  • While a call is waiting for access to a site, MCPSafari's toolbar button shows a "!" badge, and its tooltip names the site when Safari lets the extension see it. Safari 27.2 doesn't ask when an extension first touches a site nobody has decided on: it refuses, and the only place to allow the site is the extension's toolbar button, which gave no sign anything was waiting. The "!" goes once a call on that site gets through, the tab navigates or closes, or after 15 minutes. It's one badge for the whole button, in Safari's own colour: Safari clears a tab's badge whenever the tab navigates, and ignores badge colours. The permission_required message now says where to click, and the docs describe Safari 27.2's behaviour.
  • The toolbar popup names each connection. Several sessions can each run a server, and the popup listed them by port alone, so nobody could tell which was which. After the handshake a server now tells the extension its name, the folder it was started in, and the MCP client behind it, and each connected row shows the name (--name or MCP_SAFARI_NAME, else the last part of the folder) with the folder on a second line, the home folder shortened to ~. The row's tooltip has the state and the client, such as claude-code 2.1.0, and status reports the same as instance. A name that is empty, longer than 64 characters or holds a control character stops the server with a message, rather than showing up in Safari as something other than what was asked for. The bridge protocol is unchanged: an extension without naming ignores the new fields and answers the new identify request with an error the server ignores, and a server without naming is shown by its port, as before.
  • A result from a page Safari isn't showing says so. Safari pauses a hidden page (a tab that isn't the one in front of its window, or one whose window is minimized, completely covered or on another Space), so a web app on it can show stale or empty content, and only a screenshot used to say why. Every reply from a page now carries its visibility, at no extra cost, and a result from a hidden page ends with a Page visibility: hidden. line and carries "pageVisibility": "hidden" beside its payload. The call itself runs as before, since most reads and writes work on a hidden page.
  • A wait for a selector or text that runs out on a hidden page fails with page_hidden rather than the retryable wait_timeout, and says how the tab is hidden and what brings it back: call_select_tab when another tab is showing in its window, ask_user when its window is minimized, covered or on another Space. Retrying the wait as it stood waited out the same timeout again on a page that wasn't drawing.
  • click takes native: true. It moves the real macOS pointer to the target and presses the left button there, twice with doubleClick, so a site that ignores synthetic events gets the same trusted events a person's click gives it. It has the same guards as native hover and drag: Safari must be in front with Accessibility permission, the target must be reachable, and the point must be over a Safari window, which is checked again just before the press. click used to refuse native as an unknown argument.
  • clear_cookies deletes one site's cookies in a Safari profile, including the sign-in cookies a page can't delete itself, so an agent can switch accounts on a site or sign-in service that remembers the last one (#164, contributed by @scriptease). Name the site with domain, and its subdomains are cleared too; tabId picks the profile. A domain that unrelated sites share, such as co.uk or github.io, is refused. Only a count comes back, never a cookie's name or value. With per-site access, Safari hides the cookies of sites MCPSafari isn't allowed on, such as those set for a parent domain or by a sign-in service you only pass through, and the result says when that may have happened. To switch accounts reliably, use a separate Safari profile with MCPSafari allowed on every website.

Changed

  • Native input no longer starts while you're using the Mac. A native call made within 5 seconds of your last key press, click, pointer move or scroll fails with the retryable native_input_user_active and sends nothing, rather than bringing Safari to the front and mixing its keys with yours. Input the servers posted themselves doesn't count, so an agent can click a field and type into it straight after. Native typing also stops if you move the mouse, click or scroll partway through, before your click can move the keyboard, and says how many characters went out.
  • Homebrew 6 and later need one extra step: trust MCPSafari's server formula once with brew trust --formula epistates/tap/mcp-safari-server, then install with brew install --cask epistates/tap/mcp-safari. Homebrew trusts a cask you install by its full name but not the formula it depends on, so without it an install stops at "Refusing to load formula epistates/tap/mcp-safari-server from untrusted tap". To upgrade, name both parts in full, server first: brew upgrade epistates/tap/mcp-safari-server, then brew upgrade --cask epistates/tap/mcp-safari. Naming them trusts them, which an install from before Homebrew 6 needs; a plain brew upgrade may keep the version you have. Trusting the whole tap (brew trust epistates/tap) also works, but trusts everything in it, now and later.
  • javascript_tool decides which world to run in before any of the code runs, and runs it once. It used to decide from how the run in the page's world turned out, which goes through the page's own Promise and error objects, so a page could make a finished run look like a Content Security Policy refusal and have the code run a second time in the extension's isolated world, repeating any click, submission or purchase it made. A probe now compiles both forms of the code without running either, with the source text built in the extension, and the code then runs exactly once in the world the probe settled on.
  • upload_file and drop_file take up to 512 MB per call, up from 10 MB, which covers an App Store app preview. A file used to cross the bridge whole, as base64 in one message, and the bridge and Safari's own extension messaging both cap the size of one message. Files are now sent in 4 MB pieces, read from the descriptor the server checked, and held by the content script in the target's frame, out of the page's reach, until the action hands the finished files to the page. The target is checked before anything is sent, so a call aimed at the wrong element fails at once rather than after a long upload. A file that changes while it is being sent is refused, and a page that reloads or navigates mid-transfer fails the call with the retryable file_transfer_lost.
  • --port from 1 to 1023 is refused with a message. The extension never dials a port below 1024, so a server started there ran and could not be found. --port 0 still takes any free port.
  • The extension finds servers by their token files rather than by scanning 8089 to 8098 (#155). A server writes a token for the port it actually bound and the handshake means the extension can only talk to a port it holds a token for, so every port with a token is now dialled, whichever it is. Before, a server started with --port 9000, or one that fell back past 8098, wrote a token the extension never used unless the port was added by hand in the popup. That is no longer needed, and any --port and --port-range work without a setting to keep in step in two places. A port is dropped from the popup when its server stops and removes its token, and the extension manages at most 64 discovered ports at once so a directory full of token files cannot create unbounded connections. Ports added by hand are unaffected and not counted.
  • mcp-safari doctor takes --port-range and looks for the token anywhere in the range instead of only at the first port. A server whose first port was taken binds a later one, so checking just the first reported a working install as missing its token.
  • Breaking: the bridge protocol moves from version 1 to 2 for the challenge-response handshake, so the app, its extension and mcp-safari must be updated together. A 0.3.x extension that dials a newer server is told the versions differ and which to install, and status and doctor report the mismatch when the extension proved it holds the token. A newer extension that dials a 0.3.x server is closed without a message, because that server cannot read the new first frame.
  • Breaking: tabId is now a tab handle string such as p0t5, meaning tab 5 of profile 0, rather than an integer. Safari runs a separate instance of the extension in every profile and each one numbers its own tabs, so a bare number named a different page in each. The handle carries the profile the way an element UID carries its frame (f0e42): no tool gained a profile argument. Handles come from tabs_context, which mints them, and from tabs_create and select_tab, which return them. An integer tabId is refused with invalid_input and a message naming the new form rather than being read as a tab in whichever profile happened to be selected.
  • Dialog automation is now opt-in and one-shot: call handle_dialog before triggering a dialog, within 30 seconds. Native dialogs are unchanged outside that window; reading a captured result does not rearm interception.
  • Console/network filters use a bounded regex subset and reject invalid or potentially expensive patterns instead of silently ignoring filters. Captured fields report truncation; bridge messages and in-flight requests have explicit limits.
  • The host app shows a message in its window, and logs it, when its bundled page is missing, rather than crashing on launch.
  • A tab that doesn't answer is no longer always blamed on Safari's permission dialog. Each page call is checked first with a tiny script, and one that got no answer within two seconds failed with permission_required, saying a dialog was waiting, even on a background tab of a site the user had allowed, so the user went looking for a dialog that wasn't there. Safari stops answering for the tab while its dialog is open, so the tab is now looked up once more. When Safari answers, the call fails with page_hidden if the tab isn't the one showing in its window (call_select_tab) or its window is minimized (ask_user), and with page_not_responding if it is the one showing, which leaves a covered window, another Space or a busy page (ask_user). A capture that times out is named the same way. When Safari doesn't answer, the dialog message is unchanged. The popup shows such a page as not answering rather than as asking or refused.
  • Tabs on sites MCPSafari hasn't confirmed access to are now described that way, rather than as not granted. not_granted has always meant that no call has worked on the site yet. After a reinstall resets the extension's data, that's true of every site the user allowed, and the old wording ("has not been granted", "will fail with permission_required until the user grants it") sent agents to ask for access the user had already given. The accessHint, the note on tabs_context, tabs_create and select_tab results, and the landing note after a navigation now say that a call on such a tab works if the user has allowed the site, and otherwise fails with permission_required. The listing note is now the server's own sentence and no longer repeats the extension's hint, which each tab's JSON still carries. The access values are unchanged.
  • tabs_create opens the new tab in the agent's own window: the window of the tab named by tabId, or else of the tab the agent pinned with select_tab. tabId used to choose only the Safari profile, so every new tab landed in the window in front, which is often yours or another agent's. With neither, a new tab still opens in the window in front. A named tab that has closed is now reported as tab_closed.
  • A screenshot of a tab behind another in its window puts back the tab that was showing once it has captured, instead of leaving the agent's tab in front of whatever you were looking at. If you switched tabs during the capture, your choice stands.
  • When Safari's extension stops answering altogether, which Safari can do while its windows are hidden or all minimized, a call now fails with extension_not_responding and says to bring a Safari window into view. It used to report bridge_timeout, which reads like one slow call. After a timeout the server asks the extension a trivial question to tell the two apart.

Removed

  • Breaking: the server no longer writes ~/.config/mcp-safari/ at all, neither the per-port tokens/<port> files nor the shared token file, and the extension no longer falls back to a single shared token. They existed so that extension builds predating the move to Application Support, and predating per-port tokens, could still authenticate. Those builds cannot speak the current bridge protocol, so the files only served as a second copy of the secret, one in a directory that is often symlinked into a dotfiles repo and one in a shared file that any process could replace. Tokens live only under ~/Library/Application Support/MCPSafari/tokens/. Install the matching app and mcp-safari versions together.
  • The extension no longer reads ~/.config/mcp-safari/, neither its tokens/ directory nor the single token file, and the native message handler no longer answers getToken or returns a token key. Only ~/Library/Application Support/MCPSafari/tokens/ is read. The old location existed so an extension build from before the move kept authenticating, and it was the reason the sandbox exception covered a second directory. The background script only ever sent getTokens.

Fixed

  • tabs_create with a url reports a site the user has already allowed as granted, with the page's title. It reported every site MCPSafari hadn't reached yet as not_granted, so agents stopped to ask for access the user had already given. The new tab is now checked as soon as it loads. On a site the user hasn't decided yet, that check raises Safari's question straight away, as the agent's next call would have, and adds up to about 2 seconds to tabs_create (#169, contributed by @ailenshen).
  • A call made while Safari's extension is still connecting, just after the server starts or while the extension reconnects, now waits for it, up to 12 seconds or the call's own time, instead of failing at once with bridge_disconnected and telling the agent to open Safari. Agents took that at face value and gave up on a Safari that was a second or two from ready. bridge_disconnected, and bridge_unavailable while the server is still starting, are now retryable. A server that couldn't open any of its ports still fails at once (#167, contributed by @ailenshen).
  • Native press_key and type_text no longer fail whenever Safari's own controls hold the keyboard. After a new window or a navigation, Safari often leaves the keyboard in its address bar, nothing a page does can take it back, and every native key was refused with native_input_focus_failed until someone clicked the page. When the agent's window is in front, MCPSafari now moves the keyboard into its page through Accessibility, the way Tab or VoiceOver does, with no mouse or page events. It first checks that the window in front is the agent's and is showing the agent's tab, and moves nothing if it isn't, or if another window looks the same. A native click goes ahead in that window even when the keyboard stays where it is, since clicking the page gives it the keyboard, so clicking a field with native: true and then typing works too. When the keyboard can't be moved, the error now says where it is: the address bar, the find bar, another Safari window or another application.
  • Native click, hover and drag land where they aim on a second display. Safari measures a window's top from the top of the display it's on, so on a display that isn't level with the main one every native pointer event landed off by the difference, in whatever window was there, including the user's own. The server now places each point from where Accessibility shows the agent's page. The check before the first event also requires the window under the point to be the agent's, not just any Safari window, and refuses with native_input_focus_lost and nothing sent otherwise. Native typing could be refused in the agent's own window on such a display for the same reason; the window check now compares the window's size, title and page address, not its position.
  • Native type_text stops when the keyboard moves into another page partway through, such as when you click in another tab or window. It checked only that the keyboard was in some page, so the rest of the text went into the page you clicked. It now stops at its next check, at most 15 characters later, and says how many characters went out.
  • Another agent can no longer take the keyboard while one is typing with native input. Servers took turns only for native input itself, so a second agent opening a tab or window, switching tabs or taking a screenshot mid-text moved Safari's keyboard, and the rest of the text went into the other page. Now tabs_create, select_tab and screenshot wait while any server types. One that can't get in within 30 seconds fails with the retryable native_input_busy and does nothing. They still don't wait for each other.
  • A tab that was open when MCPSafari was updated or restarted now fails with page_needs_reload, saying to reload it, instead of reply_lost. Safari keeps the earlier MCPSafari's script attached to such a page and lets nothing reach it, and the script injected to replace it found the old one loaded and stepped aside, so every call failed as though the page had gone away mid-call and might have acted. Nothing was ever done to the page. Reloading it makes it work again; the error tells an agent to reload only a tab it opened and to ask you about the rest, since a reload discards unsaved text. After upgrading, reload the Safari tabs you want agents to use.
  • Every Safari profile now finds a newly started server on the same check, within about 15 seconds, so a second profile no longer trails the first by a minute or more (#168). Safari drops the reply to one of two native messages sent at the same moment, and every profile asked for the server list at the same moment, so at each check one profile at random missed the new server, sometimes several checks in a row. Each profile now asks at its own moment, every 15 seconds instead of 30, and asks again when a reply doesn't come. A call made in a new server's first 25 seconds waits for Safari to connect instead of failing after 12, and tabs_context in that time says a profile may still be connecting and when to look again.
  • A Safari profile no longer ignores a new server on a port an earlier server used. While the profile still held anything for the old server, such as a socket Safari hadn't reported closed, it didn't dial the new one. Each server run writes a new token, so a new token on a port now replaces whatever the profile held for that port, and the new server is dialled straight away.
  • The extension no longer gives up on a port for good after a few refusals. Three failed dials in a row suppressed the port with its current token recorded as stale, and nothing clears that while the token stays the same, which it does for as long as the server runs. Anything holding the server's handshake slots, or one slow start, was enough, and only restarting Safari brought the extension back. Suppression is now a pause: the keepalive, about every 15 seconds, forgets it and dials again while the token file exists, and the port is dropped when the file is gone. A socket the server accepts and never answers is closed after five seconds so the next attempt can proceed instead of finding a connection that looks busy.
  • Reconnecting while the old socket was still closing no longer loses the live one. A close event cleared the connection's socket without checking it was the current one, and a socket on its way out counted as free to dial over, so the popup's reconnect could orphan the live socket, dial a third, and have the server close the live one as a duplicate profile, repeating. A closing socket now counts as in use and a late close only updates a connection that still holds that socket.
  • A tool result containing half of a character no longer makes its request wait out the 30 second timeout. A string cut through an emoji is written by JSON.stringify as a lone surrogate escape that the server's decoder refuses, so the reply was dropped for an action that had already run. Every string in a reply, keys included, is now well formed when it is sent, and a reply the server still cannot read fails its request at once with malformed_response.
  • A result larger than the bridge can carry no longer drops the connection. The server closes a socket on a message over 32 MiB, which failed every other request in flight on it. A reply over 31 MiB now becomes a response_too_large error for that request alone. A reply for a socket that closed in the meantime is dropped quietly instead of surfacing as an unhandled rejection.
  • Stopping the server is final. A start that was scheduled behind the stop, or a retry that had already woken, bound a port and wrote a token and owner file just before the process exited. A frame read just before the handshake deadline dropped its connection also no longer leaves a handshake entry behind, and status no longer reports another server's token file as its own after a failed bind.
  • Two servers starting together can no longer delete each other's token files. The sweep for a dead server's files read its pid and deleted afterwards, so a server that claimed the port in between lost its files. A live server now holds a lock on its owner file, and the sweep deletes only while holding it.
  • The warning about refusing a connection when eight are mid-handshake is written at most once every 30 seconds, with a count of the ones held back. A process opening sockets in a loop wrote one line per socket to the stderr that MCP clients show their user.
  • Synthetic events cross shadow boundaries. A click, hover, key press, typed input, drag or file drop on an element inside a shadow root was dispatched without composed, so it stopped at the edge of that root and a listener on the host, or anywhere outside the component, never saw what a real event would have reached it with. Every event the content scripts dispatch now takes its bubbles, cancelable and composed flags from one table following UI Events and HTML: composed and cancelable throughout, except that pointerenter and mouseenter do not bubble, input, change and dragend cannot be cancelled, and change is not composed, which is what a browser does. dragend was cancelable before and no longer is.
  • The extension's get_page_text action is bounded like read_page text. It returned the whole innerText, with no default, no ceiling and no truncation notice. No tool sends it today, so nothing the server clamps stood in front of it. It now takes maxChars with the same 100,000 default, the same 1,000,000 ceiling and the same truncation notice, and the ceiling applies to read_page text and HTML in the extension itself rather than only in the server.
  • The field redaction recognises more secrets. A card, key or national id field under an ordinary name was reported verbatim: the hints knew ssn but not iban, cardNumber, card_number, ccnum, credit-card, api_key, apiKey, x-api-key, private_key or social_security_number, and only looked at the field's attributes, so a generic name="field7" labelled "Card number" or with that placeholder got through. placeholder, title and the text of the field's <label> are hints now, in the snapshot and in the trace's attribute recording alike, and a hint is read from its first 256 characters. card on its own is not a hint, so scorecard_title and a field labelled "Card name" stay readable. SECURITY.md lists what is covered.
  • scroll has finished by the time it answers, and hover no longer bubbles its enter events. The scroll was smooth, so the tool replied while the page was still moving and the next snapshot, or a click aimed at a position measured part-way, saw a page that had not arrived; it is instant now. hover dispatched pointerenter and mouseenter with bubbles: true, though the browser never bubbles or cancels them, so a listener on an ancestor fired for a hover it should not have seen.
  • Native key preparation no longer leaves tabindex="-1" on the page's <body>. When the page did not hold focus, press_key with native: true made the body focusable to pull focus in and never undid it, so the page kept a focusable body for the rest of its life, which changes where tabbing and clicks land. The attribute is put back as it was, or removed if it was not there, whether or not the focus came.
  • A uid for an element the page has removed fails with stale_uid instead of acting on it. The uid lookup only noticed an element that had been garbage collected, but a removed node stays alive for as long as anything holds it, and frameworks routinely do, so a click or type_text on it dispatched events to a node nobody can see and reported success.
  • select_option and form_input handle selects properly. Choosing by label assigned the select's value from the option's, which picks the first option with that value, so two options sharing a value could not be told apart; disabled options were chosen though a user cannot; and only change fired, where a real choice fires input first. The option itself is now selected, a disabled one is refused with invalid_input, and both events fire in order. form_input on a <select> threw a raw "Illegal invocation" TypeError after the fields before it had been filled; a select now takes an option by value or label, and any field that cannot take its value is reported on its own line while the others proceed. The call fails only if nothing could be filled.
  • drop_file works on a drop zone inside an open shadow root. The content script finds the target through the shadow-aware lookup and marks it, but the page-world script that dispatches the drop looked for the mark with document.querySelector, which does not see into a shadow root, so every such drop failed with "Drop target not found in page" and never fell back. It now searches each open root.
  • type_text with submitKey: "Enter" follows the HTML implicit submission rules. It called form.requestSubmit() unconditionally after the key events, so a page that handled Enter itself was submitted twice, a <textarea> submitted its form although Enter there is a newline, and the form's default button was bypassed. It now submits only when the page did not cancel the key, never from a textarea or a field type that does not take part in implicit submission, by clicking the form's first submit button (nothing, if it is disabled), or, with no submit button, by submitting a form that has a single text-like field. A cancelled keydown also suppresses the keypress, as in a browser.
  • Native click, hover and drag no longer click through an overlay. The reachability check that makes a synthetic click fail with target_covered was never run for native points, so with a cookie banner over a "Delete" button a synthetic click was refused while a native one landed on the banner and reported success. The check now runs for each element a native call aims at, before the server is told where to click, and fails with the same target_covered or target_not_visible. force: true waives the cover. An element with no area is refused even then, since it has no point to aim at. The aim point is now the middle of the target's visible part, the same as the synthetic path, so an element wider than the viewport is aimed inside it instead of failing the viewport check.
  • click and hover by coordinates reach inside web components. They used document.elementFromPoint, which answers with the shadow host and never the button inside it, so a click at the visible button's position was dispatched to the component around it. They now ask each open shadow root in turn, down to the element a pointer would reach.
  • Targeting by text no longer matches text nobody can see. click, hover and find matched on textContent, which includes the contents of hidden children, <script> and <style>, so <button>Cancel<span hidden>Delete account</span></button> was clicked for the text "Delete account", and a copy inside an aria-hidden or opacity: 0 container stayed a candidate because only the element itself was checked for visibility. They now match on the rendered text, following the rules the snapshot uses to decide what to show: a hidden subtree is skipped whole, the flattened shadow and slot children are walked, form controls contribute no text, and block-level neighbours are separate words. Ambiguous matches are still refused with their UIDs.
  • Accessible names are built more carefully. A whitespace-only aria-label, <label>, alt, title or placeholder won the name with a blank and hid everything beneath it, aria-labelledby looked its ids up in the document only, so a control inside a shadow root was never named by its own label, names kept the source markup's line breaks and indentation, and a control with two labels was named by the first alone. A blank source is skipped now, whitespace is collapsed, aria-labelledby resolves in the control's own root first, and every label contributes.
  • A page can no longer make snapshot return gigabytes. The text and the name were capped at 500 characters, but an input's value, a link's href, an iframe's src, and the name taken from aria-label, an element aria-labelledby points at, a <label>, alt, title or placeholder were not, so one megabyte aria-label on an element that two thousand nodes refer to was copied into the tree two thousand times. Names, values and text are now cut to 500 characters and href and frameSrc to 2,048, find cuts the name and id it reports the same way, and a snapshot as a whole stops at 2,000,000 characters and marks the root truncated: true, the way it does at the node limit. A link whose href is an SVG object rather than a string no longer reports one.
  • Text cut to a limit is no longer cut through the middle of an emoji. Page text, snapshot text and names, find results, a click result, console and dialog capture, trace attribute values, and the replies the page-world scripts send back were all cut with a plain slice, which ends between the two halves of a surrogate pair when an astral character straddles the limit. The lone half is not valid Unicode, and a JSON encoder either rejects it or writes an escape that strict parsers refuse, so one unlucky emoji at the boundary could spoil a whole reply. Every one of those cuts now backs off to the character before. The scripts that run in the page's own world carry a copy of the helper, and a test fails if the copies drift.
  • Native press_key, hover and drag no longer stall the whole server while they wait between events. They waited with a blocking sleep on the server's own actor, about six tenths of a second for a drag, during which every other call, read-only ones included, sat unanswered. They suspend now, as native typing already did, and a cancelled drag still releases the mouse button.
  • Native type_text checks that keyboard focus is in the page, not only that Safari is in front. Safari being the active application says nothing about where the keyboard is: Command+L mid-text left the address bar holding it, and up to fifteen further characters and the submit Enter went there. Accessibility is already required, so the server now asks it whether the focused element has a web area among its ancestors, at the first key, at each 16-character recheck, and before the submit key, and fails with native_input_focus_lost if it does not. If Accessibility cannot answer, behaviour is as before. Safari being in front is also checked before the extension is asked to prepare the input rather than only after, so refused input no longer scrolls the page first. The docs named native_input_focus_failed where the server's checks report native_input_focus_lost; both exist, and the docs now say which is which.
  • A traced action now runs on the tab its trace started on. start_trace resolved the selected tab, but the action that followed was sent with no tab and resolved the selection again, so a tab switch in between put the action on one tab and the trace on another. And a run_steps batch with a trace whose first step named a different tab took that tab for the batch's own and stopped the trace there, where there was none. The trace's tab is now the batch's tab, and stopping a trace always goes to the tab it was started on.
  • Every tool that is not read-only now runs one at a time, and native input is serialised across servers. The focus lock covered native input, screenshot and select_tab, but tabs_create activates the new tab, close_tab hands focus to another, and click, form_input, resize_window and javascript_tool can all move it, so any of them could land between the extension focusing an element and the server typing into it. The lock now follows each tool's own annotation (so read_console and read_network, which clear can mutate, are in it), a run_steps batch holds it once for all its steps, and the read-only tools stay concurrent. Several servers can run at once and share one keyboard, so native input also takes an flock on a file beside the tokens; a call that cannot get it within 30 seconds fails with the retryable native_input_busy and nothing sent.
  • Arguments are refused before anything is sent when they are unknown, of the wrong type, outside their declared values, or missing. A wrong-typed argument reached the extension, where "false" is truthy: click {force: "false"} skipped the reachability check, doubleClick: "false" double-clicked, and a non-native clearFirst: "false" cleared the field. An argument the tool does not declare was ignored, so click {native: true} ran a synthetic click and a typo such as waitForSelctor did nothing. Each call is now held to the schema the tool advertises, the error names the argument and what is allowed, and run_steps applies the same check to every step while it plans, including that each file named by upload_file and drop_file opens and is not protected, so step 7 cannot be refused after steps 1 to 6 have acted. form_input with no usable fields also returns a structured invalid_input now rather than a bare error. tabs_create and resize_window declare the tabId they always honoured, and handle_dialog no longer takes post-action options it never declared.
  • read_console and read_network are no longer advertised as read-only. They were annotated readOnlyHint: true, but clear: true empties the buffer they read, so a client that auto-approved read-only tools was approving a mutation.
  • A wait, trace or snapshot that fails after an action succeeded now keeps what the action returned. The failure result carried only the error, so a caller told that waitForSelector timed out could not read what the click itself had reported; its structuredContent now holds result and whatever of wait, trace and snapshot had completed.
  • Native hover and drag no longer pick up modifier keys the user happens to be holding. Their pointer events were built from a source that reports the physical modifier state, so a held Command turned a drag into a copy or a hover into a Command-click. Typed text already cleared them; pointer events now do too.
  • Native press_key shortcuts are resolved the way macOS reads them and the refusal list is judged on the key that is posted. A Command shortcut was looked up on the keyboard layout in use, but macOS reads it from the ASCII-capable layout, so on a Russian, Greek or Dvorak-QWERTY layout Meta+c posted the key that is j there and Meta+й posted Command-Q, which the list, judging only the character you typed, let through. Command shortcuts, and the select-all of clearFirst, now use the ASCII-capable layout, and the list is checked against what the posted keycode means under it as well as against the name you gave.
  • The native press_key refusal list also covers Control with an arrow key (Spaces), F3 and F11 (Mission Control, Show Desktop), Command+Shift+3, 4 and 5 (screenshots), and Command+O, S and P (open, save and print sheets), none of which can be contained to the page.
  • A tool call cancelled while it waits for the focus lock now leaves the queue at once. The lock checked for cancellation, then queued, and a cancellation landing between the two ran its handler against an empty queue and was lost, so the call sat behind the holder, and ran its tool afterwards, although its client had given up on it.
  • snapshot names links, buttons, headings and the other roles that take their name from their content (#152). A link with inline markup, such as a search result with its query terms in bold, reported only its direct text nodes with the words from the markup as separate children, so Human <b>Brain</b> Organoids read as Human Organoids, and a link whose words all sat in child elements had no label at all. The accessible name now falls back to the element's whole text in reading order, whitespace collapsed and cut at the 500 characters text already is. It follows the same rules as the rest of the snapshot: hidden content and aria-hidden icons are left out, a nested aria-label or image alt stands in for what it wraps, it reads through open shadow roots and slots, and form controls contribute nothing, so a field's value cannot reach a name. aria-label, aria-labelledby, labels and alt still win, and so does placeholder on inputs; title is a tooltip, so on these roles it names the element only when the content is empty. text stays the element's own text, with the children keeping their own text and uids, and a node leaves name out when it would only repeat text, so plain links, buttons and headings report what they did before and name appears where it adds the full label. click and hover by text now ignore line wrapping and indentation in the page source, so the name a snapshot reports targets the element.
  • The extension notices when the last server stops. The native handler answers no_token_files when the token directory is empty, and the extension took that for a failed read and kept the final server's port and token in place indefinitely.
  • A listener that never settles can no longer hang the server's startup. The bind waited on a continuation that only resumed for .ready, .failed and .cancelled, so a listener reporting .waiting left start() suspended forever, and because the server awaited start() before serving MCP, initialize hung with it. .waiting now fails the attempt so the sweep moves on, each attempt has a two second deadline, and the bridge binds in the background: the server answers initialize immediately and tools report bridge_unavailable until it is listening.
  • A bridge that could not start now says so, and recovers by itself. When every port in the range was taken, the token could not be written, or the listener failed later, the server kept running and every tool answered bridge_disconnected with "Open Safari and click the extension icon", which sent people to fix the wrong end (#154). Those calls now fail with bridge_unavailable, carrying the recorded reason and what to do about it. status reports the requested port after a failed start instead of the last port tried, which belongs to another server and has its token file. The server also retries the bind on a backoff of 2 seconds doubling to 30, so a port that frees up brings the bridge back without restarting the MCP client.
  • The extension recovers on its own after the MCP server restarts. A restarted server writes a new token, but the extension kept redialling with the one it had cached, and the server closed on the mismatch without saying anything, so the two stayed locked out of each other until the extension's next keepalive, about 30 seconds later (#156). The server now answers a wrong token with {"auth":"error","error":"token_mismatch"} before closing, and the extension reads the token again before the next dial whenever a connection ends without having authenticated. A connection that arrives after the new server is listening but before its token is written is held until the token is published rather than closed.
  • select_tab works on a tab whose site has not been granted (#148). It asked for access to the page before pinning, so the one tab a caller most needs to pin, the one the user has yet to grant, could not be selected, and the failure was a permission_required that said nothing about selection. Selecting only records which tab later calls mean, so it no longer needs the page: it pins the tab, brings it forward, and answers success with "access": "not_granted" and a hint. The first call that reads the page still fails with permission_required.
  • navigate with back or forward, and resize_window, now report permission_required on an ungranted tab instead of riding the 30-second bridge timeout. Both reach the tab through calls Safari parks on its permission dialog, and neither asked for access first, unlike every other page-touching action. One table-driven test now enumerates every action the router can dispatch and holds each to the rule, with a commented allowlist of the browser-chrome operations that are meant to work without access (tabs_context, tabs_create, close_tab, navigate goto and reload).
  • A screenshot can no longer return another tab's pixels. It activated the tab, waited a fixed 300 ms, and captured the window, trusting that the tab was still the one showing; captureVisibleTab returns whichever tab is, so a click on another tab in that gap produced the wrong page labelled as the requested one. The window's active tab is now checked before and after the capture, and native-input preparation checks it before returning, failing with the retryable tab_not_showing on a mismatch.
  • Native input no longer types into Safari's address bar. Preparing a native type_text checked that the page's active element was the target, which stays true while the address bar or find bar holds the keyboard, so the keys went to the bar and clearFirst cleared it. Native typing, key presses, and pointer moves now check that the document itself has focus and otherwise fail with the retryable native_input_focus_failed.
  • read_console shows errors instead of {}. An Error has no enumerable fields, so console.error(err) and every unhandled promise rejection with an Error were captured as an empty object. Errors now read as Name: message followed by the stack, cut to 2,048 characters with truncated: true, and undefined, functions, symbols and BigInts are named rather than dropped.
  • The network capture can no longer break a page's own requests. fetch(url, null) threw inside the wrapper, because a default parameter only covers undefined, and XMLHttpRequest.open threw on a method that was not a string, both calls the browser accepts. A fetch(new Request(url, { method: "POST" })) was also logged as a GET; the method now comes from the Request. The wrappers pass their arguments to the native call unchanged and give up on the capture rather than fail the request.
  • javascript_tool no longer runs code twice because of what the code returns. A returned value was inspected for __cspBlocked, so a page value such as window.cartState = { __cspBlocked: true } read as a CSP refusal and the already-executed code was run again in the isolated world, doubling its side effects. The injected function now returns an envelope the user's value cannot occupy, and only a failure to compile, which happens before anything runs, can trigger the fallback; an error thrown by the code itself, even one that mentions a Content Security Policy, is reported as an error.
  • A call that names no tab now acts on one tab for its whole length. The extension looked the active tab up again at every step, once per frame of a search and once per follow-up, so a user switching tabs partway through could split one request across two pages. The router resolves the target once, hands it to every step, and reports it on the response as resolvedTabId (absent from tools that act on no tab, which report null). Closing or selecting a tab still requires one by name.
  • A page whose frames cannot be listed no longer reads as a complete page. snapshot fell back to the top frame without saying so; it now adds {"frameId": null, "origin": null, "reason": "frame_enumeration_failed"} to unreachableFrames, the same list that names a frame that will not answer.
  • A pinned tab that has closed no longer redirects the next call to whatever the user is looking at. getActiveTabId cleared the select_tab pin on any lookup failure and fell through to the active tab, so an untabbed type_text or click could land on the wrong page and succeed. It now fails with tab_closed (recovery: tabs_context, then select_tab again) and clears the pin only when the tab is confirmed gone; any other failure keeps the pin.
  • The access-permission cache answers the question it is asked. It remembered only successful probes, so a blocked tab, which is the case it exists for, was probed again on every call and a frame search paid one probe per frame until the call ran past the bridge timeout. It was also keyed by tab alone while Safari grants by origin, so a navigate followed straight away by a read reused the previous origin's grant inside the two-second window and went back to waiting on the new origin's dialog unbounded. Refusals are cached with their origin and recovery intact, and a tab that navigates loses its entry.
  • resize_window resizes the window the agent is driving. It read tabs.query({ currentWindow: true }), ignoring both tabId and the pin select_tab sets, so on a two-window setup it resized whichever window the user had clicked into and a screenshot afterwards did not match the viewport that was asked for.
  • A click on a page with iframes can no longer fire twice. Targeting by selector or text tries each frame in turn, and any failure was read as "the target is not in this frame", so a frame that resolved the target and then failed handed the same action to the next frame that matched. A click that fired before something after it threw therefore fired again somewhere the caller never named. Only target_not_found, wait_timeout and permission_required move on now; anything else is the answer. wait is also put to every frame at once rather than in turn, because a selector that is not coming cost its whole timeout per frame, so a page with a few iframes ran past the bridge timeout and reported a generic failure in place of wait_timeout.
  • A tab URL carrying ?token= or ?session= no longer reports the value. Those are the two most ordinary names in the class the redaction exists for, and neither was on its list, while the comment above it already claimed session values were covered. Presigned X-Amz-Signature URLs, jwt, sig, authorization and several other spellings are covered now too. Names that describe a secret rather than carrying one stay readable, so token_type=bearer and password_hint are unchanged. SECURITY.md documents the control and its two limits, which it did not mention at all before.
  • The extension no longer gives up on a server that is still running. Its keepalive pruned any port "disconnected for longer than two minutes", but measured that from when the port authenticated rather than from when its socket went away, and that timestamp is never refreshed. So any server up longer than the grace period was dropped the first time Safari suspended the background page, which is the ordinary reason the socket closes. Pruning also recorded the live token as stale, and the server only mints a new one when it restarts, so the bridge stayed quiet until something was restarted. It now measures how long the socket has actually been gone, and closes the socket it is dropping rather than leaving one authenticating with nothing tracking it.
  • A successful tool call is no longer reported as a failure with no reason, and a malformed frame no longer costs the full bridge timeout. The extension serialised its reply with JSON.stringify(data), which is the value undefined rather than a string when a handler returns nothing, so the whole data key vanished from the frame and the server read a success as a contentless failure. snapshot reaches this whenever the top frame answers with a falsy tree. Separately, a frame that parsed to null, a number, or a bare string was destructured without an id, and the error path then failed a second time reading that id, so no reply was sent at all and the server waited out its thirty seconds.
  • A tab waiting on Safari's permission dialog no longer hangs every call that names no tab. Resolving the active tab makes the same two calls tabs_context is deadlined for, and had no deadline at all, so one blocked tab put the whole tool surface back on the 30-second bridge_timeout with the wrong reason attached. A pinned tab blocked that way is also no longer treated as a closed one, which used to drop the caller's chosen tab over a question nobody had answered yet. select_tab and native input focus now check access before reading the tab, as screenshot already did. Navigating away from a blocked tab works rather than hanging: reading the page being left is best effort now, since leaving is the one move that gets a caller off a page they cannot use.
  • A reconnecting Safari profile can no longer be mistaken for a closed one. Connections were tracked by ObjectIdentifier, which is the object's address, and an address is handed out again once the object behind it is gone. A new connection landing where a dead one used to be inherited its profile mapping and could take delivery of a response meant for it, silently and on the wrong profile. Each accepted socket now carries a counter that cannot repeat.
  • status no longer describes one profile using another's numbers. The extension version and bridge protocol it reports were a single pair that every profile wrote to, so an old build rejected in a second profile relabelled a healthy first one with its own version, and doctor reported a mismatch for a bridge that was working. Those now come from whichever profile an untargeted call would drive, with each profile's own already listed in profiles. A build turned away for a protocol mismatch is still named when nothing is connected, which is when there is nothing better to report. A cancelled tabs_context is also no longer reported as every profile being unreachable with CancellationError given as the browser's reason. Profile ids are bounded and stripped of anything unprintable before they reach a log line or the MCP client, and the bridge tracks a fixed maximum of them rather than growing for as long as a client keeps inventing new ones.
  • A local process can no longer keep Safari from connecting, and a second handshake can no longer strand a profile. At the cap on connections awaiting authentication the bridge evicted the oldest, which is whichever one is furthest along and so most likely to be the extension mid-handshake, so anything opening sockets in a loop could starve it out: the newest is now refused instead, and a socket that opens and then says nothing gives up its slot after a deadline rather than holding it forever. A handshake is also only read before a connection has one, since taking a second under a different profile id registered the same socket twice and left the first entry reporting as connected after the socket closed. A connection rejected for a protocol mismatch now frees its slot immediately rather than only when its write completes. Frames are handled one at a time: handling and re-arming the read were separate tasks, which Swift orders however it likes, so a handshake could be overtaken by the frame behind it and have its own connection closed as unauthenticated traffic.
  • The bridge recovers from a failed bind instead of staying dead. start() set listener before knowing the bind had worked and never cleared it when the port sweep gave up, so the listener == nil guard turned every later start() into a silent no-op: once something held all ten ports in the range, nothing would listen again until the process restarted, and status reported a dead bridge with no reason attached. The sweep now releases each listener it abandons and records bridge_bind_failed with the range it tried. The bind also waits on a continuation that only .ready and .failed resumed, so a .cancelled listener left start() suspended forever and took the MCP server down with it before it could answer initialize.
  • The bridge no longer leaks a connection per reconnect, or keeps serving a socket nobody reads. Every accepted connection and every listener stored a state handler that captured it, which is a cycle that outlives cancel(), so each Safari reconnect across a sleep, wake, or extension reload left its connection and receive buffers resident for the life of the process. A receive error or a close frame also returned without dropping the registry entry, so the profile kept reporting as connected while its read loop was over and every later call to it waited out the full 30-second timeout.
  • drag no longer reports success on endpoints a real pointer could not reach. It took the raw centre of each element's rect, so a source or destination under a modal dragged without complaint, an element wider than the viewport was aimed outside it, and the destination was never scrolled into view at all, which put the drop at an off-screen coordinate whenever the target sat below the fold. Both ends are now scrolled to before either is measured, and both are hit-tested before anything is dispatched, so a refusal cannot leave the page holding a pointer down with nothing to drop. It fails with target_covered or target_not_visible the way click and hover do, and takes the same force: true.
  • click and hover no longer report success on an element the user cannot reach. Text targeting took the first ranked match, so text: "Delete" on a list of rows silently acted on one of them; it now fails with ambiguous_target and the candidates' UIDs when several elements tie. A synthetic event also reached a target under a modal or banner; click and hover now hit-test the target first and fail with target_covered naming the element a real click would reach, or target_not_visible when the target has no area in the viewport. force: true restores the old dispatch. Text matches inside a control now act on the control, so a click on a button's label focuses the button.
  • snapshot no longer returns a page with a silent hole in it. A frame it could not reach was dropped, so a tree missing a whole third-party iframe was indistinguishable from a complete one. Unreachable frames are now listed in unreachableFrames on the root, each with its frameId and origin, and the key is absent when every frame answered. This is the ordinary case rather than an exotic one: Safari's Always Allow on This Website covers the top-level page only, so every user who granted per site was reading partial pages that looked whole. A frame with no origin to grant (about:, data:, sandboxed) reports null rather than the string "null" that the URL parser produces for an opaque origin, which also fixes that string reaching permission_required messages for file:// tabs.
  • Touching a site Safari has not been asked about no longer hangs for 30 seconds. Safari asks for website access with a modal dialog and blocks every extension call for that tab until it is answered, and that dialog can open behind another window where nobody knows it exists. Every tool rode that out to the server's 30-second bridge timeout and then reported bridge_timeout, which is not what happened and is not something a retry fixes. Tab-touching calls are now probed first with a trivial injection, so a blocked tab fails in about two seconds with permission_required, the origin, and the fact that the dialog may be hidden. A blocked tabs_context and screenshot report the same way. permissions.contains is deliberately not used for this: on Safari it reports what the manifest asked for rather than what the user granted, so it answers true for origins with no access.
  • mcp-safari doctor no longer reports a matching extension version while Safari runs a different build. It read the Info.plist inside the installed app, but Safari runs whichever bundle PlugInKit registered, so a stale copy produced a clean bill of health with the wrong extension driving. The version now comes from the bundle Safari actually loaded.
  • Native input no longer tells agents to bring Safari to the front themselves. The refusal said "activate Safari and retry", so agents running in the background activated Safari with osascript and took over the user's keyboard and mouse mid-task. The refusal, the native parameter descriptions, and the screenshot hidden-page and unfocused-window notes now tell the agent to ask the user first unless the user has already allowed it, and both focus failures report recoveryAction: "ask_user". Losing focus after events were sent is no longer retryable, since a retry sends the whole input again. The native type_text description also says it types one character at a time, is not paste, and is for short input only.
  • Bridge timeouts report the actual action and deadline and no longer recommend blindly repeating a possibly completed mutation. Canceled requests stop waiting, successful/failed requests cancel their timeout tasks, and late replies cannot complete a later request.
  • File uploads validate and read one descriptor within a strict remaining byte budget, including when caller-selected paths change concurrently.
  • Token publication failure stops the listener and reports a diagnostic. Stdio shutdown removes owned per-port tokens.
  • Popup website-access status refreshes without overlapping probes and reports messaging failures.
  • An interaction that starts a page load now answers once the load has finished, and a wait no longer dies with the page it was polling (#153). click returned the moment its event was dispatched, so the next read showed the page being left, and a post-action waitForSelector or a wait sent straight after was polling inside a document that the click was about to replace. Nothing ever answered it, so it ended at the 30-second bridge timeout, reported as a bridge failure, although the new page had loaded. After click, press_key, form_input, select_option, and type_text with a submitKey, the extension now watches the tab for 400 ms and, if a navigation starts, waits for it with the same load tracking navigate uses, including single-page route changes. The result ends with Page navigated to <url>, redacted like every other URL and without a title for a site that has not been granted. A click that starts no navigation costs 400 ms; one that opens a new tab is not held for it. A wait that is pending when the tab starts loading, including a navigation the page started itself, is now sent again to the new document with the time that remains, and fails with a retryable wait_timeout that says so if that time runs out, rather than riding out the bridge timeout.
  • A click that navigates is no longer performed twice. When the page a click ran in is replaced before it can answer, Safari resolves the message with nothing, and the extension read that as "no content script here", injected the scripts and sent the click again: a pagination "Next" went two pages on, and a click by uid then failed on the new page with target_not_found. Safari does not report a tab with no content script as an error, it answers the same nothing, so an action that must not run twice first asks the frame with a ping and injects the scripts only if nobody answers; a read that changes nothing is injected into and asked again, as before. A reply that never came is treated as a click whose result was lost: if the tab loaded a page the call succeeds, says the click was dispatched and the page navigated before it could report a result, and ends with the usual Page navigated to line; if nothing loaded it fails with the new non-retryable reply_lost, which says to read the page before repeating the action. A wait, which changes nothing, is still sent again.
  • Ending a navigation no longer rides the bridge timeout on a site Safari has not decided. The read of the tab that closes navigate, and the settle after a navigating click, parked on the permission dialog with no deadline. They now give up after two seconds and answer from the last update the load delivered.
  • A closed tab is reported as closed, and a slow page keeps its grant. Every failure of the access probe, and its two second deadline, was reported as permission_required and forgot the site's stored grant, so a tab that had closed sent you to Safari's settings and a granted page that took too long to answer vanished from tabs_context. Only a deadline (the dialog is open) or Safari's own refusal now means permission_required, and only a refusal forgets a grant. Any other failure is tab_closed when the tab is gone and the original error otherwise. The origin is read again after the probe so a tab that navigated in between is not credited, and concurrent calls on one tab share a single probe.
  • A tab Safari has not loaded fails with tab_not_loaded, which says to call select_tab on it. Safari reopens a window's tabs at launch without loading them, and loads each only when it is shown, so most tabs listed after a relaunch were unreadable. The call failed with Safari's own "Could not execute script on this tab" as a non-retryable extension_error, and before that as permission_required, which also forgot the site's grant. navigate with reload does not load such a tab, and select_tab does.
  • tabs_create with a url answers once the page has loaded, as navigate does. It answered as soon as Safari made the tab, before Safari had given the tab its URL, and Safari refuses access to a tab with none, so a call made straight after it failed with permission_required on a site the user had granted.
  • snapshot, find and the selector forms of click, hover, drag, scroll and wait check website access before listing the page's frames. The listing parks on the permission dialog like any other call into the page, so these rode the bridge timeout instead of reporting permission_required.
  • Two MCP clients no longer share a select_tab pin. The pin was one value for every server connection, so a second client's calls that name no tab landed in the first client's tab. It is now kept per server, in memory and in its stored copy, and one server's pin is untouched by another's. A pin also ends with the server run that made it, so a server started later on the same port does not inherit it; it is tied to a short digest of the server's token, which changes on every start, and the token itself is never stored. A pin survives the background page being suspended and woken while the same server is running.
  • find says which frames it could not search. It dropped any frame that would not answer, and ignored a frame list that could not be read, so a short list looked complete. The structured result still carries the list as matches, and a search that left frames out adds unreachableFrames beside it, in the form snapshot uses.
  • A reused XMLHttpRequest is recorded once per request. The network capture added a listener on every send and never removed it, so the second request on an object was recorded twice and the third three times.
  • wait with seconds can no longer fail with wait_timeout. A navigation that used up the time failed a sleep, which waits for nothing; it now reports Waited N seconds, and a sleep resumed after a navigation reports the time asked for rather than the remainder.
  • A refusal seen while the stored list of granted sites is still loading is no longer undone when the list arrives. The late read was merged under what had been learned, and resurrected the site as granted, in memory and in storage.
  • The popup describes the tab you are looking at rather than one an agent pinned, startup no longer waits on a pinned tab that is parked behind Safari's dialog, and a rejected storage write is dropped quietly instead of surfacing as an unhandled promise rejection.
  • screenshot and native input no longer fail with tab_not_showing when a window of the same profile is showing one of Safari's pinned tabs. Safari lists a profile's pinned tabs once for every window, each copy with the same id and active flag. So asking which tab a window shows also returned another window's pinned tab, first, and the check read that as the user having switched tabs. A call that names no tab could also land on that pinned tab. tabs_context no longer lists a pinned tab once per window.

Security

  • Releases are harder to tamper with. A release is signed and published only from a tagged commit on main, after the full test suite on both supported toolchains and a dependency audit pass, with every workflow action pinned to a commit. The signing certificate is available only to the signing step and is deleted straight after it. Before anything is published, the app and every mcp-safari binary are checked for a valid signature from the expected team, the hardened runtime, Apple's accepted notarization and Gatekeeper acceptance, and for none of the entitlements that allow debugging or loading unsigned code.
  • The token-directory guard for upload_file, drop_file, navigate and tabs_create had three gaps, now closed. /System/Volumes/Data/Users/... names the same files as /Users/... but resolves to a different string, so the data volume prefix is now ignored when paths are compared. Safari reads a backslash in a file: URL as a slash while Foundation does not, so a file: URL with a backslash or %5C in its path is refused. And a hard link to a token file opens under its own name, which the descriptor's path check cannot connect to the token, so a file with more than one link is now compared by device and inode with the files in the protected directories.
  • The extension forwards a token file only if it is one. It used to read anything named like a port, of any type and size, and pass the text to the background script, so a FIFO could hang the open and a symlink could aim the read at an unrelated file. Each file is now opened without following a symlink, must be a regular file of at most 256 bytes, and must parse as a UUID; port filenames must be canonical, so +80 and 0080 no longer alias port 80. A directory that is itself a symlink still works.
  • The native message handler no longer echoes unknown messages back, and no longer puts the home directory in its error. An unrecognised message gets {"error": "unsupported_message"}, a missing token gets {"error": "no_token_files"}, and the log records a fixed word rather than the message.
  • The sandbox grants are narrower. The extension's read exception covers ~/Library/Application Support/MCPSafari/tokens/ instead of the whole MCPSafari folder, and com.apple.security.files.user-selected.read-only is dropped from both the app and the extension, since neither opens a file panel. The two .entitlements files are now the only source: the app target names its file explicitly and the ENABLE_* build settings that used to synthesise a second copy are gone, so a local build and the release signing carry the same entitlements.
  • The bridge refuses WebSocket upgrades from web pages. Browsers do not apply same-origin to WebSockets, so a page on any site could open a socket against a loopback port and occupy one of the few handshake slots until its deadline, in the way that kept Safari from connecting before the cap was fixed. Safari sends Origin: safari-web-extension://<per-profile UUID> for the extension, measured on a real run, so an upgrade carrying any other Origin is refused at the upgrade and its connection closes at once. A request with no Origin, which is every client that is not a browser, is admitted as before, and the token handshake is still what authenticates. Resolves #121.
  • The bridge token no longer crosses the WebSocket, and the server has to prove it holds it before the extension acts on anything. The extension used to send the token in its first frame and to treat any {"auth":"ok"} as proof of the server, so a local process that had taken a port the extension was configured for was handed the token and could then answer requests as if it were the server. The handshake is now mutual challenge-response: the extension sends a random nonce, the server answers with its own nonce and an HMAC-SHA256 proof keyed with the token, the extension verifies that proof with WebCrypto before sending its own, and the server verifies the extension's in constant time. The proofs have distinct labels and nonce orders, so neither can be reflected as the other, and they include the port and both nonces, so a captured exchange cannot be replayed. Out-of-order frames close the connection, and the handshake slot cap and deadline cover the whole exchange. SECURITY.md describes it step by step.
  • The server writes the bridge token to one place instead of three. Dropping the ~/.config/mcp-safari/ copies and the shared token file removes two readable copies of the secret that nothing could use, one of which another process could replace between a check and a use.
  • The bridge compares the handshake token byte by byte without stopping at the first difference. String == returns early, so a wrong guess took longer the more of it was right.
  • An unauthenticated connection has less room to occupy the bridge. The time a socket may sit before completing its handshake drops from 10 seconds to 2, since the real extension sends it within milliseconds of opening, and a first frame larger than 4 KiB is closed without being decoded. The listener-wide limit of 32 MiB, which tool responses need, previously applied to a peer that had not yet proved it held the token. SECURITY.md also said a ninth waiting connection evicts the oldest; since the flood fix it refuses the newest, and the text now says so.
  • Token files no longer outlive the server that wrote them. The server removed its tokens only when its stdio loop ended, so SIGTERM, SIGINT, SIGHUP or a crash left a live-looking token on disk for a port nothing served, or that another program had since taken. The server now handles those three signals by stopping the bridge before it exits, and ignores SIGPIPE. Each token file also has a <port>.pid file beside it naming its owner, and a starting server deletes the tokens whose owner is no longer running. The token file's own contents are unchanged.
  • The extension dials the bridge at 127.0.0.1 rather than localhost. The server binds the IPv4 loopback address only, but the name localhost can resolve to ::1 first, where a different local user could be listening and would receive the handshake, token included.
  • A caller can no longer ask for unbounded output. maxChars, maxNodes and maxResults took any positive integer, so read_page {maxChars: 2000000000} or snapshot {maxNodes: 1000000} asked the page for as much as it had. They are now brought down to documented maxima (1,000,000 characters, 10,000 nodes and 1,000 results, against defaults of 100,000, 2,000 and the buffer size) rather than refused, and the tool descriptions state them.
  • run_steps now validates every step's arguments before it runs the first one. The header of the plan said the batch was checked up front, but only the tool names, reserved keys and tab handles were; a step's URL scheme, navigation action, wait length and wait options, native key combination, native text length and file arguments were checked when that step ran, so a bad URL in step 3 was reported after steps 1 and 2 had already acted on the page and could not be taken back. The plan now runs the same validation each step's handler runs over every step, and names the step and tool in the refusal.
  • A bad waitForSelector, waitForText, waitTimeout or trace option can no longer be reported after the action it belonged to has already run. They were validated only in the post-action step, so click {waitForSelector: ""} clicked and then failed, and a caller who fixed the argument and retried submitted the form twice. traceDuration was likewise checked only after start_trace had been sent, leaving a trace running that nothing stopped. Every option is now read, with its type, before the action or the trace is sent, for every tool that accepts them. includeSnapshot is held to a boolean in the same step.
  • The URL scheme check and the filter pattern check now hold on the server instead of resting on how Foundation and the page happen to behave. navigate and tabs_create judged the scheme from URL(string:), which is not how Safari reads a URL: WebKit drops leading and trailing control characters and spaces and deletes tabs and newlines before looking for the scheme, so a string such as jav<tab>ascript: is a javascript: URL to the browser. The scheme is now taken from the normalized string, and the normalized string is what is sent. read_console and read_network checked only length and compilability on the server and left the bounded subset (no repetition, groups or backreferences) to the page-world filter, which a page can rewrite; the server now enforces the same rule, counting the 200-unit limit in UTF-16 code units as the page does, so (a+)+$ is refused before the extension sees it.
  • A wrong-typed optional argument is refused instead of being read as absent. The handlers read args["x"]?.stringValue and friends, which cannot tell a missing key from one of the wrong type, so select_tab {bringToFront: "false"} activated the tab, read_console {pattern: 5, clear: true} cleared the buffer without filtering it, read_network {status: "500"} returned every request despite the documented promise that a rejected filter never returns unfiltered data, and resize_window {width: 800.0} sent no width at all. Shared helpers now throw invalid_input naming the key when it is present with the wrong type, and accept whole-valued doubles such as 800.0 where an integer is wanted. resize_window now requires both width and height as positive integers of at most 10,000. The parameter checks of the non-interaction tools moved into one place that both the handlers and a new pre-dispatch step use, and navigate/tabs_create and read_console/read_network now share one URL check and one pattern check instead of two copies each. Their refusals are now structured invalid_input failures rather than bare error text.
  • A call that names no tab now keeps to one tab across its own follow-ups. The action, its post-action wait, its includeSnapshot snapshot and the end of its trace were separate requests that each resolved "the selected tab" for themselves, so a tab switch between them (by the user, or by a parallel select_tab) sent the wait and the snapshot to a different page than the one acted on. The extension now reports the tab it resolved on every reply as resolvedTabId, and the server addresses the follow-ups to it. A run_steps batch with no tabId pins the first step's tab for every later step, its final snapshot and its trace. An extension that does not send the field behaves as before.
  • A tab on a site Safari has not granted is reported as such rather than left for the next read to discover. tabs_context, tabs_create and select_tab mark each tab access: "granted" or "not_granted" with an accessHint, and select_tab on an ungranted tab succeeds. The server pins the tab's profile as for any other selection and adds one sentence to the result, once for a whole tabs_context listing rather than per tab, saying that reading or acting on those tabs will fail with permission_required until the user grants the site, followed by the extension's hint.
  • Parallel tool calls can no longer steal focus from each other mid-action. Native input, screenshot and select_tab each ask the extension to focus a tab or element and only then act, and the server awaits between the two steps. The MCP SDK runs every request in its own task, so another call could run in that gap, focus something else, and receive the first call's keystrokes or click. These tools now take a first-in-first-out lock that is held from the prepare step through the act step, and release it on every exit including cancellation. select_tab takes it only when it brings the tab to the front, and the rest of the tool surface is not queued behind it.
  • Native hover and drag no longer click through to another app. The only guard was that Safari was the active application, which says nothing about what is drawn at the target: a Finder window, the Dock or the menu bar over part of the page took the real pointer event instead. The server now walks the on-screen windows front to back and refuses, with native_input_focus_lost and nothing sent, unless the topmost one at each target point belongs to Safari. A drag checks both ends before the button goes down. Only fully transparent windows and the window server's cursor window are ignored; every other layer counts, because the Dock and menu bar take clicks like any window.
  • Native press_key no longer sends shortcuts that quit or leave Safari. It accepted any modifier combination, so a prompt-injected page or a confused agent could post Command-Q, Command-W, Command-Tab, Control-Command-Q (lock) or Command-Option-Shift-Q (log out) as a real key event, which nothing in the page can contain. A short named list is refused with invalid_input before anything is sent: Command with Q, W, H, M, Tab or Space, Control-Space, Command-Option-Escape, and Command-Shift-Delete, with any extra modifiers. The check follows the character the caller named rather than the resolved keycode, so AZERTY's remapped q is caught too. The list is in docs/tools.md.
  • Native type_text no longer runs unbounded on the server. It had no length limit, checked that Safari had focus only before and after the whole text, and posted every keystroke synchronously on the server actor, so a long text stalled every other tool call and kept typing into whatever app had taken focus. Text over 1,000 characters is now refused with invalid_input pointing at the non-native type_text; focus is re-checked every 16 characters, and losing it stops the call with an error saying how many characters were delivered. A cancelled call stops typing, and the keystrokes are posted off the actor with a suspension between them rather than holding it. Typed characters also no longer inherit modifier keys the user is physically holding, which turned a typed q into Command-Q.
  • Native type_text with clearFirst no longer quits Safari on a French or Belgian keyboard. It selected the field's text with Command plus the fixed keycode 0, which is a on QWERTY and q on AZERTY, so the "select all" was Command-Q. The key is now looked up on the active layout the way press_key already did, and a layout with no plain a key is refused with invalid_input before anything is sent. Nothing falls back to keycode 0.
  • screenshot with filePath can no longer overwrite arbitrary files. It wrote the capture to any path the account could write, so a prompt-injected agent could replace ~/.zshrc, an SSH authorized_keys or a LaunchAgent with a PNG. The path must now end in .png (case-insensitively), an existing target must be a regular file that already begins with the PNG signature (a symlink, a directory or any other file is refused and left alone), and the bridge token directories are refused. New files are created with mode 0600, since a page can show anything, and an existing PNG keeps its mode. The write goes to a temporary file in the same directory that is renamed into place, so a failed save leaves the previous file untouched, and the destination is checked before the extension scrolls anything into view.
  • upload_file, drop_file and file: navigation can no longer read the bridge token. They read any path the caller named, and the token files under ~/Library/Application Support/MCPSafari/ and ~/.config/mcp-safari/ are readable by the same account, so an agent steered by a page could attach the token to a form or open it in Safari and read it back, and the token authenticates anything that can reach the bridge. Both roots are refused now, and are named explicitly rather than taken from what the bridge currently writes, so a token left behind in ~/.config/mcp-safari stays off limits after the bridge stops writing there. The file tools check the resolved path of the open descriptor, so symlinks, a ~/.config symlinked into a dotfiles repository, .. segments and a different spelling of the case all land on the same answer; navigate and tabs_create apply the same rule to file: URLs after resolving symlinks. A hard link made elsewhere to a token file is not covered, since a file carries no record of its other names.
  • tabs_context no longer reports the URL and title of tabs on sites you have not granted (#150). Safari's tabs API returns both for every open tab, which made the tool a window onto your browsing history. A tab on a site MCPSafari has not reached still appears with its handle, window and state, so it stays usable, but carries "access": "not_granted" and a hint that the user can grant the site from the MCPSafari toolbar button; tabs it can describe carry "access": "granted". tabs_create and navigate withhold the page title the same way. A site counts as reached once a call has run on it, because checking ahead would raise Safari's permission dialog for each site, so a site you have just granted reads as not granted until something touches it. Sites a call has succeeded on are remembered across Safari restarts (up to 500, the one confirmed longest ago dropped first) and forgotten the moment a call to them is refused, so a site revoked in Safari Settings keeps showing its URL and title until then.
  • A hostile page can no longer take the bridge down through a tool result. The extension returned whatever the page world answered a console, network or trace read with, and the page shares that channel: it can answer first, or replace window.__mcpGetConsoleMessages, with data far past the documented 8192, 2048 and 4096 caps. One oversized frame exceeds the bridge's 32 MiB limit and drops the connection for every Safari profile. Replies are now re-validated in the isolated world: they must be plain data of the right shape, lists are cut to 1,000 messages, 500 records or 1,001 events, strings to their caps, and the total to a fixed size, with truncated: true where something was cut. Request ids are random rather than derived from the clock.
  • URL credential redaction is broader and no longer stops at tab listings. It matched a hand-kept list of whole parameter names, so auth_token, oauth_verifier, csrf_token and X-Goog-Signature came back verbatim, and it ran only on tab URLs. Names are now percent-decoded, split into words and matched on those (token, secret, key, sig, password, auth, session, otp, ticket, verifier, credential and more), with descriptive names such as token_type and password_hint still readable. Userinfo (https://user:pw@host) is replaced, and the same redaction now covers read_network URLs, trace event URLs, and the href of links in a snapshot.
  • A trace no longer records what a user types. The DOM mutation capture wrote the old and new value of every attribute change, and frameworks mirror a typed password into the value attribute, so a traced type_text into a login form returned the password in the trace. value and checked are never recorded now, nor any attribute of a field snapshot would redact; those events say valueOmitted: true. Other attribute values are cut to 512 characters with truncated: true. The page-world interceptor cannot read the snapshot's rule, so it carries a copy, and a test fails if the two drift apart.
  • A tab on a site you have not granted no longer shows where it went. navigate (reload and goto need no access to the page), back, forward and the Page navigated to note after a click withheld the landing page's title but still printed its redacted URL, including a redirect or a history entry nobody asked for, and tabs_create with no URL returned the browser's homepage. They now name the origin only, with a note that the URL and title are withheld, as tabs_context does.
  • read_network's urlPattern can no longer be used to read a redacted secret. The filter ran in the page against the URL as requested, credentials included, so a caller could narrow a pattern one character at a time and watch which entries came back. It is now applied in the extension to the URL as reported, after redaction, with the same bounded pattern rules; maxResults and clear apply to the entries that matched.
  • A trace redacts the URL values in DOM mutations. The old and new value of an href, src or action attribute, or of any attribute holding an absolute URL, went out with its credentials.
  • URL credential redaction covers more spellings. Userinfo in //user:pw@host and https:\\user:pw@host; parameters separated by ;; a path parameter such as ;jsessionid=; a token percent-encoded inside another parameter's value; and the names pass, SAMLResponse, client_assertion, bearer and PHPSESSID.
  • snapshot redacts more of what a form holds. It relied on type="password" or an autocomplete token, so a password revealed by a show-password toggle (the type flips to text), a field named pin, otp, cvv, ssn, secret, token or 2fa, and any sensitive <textarea> came back verbatim. A field that was ever a password on the page stays redacted, and name, id, aria-label, inputmode and autocomplete are now read for secret words. Whole words are matched for the short ones, so shipping and passenger stay readable. A sensitive textarea also no longer repeats its default text.
  • The extension now asks Safari for the cookies permission, which clear_cookies needs. With it, MCPSafari can see the cookies of the sites you've allowed it on, sign-in cookies included. It only ever deletes them, and only for clear_cookies. To tell a site from a domain that many sites share, the extension carries a copy of the Public Suffix List; SECURITY.md says how it's kept up to date.

Installation

brew trust --formula epistates/tap/mcp-safari-server
brew install --cask epistates/tap/mcp-safari

To upgrade, name both parts in full, server first:

brew upgrade epistates/tap/mcp-safari-server
brew upgrade --cask epistates/tap/mcp-safari

See setup instructions for manual installation and client configuration.