ZenLink MCP

v2.1.3
io.github.JayQuan-McCleary/zenlink-mcp Checked 3 days ago Published 9 days ago

Browser automation for MCP clients via Zen Browser.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

zen_status

Check if ZenLink bridge and browser extension are connected.

zen_tabs

List all open browser tabs with their IDs, titles, and URLs.

zen_page_info

Get current page URL, title, dimensions, and scroll position. Args: tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
tab_id

zen_page_text

Extract all readable text from the current page. Args: tab_id: Optional tab to target. Defaults to active tab. For non-active tabs, prefer this with tab_id over zen_page_text_by_tab_id — they do the same thing now.

ParameterTypeDescription
tab_id

zen_page_text_by_tab_id

Get page text from a specific tab by ID without switching to it. Args: tab_id: The tab ID to read from (get IDs from zen_tabs) Returns the full visible text content of the specified tab.

ParameterTypeDescription
tab_id *integer

zen_forms

Get all form fields on the current page with their labels and values. Args: tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
tab_id

zen_dom

Get the accessibility tree of interactive elements on the page. Args: tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
tab_id

zen_screenshot

Capture a screenshot of the current page. Returns the saved file path. Note: screenshots are inherently visual and capture the active tab of the focused window. To screenshot a specific tab, switch to it first with zen_switch_tab.

zen_navigate

Navigate the active tab to a URL. Args: url: The URL to navigate to (e.g. "https://example.com") tab_id: Optional tab to navigate. Defaults to active tab. raw: Bare image URLs (.jpg/.png/...) open inside a small local viewer page (image = #zlimg) so the extension can still script them. True opens the raw image.

ParameterTypeDescription
url *string
rawboolean
tab_id

zen_new_tab

Open a new browser tab. Args: url: URL to open in the new tab (default: blank page) raw: Bare image URLs open inside a local viewer page (image = #zlimg) unless raw=True.

ParameterTypeDescription
rawboolean
urlstring

zen_close_tab

Close a browser tab by its ID. Args: tab_id: The tab ID to close (get IDs from zen_tabs) force: Disarm "Leave page?" (beforeunload) prompts first - upload/editor pages otherwise hold the tab open and the close times out.

ParameterTypeDescription
tab_id *integer
forceboolean

zen_switch_tab

Switch focus to a specific browser tab. Args: tab_id: The tab ID to focus (get IDs from zen_tabs)

ParameterTypeDescription
tab_id *integer

zen_click

Click an element on the page by CSS selector or coordinates. Args: selector: CSS selector to click (e.g. "#submit", ".btn-primary") x: X coordinate (used if selector is empty) y: Y coordinate (used if selector is empty) tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
selectorstring
tab_id
xinteger
yinteger

zen_trusted_click

Click using the real OS mouse pointer for pages that reject synthetic DOM events. This is slower and moves the user's cursor, so prefer zen_click unless a page specifically ignores synthetic clicks. The tab must be the visible tab in its window. Viewport points are mapped to physical screen pixels with devicePixelRatio, so zoomed pages (80%, 125%, ...) are hit correctly (bridge 2.1.2+). Check `ok`, not just the absence of an exception: `ok` is false when the click was not sent (`clicked: false` - the tab is hidden, or another window covers the point) or when the…

ParameterTypeDescription
check_windowboolean
coordinate_spacestring
focusboolean
selectorstring
tab_id
verifyboolean
xinteger
yinteger

zen_type

Type text into an input field. Args: selector: CSS selector of the input element text: Text to type clear: Whether to clear existing text first tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
selector *string
text *string
clearboolean
tab_id

zen_set_editable_content

Set text or HTML in a contenteditable editor, input, or textarea in one fast operation. Use this for rich editors such as Gmail compose bodies where typing long text is slow. Args: selector: CSS selector or ZenLink ref for the editable element value: Text or HTML to place into the editor format: "text" for plain text or "html" for trusted HTML clear: Whether to replace existing content instead of appending tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
selector *string
value *string
clearboolean
formatstring
tab_id

zen_fill

Set a form field's value directly (faster than typing). Args: selector: CSS selector of the input/select element value: Value to set tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
selector *string
value *string
tab_id

zen_scroll

Scroll the page. Args: direction: Scroll direction - "up", "down", "left", or "right" amount: Pixels to scroll tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
amountinteger
directionstring
tab_id

zen_hover

Hover over an element on the page. Args: selector: CSS selector of the element to hover over tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
selector *string
tab_id

zen_find

Find elements on the page using natural language description. Args: query: What to find (e.g. "login button", "search bar", "email input") tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
query *string
tab_id

zen_js

Execute JavaScript in the current page context. Args: code: JavaScript code to run (e.g. "document.title" or "document.querySelectorAll('a').length") tab_id: Optional tab to target. Defaults to active tab. full: Results are capped at 8 MB (50 KB on extensions older than 2.1.0). full=True runs the code once and reads the result back in slices, so any size comes back complete.

ParameterTypeDescription
code *string
fullboolean
tab_id

zen_highlight

Highlight an element on the page with a visual overlay. Args: selector: CSS selector of the element to highlight tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
selector *string
tab_id

zen_wait_for_element

Wait for a CSS selector to appear and become visible on the page. Returns immediately when the element is found, rather than sleeping a fixed duration. Use this instead of sleep when waiting for dynamic/JS-rendered content. Args: selector: CSS selector to wait for (e.g. ".tracking-events", "#results", "[data-loaded]") timeout: Maximum time to wait in milliseconds (default: 10000 = 10s) poll_interval: How often to check in milliseconds (default: 200ms) tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
selector *string
poll_intervalinteger
tab_id
timeoutinteger

zen_wait_for_result

Poll a JavaScript expression until it returns a non-empty result. Args: code: JavaScript expression to evaluate repeatedly timeout: Maximum time to wait in milliseconds poll_interval: How often to check in milliseconds tab_id: Optional tab to target. Defaults to active tab.

ParameterTypeDescription
code *string
poll_intervalinteger
tab_id
timeoutinteger

zen_workflows

List available named ZenLink workflows from the bridge workflow directory.

zen_workflow

Execute a named ZenLink workflow from the bridge workflow directory. Args: name: Workflow file name without .md variables: Optional template variables for the workflow

ParameterTypeDescription
name *string
variables

zen_cache

Control the ZenLink bridge response cache. Args: action: "clear", "status", or "ttl" seconds: TTL value when action is "ttl"

ParameterTypeDescription
actionstring
seconds

zen_wake_tab

Revive a tab that Zen's Tab Unloader may have discarded. Zen aggressively unloads inactive tabs to save RAM. An unloaded tab still appears in zen_tabs but has no live content script — commands targeting it will hang or fail until it's reloaded. zen_wake_tab is idempotent: if the tab is already alive it returns immediately; otherwise it reloads the tab and waits for the page to finish loading. Use before targeting a tab that might have been idle for a while. Prefer zen_keep_alive for tabs you'll touch repeatedly. Args: tab_id: The tab ID to wake (get…

ParameterTypeDescription
tab_id *integer

zen_keep_alive

Keep tabs warm so Zen's Tab Unloader won't discard them mid-workflow. Starts a background pinger in the bridge that fires a no-op JS evaluation at each listed tab on the given interval. Any script access resets Zen's idle timer, so the tabs stay loaded. Replaces any existing keep-alive for the same tabs (use a new interval to change cadence). Use this at the start of parallel multi-tab work: open your tabs, call zen_keep_alive with their IDs, drive them in parallel via zen_parallel or by passing tab_id to individual commands, then zen_keep_alive_stop when done…

ParameterTypeDescription
tab_ids *array
interval_secondsinteger

zen_keep_alive_stop

Stop the keep-alive pinger for some or all tabs. Args: tab_ids: Tabs to stop pinging. Omit (or pass null) to stop all.

ParameterTypeDescription
tab_ids

zen_reload_extension

Hot-reload the ZenLink extension in the browser. Use this after editing the extension source to pick up changes without going through `about:addons` and toggling the extension by hand. The extension acks the request, then reloads itself ~100ms later; the background script's existing reconnect logic re-establishes the bridge WebSocket immediately. Content scripts in open tabs survive — they re- inject lazily on the next command (see forwardToContent in background.js). Note: only works once you're already on a version of the extension that has this action hand…

zen_parallel

Run command sequences in parallel — typically one sequence per tab. Each inner list is a sequence that runs serially; all sequences run concurrently. Commands that target a specific tab (navigate, switchTab, or any tab-aware action) MUST include "tabId" inside the parallel batch to avoid race conditions over the active tab. Returns a list of result lists, one per input sequence. Args: sequences: List of command sequences. Each command is a dict with "action" and parameters — same shape as zen_batch commands. Example for driving two…

ParameterTypeDescription
sequences *array

zen_query

Extract multiple fields from every element matching a CSS selector. Much faster and cheaper than calling zen_js per element. The default fields cover the common ones (text, href, value, src, alt, id, name); pass `fields=["text","data-foo","bounds","attrs"]` to get arbitrary attributes or `bounds`/`attrs`/`html` extras. Args: selector: CSS selector. fields: Field names to extract per element. Defaults to a useful set. limit: Max elements to return (capped at 500). tab_id: Optional tab; defaults to active.

ParameterTypeDescription
selector *string
fields
limitinteger
tab_id

zen_html

Return the outerHTML of a specific element. Cap 100KB.

ParameterTypeDescription
selector *string
tab_id

zen_images

Return every <img> with src, alt, and natural dimensions.

ParameterTypeDescription
tab_id

zen_meta

Return all meta tags + link rels (canonical, RSS, icons, etc.).

ParameterTypeDescription
tab_id

zen_structured_data

Extract JSON-LD blocks, OpenGraph (og:*), and Twitter card meta.

ParameterTypeDescription
tab_id

zen_bounds

Return getBoundingClientRect + viewport/page sizes for an element.

ParameterTypeDescription
selector *string
tab_id

zen_computed_style

Return computed CSS for an element. Defaults to the layout-relevant set.

ParameterTypeDescription
selector *string
properties
tab_id

zen_readability

Extract the main article on the page (title, byline, clean text). Heuristic: score candidate containers (`article`, `main`, `.post`, etc.) by text density × paragraph count × inverse link density, strip nav/aside, return the winner. Falls back to densest section/div, then body.

ParameterTypeDescription
tab_id

zen_markdown

Convert the page (or a selector subtree) to Markdown. Cap 80KB.

ParameterTypeDescription
selector
tab_id

zen_iframes

List all iframes with src + same-origin/accessible flags.

ParameterTypeDescription
tab_id

zen_explain_selector

Diagnose a CSS selector: match count, sample matches, suggestions for a more-specific selector if you got too many.

ParameterTypeDescription
selector *string
tab_id

zen_select_option

Choose an <option> in a <select>. Default matches by value; pass `by_text=True` to match by visible text.

ParameterTypeDescription
selector *string
value *string
by_textboolean
tab_id

zen_check

Set a checkbox or radio's checked state.

ParameterTypeDescription
selector *string
checkedboolean
tab_id

zen_focus

Move focus to the matched element.

ParameterTypeDescription
selector *string
tab_id

zen_blur

Blur an element (or document.activeElement if no selector).

ParameterTypeDescription
selector
tab_id

zen_keypress

Dispatch a synthetic keyboard event. Use modifiers like `{"ctrl": True, "shift": True}`. Pass `text` to also insert characters into editable targets. Args: key: Key name, e.g. "Enter", "Tab", "Escape", "ArrowDown", "a". selector: Optional element to target. Defaults to document.activeElement. modifiers: {"ctrl"|"shift"|"alt"|"meta": True}. text: If set, also insert this text into editable targets.

ParameterTypeDescription
key *string
modifiers
selector
tab_id
text

zen_double_click

Dispatch a synthetic double-click on the matched element.

ParameterTypeDescription
selector *string
tab_id

zen_submit_form

Submit a form. If selector is omitted, submits the first <form> found.

ParameterTypeDescription
selector
tab_id

zen_form_fill

Fill many fields at once via fuzzy matching. Each key in `fields` is matched as: CSS selector → name attribute → label text (case-insensitive contains) → placeholder. Each value is applied via the appropriate setter (.value for inputs/textareas, .checked for checkboxes/radios, value for selects). Returns per-key results. Args: fields: {"email": "foo@bar", "Password": "...", "#submit-target": true}

ParameterTypeDescription
fields *object
tab_id

zen_drag

Synthetic drag-and-drop from one element to another (HTML5 drag events).

ParameterTypeDescription
from_selector *string
to_selector *string
tab_id

zen_click_and_wait_navigation

Click an element, then wait for the resulting navigation to complete. Atomic operation — far more reliable than `zen_click` followed by `zen_wait_for_url` for links/submit buttons. Listens for tabs.onUpdated(status='complete').

ParameterTypeDescription
selector *string
tab_id
timeoutinteger

zen_upload_file

Attach local file(s) to a page's upload control - no OS file dialog. The bridge reads the file from disk and streams it into the page, which builds real File objects and sets them on the <input type=file> (firing input + change). If the selector is a drop zone with no input inside, it fires dragenter/dragover/drop. Args: path: absolute file path, or a list of paths for multi-file inputs. selector: the file input, an element containing it, or a drop zone. Omit to use the first input[type=file] on the page. mode: "auto" (input if found,…

ParameterTypeDescription
path *
modestring
selector
tab_id

_save_png

Write the bridge's PNG data URL to a file and return the path instead of the image data. (2.1.2: a returned data URL is ~100K+ characters and blew straight into the caller's context.)

ParameterTypeDescription
data_url *boolean
prefix *string
r *object
save_to *

zen_element_screenshot

Screenshot a single element. Scrolls into view, captures, crops in the extension via OffscreenCanvas. Saves a PNG and returns its path (saved_to). Args: selector: CSS selector of the element tab_id: Optional tab to target. Defaults to active tab. save_to: Optional file path (default: ~/claude-zen-screenshots/element_<time>.png) data_url: Also return the PNG data URL (large - only if you really need the bytes inline) scale: 1-4 output pixels per CSS pixel. 2 = genuinely sharper capture at twice the size (needs extension 2.1.1+; old…

ParameterTypeDescription
selector *string
data_urlboolean
save_to
scalenumber
tab_id

zen_full_page_screenshot

Scroll-and-stitch screenshot covering the full document height (up to 30 viewports tall). Saves one PNG of the entire page and returns its path (saved_to). Args: tab_id: Optional tab to target. Defaults to active tab. save_to: Optional file path (default: ~/claude-zen-screenshots/fullpage_<time>.png) data_url: Also return the PNG data URL (large)

ParameterTypeDescription
data_urlboolean
save_to
tab_id

zen_full_page_metrics

Return document/viewport sizes + scroll position + devicePixelRatio.

ParameterTypeDescription
tab_id

zen_pin_tab

Pin or unpin a tab.

ParameterTypeDescription
pinnedboolean
tab_id

zen_mute_tab

Mute or unmute a tab.

ParameterTypeDescription
mutedboolean
tab_id

zen_duplicate_tab

Duplicate a tab. Returns the new tab id.

ParameterTypeDescription
tab_id

zen_reload_tab

Reload a tab. Pass `bypass_cache=True` for a hard reload.

ParameterTypeDescription
bypass_cacheboolean
tab_id

zen_back

Go back in history (browser back button).

ParameterTypeDescription
tab_id

zen_forward

Go forward in history.

ParameterTypeDescription
tab_id

zen_get_zoom

Return the current zoom factor (1.0 = 100%).

ParameterTypeDescription
tab_id

zen_set_zoom

Set zoom factor. 0.3 to 5.0 typical; 1.0 = 100%.

ParameterTypeDescription
factor *number
tab_id

zen_windows

List all open browser windows with their tabs.

zen_create_window

Open a new browser window. Pass a URL to load it at start.

ParameterTypeDescription
incognitoboolean
url

zen_close_window

Close a browser window by ID (from zen_windows).

ParameterTypeDescription
window_id *integer

zen_focus_window

Bring a browser window to the foreground.

ParameterTypeDescription
window_id *integer

zen_move_tab

Move a tab to a position (and optionally to a different window). -1 = end.

ParameterTypeDescription
tab_id *integer
indexinteger
window_id

zen_detach_tab

Pop a tab out into its own new window.

ParameterTypeDescription
tab_id *integer

zen_cookies

Cookie operations: "get", "set", "remove", "clear". - get: returns matching cookies (use url/domain/name to filter). - set: requires url + name + value. - remove: requires url + name. - clear: clears all cookies for url or domain.

ParameterTypeDescription
op *string
domain
name
path
secureboolean
url
value

zen_storage

localStorage / sessionStorage ops. Args: kind: "local" or "session". op: "get" | "set" | "remove" | "clear" | "list" | "snapshot" | "restore". key: Required for get/set/remove. value: For set, the string value. For restore, a dict of key→value. tab_id: Tab to run against. Storage is per-origin, so prefer driving it on a tab already at the right origin.

ParameterTypeDescription
kind *string
op *string
key
tab_id
value

zen_clipboard

Read or write the system clipboard. Args: op: "read" or "write". text: Text to write when op="write".

ParameterTypeDescription
op *string
text

zen_downloads

Downloads operations. Args: op: "download" | "list" | "cancel". url: For "download", the URL to fetch. filename: Optional output filename. query: For "list", a downloads.search query dict.

ParameterTypeDescription
op *string
filename
query
url

zen_clear_browsing_data

Clear browsing data of the given types. Args: types: Which to clear. Subset of ["cache","cookies","history", "localStorage","passwords","downloads"]. Default = all of those. since_ms: Only data created since this epoch-ms timestamp.

ParameterTypeDescription
since_ms
types

zen_intercept

Block, log, or redirect HTTP requests by URL regex. Useful to suppress analytics/ads during agent runs (3–10× page speed-up) or to log what an SPA actually fetches. Args: op: "add" | "clear" | "list" | "log" | "clearLog". patterns: For "add", regex patterns to match against request URLs. effect: For "add", "block" (cancel request) or "redirect".

ParameterTypeDescription
op *string
effectstring
patterns

zen_capture_network

Capture network requests via the page's PerformanceObserver. Args: op: "start" begins capturing fresh, "stop" pauses, "read" returns the buffer (default), "clear" empties it. since: When reading, only return entries with startTime >= since (ms). tab_id: Optional tab; defaults to active.

ParameterTypeDescription
opstring
sinceinteger
tab_id

zen_wait_for_network_idle

Wait until no new network resources have started for `idle_ms`.

ParameterTypeDescription
idle_msinteger
tab_id
timeoutinteger

zen_wait_for_url

Wait until the tab's URL matches a JS regex pattern.

ParameterTypeDescription
pattern *string
tab_id
timeoutinteger

zen_wait_for_title

Wait until document.title matches a JS regex pattern.

ParameterTypeDescription
pattern *string
tab_id
timeoutinteger

zen_watch_console

Toggle console capture on a tab. Once enabled, browser console messages (log/info/warn/error/debug + window errors) are buffered up to 500 entries; retrieve via zen_console_logs.

ParameterTypeDescription
enabledboolean
tab_id

zen_console_logs

Return buffered console logs from a tab (requires zen_watch_console first).

ParameterTypeDescription
level
since
tab_id

zen_broadcast

Fire the same command at every listed tab in parallel. Each tab gets the command with its own tabId injected. Returns per-tab results keyed by tab id. Args: tab_ids: Tabs to target. command: Command dict, e.g. {"action": "pageInfo"} or {"action": "getReadability"}. timeout: Per-tab timeout in seconds.

ParameterTypeDescription
command *object
tab_ids *array
timeoutinteger

zen_sync_barrier

Block until a JS predicate returns truthy on every listed tab. Replaces hand-rolled "wait for everything to be ready" loops. Args: tab_ids: Tabs to monitor. predicate: JS expression that returns truthy when the tab is ready, e.g. "!!document.querySelector('.results')". timeout: Overall timeout in ms. poll_interval: Per-poll interval in ms.

ParameterTypeDescription
predicate *string
tab_ids *array
poll_intervalinteger
timeoutinteger

zen_tag_tab

Give a tab a memorable name. Refer to it later via zen_resolve_tag. Names survive bridge restarts only if you re-tag — they live in memory.

ParameterTypeDescription
name *string
tab_id *integer

zen_resolve_tag

Look up the tab id for a tag set via zen_tag_tab.

ParameterTypeDescription
name *string

zen_list_tags

List all tag → tab id mappings.

zen_untag_tab

Remove a tag.

ParameterTypeDescription
name *string

zen_tab_pool

Maintain a warm pool of N tabs always ready to be acquired. Grows or shrinks to `size`. Acquire/release via zen_pool_acquire and zen_pool_release. Auto-grows by one if you acquire from an empty pool.

ParameterTypeDescription
size *integer
urlstring

zen_pool_acquire

Check out a warm tab from the pool. Returns its tab_id.

zen_pool_release

Return a tab to the pool for reuse.

ParameterTypeDescription
tab_id *integer

zen_save_session

Snapshot cookies (and per-origin localStorage if urls given) to disk. Use case: log into a service interactively once, save the session, then have parallel agents load it for authenticated work. Args: name: A label for the session (becomes filename under ~/claude-zen-sessions/). urls: Origins whose cookies + localStorage to snapshot. Each gets opened briefly in a temp tab so localStorage can be read.

ParameterTypeDescription
name *string
urls

zen_load_session

Restore cookies + localStorage from a previously saved session.

ParameterTypeDescription
name *string

zen_list_sessions

List saved sessions with their metadata.

zen_delete_session

Delete a saved session file.

ParameterTypeDescription
name *string

zen_health

Extended health/status: bridge version, ports, keep-alive list, pool state, tags, policy, sessions dir, audit/log sizes.

zen_logs

Return recent bridge log lines (in-memory ring buffer).

ParameterTypeDescription
limitinteger
since

zen_audit

Return recent command audit entries: action, params (JS code stripped), success flag, error, duration. Useful for "what did the agent do?" reviews.

ParameterTypeDescription
limitinteger
since_msinteger

zen_scheduler

Return bridge scheduler state for multi-agent/tab work. Shows active per-tab/global command scopes, pending WebSocket commands, and known tab locks. Useful when several agents are driving separate tabs.

zen_set_policy

Set URL allow/deny regex lists and/or read-only mode. Read-only mode blocks write actions (click/type/navigate/cookies set/etc.) while still allowing read ops. Useful for "let the agent observe only."

ParameterTypeDescription
allow
deny
readonly

zen_get_policy

Return the active URL/readonly policy.

zen_retry

Wrap any command in exponential-backoff retry. Args: command: A command dict (same shape as zen_batch entries). max_attempts: Total tries including the first. backoff_ms: Initial wait between attempts (doubles each retry). on_errors: Only retry if the error string contains one of these substrings. Default: retry on any error.

ParameterTypeDescription
command *object
backoff_msinteger
max_attemptsinteger
on_errors

zen_wp_html

Extract HTML widget content from a WordPress Elementor page. Navigates to the Elementor editor for the given page, waits for load, then extracts the innerHTML of all HTML widgets from the Elementor preview iframe. Returns clean HTML/CSS/JS content. The browser must already be logged into WP admin for this to work. Args: site_url: WordPress site URL (e.g. "https://thankyouexperiences.com") page_id: WordPress page/post ID (e.g. 5719 for Team page)

ParameterTypeDescription
page_id *integer
site_url *string

zen_batch

Run multiple commands in a single request for speed. Each command is a dict with "action" and parameters. Add "tabId" to any command to target a specific tab instead of the active one. For true concurrency across tabs, prefer zen_parallel. Available actions: navigate, newTab, closeTab, switchTab, click, type, setEditableContent, fill, scroll, hover, find, js, pageInfo, pageText, screenshot, tabs, forms, dom, sleep, waitForElement, pageTextByTabId, wakeTab, parallel Args: commands: List of command dicts, e.g. [{"action": "navigate", "url": "..."}, {"action…

ParameterTypeDescription
commands *array