mcp
v0.5.0Model Context Protocol server for HumanJS — drive a Playwright browser with humanized motion from Claude Desktop, Claude Code, Cursor, Codex, and any other…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
human_goto Navigate to URL
Navigates the session's page to a URL. Plugins observe a "goto" action. Equivalent to a user typing a URL in the address bar.
| Parameter | Type | Description |
|---|---|---|
url * | string | Absolute URL to navigate to. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_click Click (humanized)
Moves the cursor to the target along a humanized Bezier path and clicks. Target is a selector OR x/y coordinates — use coordinates for icon-only buttons or anything with no clean selector that you can see in a screenshot.
| Parameter | Type | Description |
|---|---|---|
selector | string | Playwright-compatible selector. Provide this OR x/y — not both. Prefer role/text selectors over brittle CSS. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
x | number | X coordinate (CSS px from viewport left). Use x+y when there is no clean selector — e.g. an icon-only button you can see in a screenshot. Requires y. |
y | number | Y coordinate (CSS px from viewport top). Requires x. |
human_rightClick Right-click (humanized)
Right-clicks the target to open a context menu. Same motion as human_click; only the dispatched button differs. Target is a selector OR x/y coordinates.
| Parameter | Type | Description |
|---|---|---|
selector | string | Playwright-compatible selector. Provide this OR x/y — not both. Prefer role/text selectors over brittle CSS. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
x | number | X coordinate (CSS px from viewport left). Use x+y when there is no clean selector — e.g. an icon-only button you can see in a screenshot. Requires y. |
y | number | Y coordinate (CSS px from viewport top). Requires x. |
human_doubleClick Double-click (humanized)
Double-clicks the target — same humanized motion as human_click, but two presses within the OS double-click window. Use for things that open/activate on double-click (list rows, file items, editable cells). Target is a selector OR x/y coordinates.
| Parameter | Type | Description |
|---|---|---|
selector | string | Playwright-compatible selector. Provide this OR x/y — not both. Prefer role/text selectors over brittle CSS. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
x | number | X coordinate (CSS px from viewport left). Use x+y when there is no clean selector — e.g. an icon-only button you can see in a screenshot. Requires y. |
y | number | Y coordinate (CSS px from viewport top). Requires x. |
human_hover Hover an element (humanized)
Moves the cursor to an element and settles on it (no click), letting hover-triggered UI fire — tooltips, dropdowns. Element-bound only; for positioning the cursor at coordinates without an element, use human_move.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the element to hover. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_move Move the cursor (humanized)
Moves the cursor to a target along a Bezier path with no click and no settle dwell — pure positioning. Useful before a keyboard action, for canvas work, or cinematic beats. Target is a selector OR x/y coordinates.
| Parameter | Type | Description |
|---|---|---|
selector | string | Playwright-compatible selector. Provide this OR x/y — not both. Prefer role/text selectors over brittle CSS. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
x | number | X coordinate (CSS px from viewport left). Use x+y when there is no clean selector — e.g. an icon-only button you can see in a screenshot. Requires y. |
y | number | Y coordinate (CSS px from viewport top). Requires x. |
human_drag Drag (humanized)
Drags from one location to another — cursor → source, mousedown, source → destination, mouseup, all humanized. Each endpoint is a selector OR x/y coordinates (use coordinates for sliders, canvas, SVG handles).
| Parameter | Type | Description |
|---|---|---|
fromSelector | string | Source selector. Provide this OR fromX/fromY. |
fromX | number | Source X coordinate. Requires fromY. |
fromY | number | Source Y coordinate. Requires fromX. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
toSelector | string | Destination selector. Provide this OR toX/toY. |
toX | number | Destination X coordinate. Requires toY. |
toY | number | Destination Y coordinate. Requires toX. |
human_type Type text (humanized)
Clicks the element to focus it, then types with humanized per-key rhythm. The current personality controls speed, typo probability, and corrections (HUMANJS_PERSONALITY / human_set_personality). If this types into a search/filter, the results re-render (often debounced) — use a specific selector for the result, as the list shifts as it filters.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the input/textarea/contenteditable. |
value * | string | Text to type. May contain newlines. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_paste Paste text (one shot)
Inserts text in one shot (the Cmd-V semantic) — focuses the field, then sets the whole value via insertText with no per-key timing. Use for long strings where humanized typing would be slow. Does not fire the page paste event.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the field to paste into. |
value * | string | Text to insert. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_clear Clear a field (humanized)
Clears a text field (input/textarea/contenteditable) with a real keyboard gesture — click to focus, select-all, then delete — firing the input events the page expects. Use before human_type when you need to replace an existing value rather than append to it.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the field to clear. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_selectText Select an element’s text (humanized)
Selects (highlights) text inside an element — moves the cursor to it, then selects. By default selects all of the element’s text; pass `text` to select just that substring (found inside the element, whitespace-tolerant, first match; falls back to the whole element if not found). Use before copying, replacing, or triggering a highlight menu.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the element whose text to select. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
text | string | Optional substring to select instead of the element’s whole text. |
human_check Check a box (humanized)
Ticks a checkbox or radio — moves the cursor to it and clicks, but only if it is not already checked (a real user does not re-click a ticked box). Verifies the resulting state. Pass the checkbox/radio input itself (or a [role=checkbox]) — not a wrapping <label> — so the current state can be read and the click stays idempotent.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the checkbox/radio input. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_uncheck Uncheck a box (humanized)
Unticks a checkbox — humanized click only if currently checked. Radios cannot be unchecked by clicking (select a different option instead). Pass the checkbox input itself (or a [role=checkbox]) — not a wrapping <label> — so its state can be read and the click stays idempotent.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the checkbox input. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_selectOption Select dropdown option (humanized)
Chooses option(s) in a native <select> — moves the cursor to the dropdown, then sets the value (native selects open an OS menu automation can't drive, so the value is set programmatically, firing change/input). For custom DOM dropdowns, use human_click on the rendered options instead. Match by value(s); pass one string or an array for multi-selects.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the <select> element. |
values * | Option value, or array of values for a multi-select. | |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_upload Upload file(s) (humanized)
Attaches file(s) to a file input — moves the cursor to the control, then sets the files (never opens the OS dialog, which would hang). For safety, files are read by basename from HUMANJS_UPLOAD_DIR (default: the server working dir) — subdirectories, "../", and absolute paths are rejected, so the agent can't read and exfiltrate arbitrary local files. Pass the <input type="file"> selector and the filename(s).
| Parameter | Type | Description |
|---|---|---|
files * | Filename(s) inside HUMANJS_UPLOAD_DIR — a basename only, no path components. | |
selector * | string | Selector of the file input. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_press Press a key or chord
Presses a single key (Enter, Tab, Escape, ArrowDown, …) or a chord (Mod+S, Cmd+Shift+P, Ctrl+C). "Mod" maps to Meta on Mac and Control elsewhere. Dispatches against focus — does not move the cursor; compose with human_click/human_move when you need both.
| Parameter | Type | Description |
|---|---|---|
key * | string | Key or chord, e.g. "Enter", "Tab", "Mod+S", "Ctrl+Shift+K". |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
human_scroll Scroll (humanized)
Scrolls the page or a container with a natural velocity profile. Default scrolls one viewport down. Use `target` for presets ("natural"/"end"/"top") or an element selector to scroll into view; `by` for a relative pixel delta; `to` for an absolute position.
| Parameter | Type | Description |
|---|---|---|
axis | string | Axis to scroll. Defaults to "y". |
by | number | Relative pixel delta (negative = up/left). |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
target | string | One of "natural" (one viewport), "end", "top", or an element selector to scroll until visible. Defaults to "natural". Ignored if `by` or `to` is set. |
to | number | Absolute scroll position on the chosen axis. |
within | string | Selector of a scrollable container to scope the scroll to. |
human_read Read dwell (humanized)
Dwells as if reading the target — pause time derived from word count and the personality's reading speed, with a visible cursor scan across the text. Models the "user pauses to read" beat. Provide a selector OR literal text.
| Parameter | Type | Description |
|---|---|---|
kind | string | Reading style. Auto-detected as "code" for <pre>/<code> when omitted. |
selector | string | Selector of the text to read. Provide this OR text. |
session | string | Session ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers. |
text | string | Literal text to "read" (no DOM lookup). Provide this OR selector. |
human_screenshot Screenshot the current page
Captures the current page (or a specific element if `selector` is given) as a PNG and returns it as image content the AI can view directly. Pass `filename` to also save it to disk (HUMANJS_OUTPUT_DIR); omit it for an ephemeral look-at-the-page capture.
| Parameter | Type | Description |
|---|---|---|
filename | string | Optional plain filename (e.g. "homepage.png"). When set, the screenshot is saved to HUMANJS_OUTPUT_DIR. Path components are rejected for safety. |
fullPage | boolean | Capture the full scrollable page instead of just the viewport. Ignored if `selector` is set. |
selector | string | Optional selector. If omitted, captures the entire viewport. |
session | string | Session ID to act on. Omit to use the default session. |
human_page_text Get visible page text
Returns the page's visible text (document.body.innerText). The fastest way to understand what's on screen without parsing HTML — prefer this over human_get_html unless you need element structure or attributes.
| Parameter | Type | Description |
|---|---|---|
session | string | Session ID to act on. Omit to use the default session. |
human_outline Page outline (accessibility tree)
Returns a compact accessibility-tree outline of the page (or a region) — every interactive element and landmark by its ARIA role + accessible name, as YAML (e.g. `- button "Sign in"`, `- textbox "Email"`). The most token-efficient way to see what is actionable and pick a selector: the names map directly to getByRole / accessible-name selectors. Prefer this over human_get_html for "what can I click or fill"; use human_screenshot when you need the visual layout.
| Parameter | Type | Description |
|---|---|---|
selector | string | Optional region selector to scope the outline. Omit for the whole page. |
session | string | Session ID to act on. Omit to use the default session. |
human_get_text Get an element's text
Returns the innerText of the first element matching `selector` — a specific label, price, status, or message. Set `all` to read every match instead, e.g. every row's title in a table; a sweep reports each match in document order, including ones that are not currently visible.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the element to read. |
all | boolean | Read every element the selector matches instead of just the first. Use it to sweep a page — all image sources, all row labels, all link hrefs — in one call. |
limit | integer | With `all`, the maximum number of matches to return (default 100). The total number found is always reported. |
session | string | Session ID to act on. Omit to use the default session. |
human_get_attribute Get an element's attribute
Returns the value of an attribute on the first element matching `selector` (or reports it is absent). Handy for reading aria-label, data-*, href, value, disabled state, etc. — often how you confirm an icon-only button's purpose. Set `all` to collect the attribute across every match, which is the compact way to extract every image source or link target on a page.
| Parameter | Type | Description |
|---|---|---|
attribute * | string | Attribute name, e.g. "aria-label", "href", "data-state". |
selector * | string | Selector of the element. |
all | boolean | Read every element the selector matches instead of just the first. Use it to sweep a page — all image sources, all row labels, all link hrefs — in one call. |
limit | integer | With `all`, the maximum number of matches to return (default 100). The total number found is always reported. |
session | string | Session ID to act on. Omit to use the default session. |
human_get_html Get an element's HTML
Returns the outerHTML of the first element matching `selector` — the element plus its children, including its own attributes (class, aria-label, etc.). The go-to tool for discovering the real selector of a control with no obvious text. Target a specific region; full-page HTML is large. Set `all` to dump every match, but prefer human_get_attribute with `all` when you only need one attribute from each — it returns the same information for a fraction of the tokens.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Selector of the region to dump. Target narrowly. |
all | boolean | Read every element the selector matches instead of just the first. Use it to sweep a page — all image sources, all row labels, all link hrefs — in one call. |
limit | integer | With `all`, the maximum number of matches to return (default 10). The total number found is always reported. |
session | string | Session ID to act on. Omit to use the default session. |
human_console_messages Read the browser console
Returns console output and uncaught page errors captured for this session, newest last. Capture starts when the session is created, so this covers everything since — including errors thrown during the first page load. The go-to tool when something looks wrong on the page but the screenshot doesn't explain why: CORS rejections, failed asset loads, and thrown exceptions all surface here and nowhere else.
| Parameter | Type | Description |
|---|---|---|
clear | boolean | Empty the WHOLE buffer after this read — not only the entries returned, and not only the ones that matched your filter. Use it for a clean slate before an action, so the next call shows just what th… |
limit | integer | Maximum entries to return, most recent first-in-list-last (default 50). The count of everything that matched is always reported, so you can tell when you are seeing a slice. |
onlyErrors | boolean | Keep only console.error output and uncaught page errors, dropping log/info/warn/debug. |
pattern | string | Case-insensitive regular expression to filter by. Omit to see everything. Use it to cut noise on chatty pages, e.g. "cors|refused" or "\\.png$". |
session | string | Session ID to read from. Omit to use the default session. |
human_network_requests Inspect network activity
Returns network responses captured for this session, newest last, with method, URL, HTTP status and round-trip time. Requests that never got a response (DNS failure, blocked by CORS, aborted) are included with the browser's failure reason instead of a status. Use `onlyFailures` to answer "what broke?" in one call — it covers both 4xx/5xx responses and requests that never completed.
| Parameter | Type | Description |
|---|---|---|
clear | boolean | Empty the WHOLE buffer after this read — not only the entries returned, and not only the ones that matched your filter. Use it for a clean slate before an action, so the next call shows just what th… |
limit | integer | Maximum entries to return, most recent first-in-list-last (default 50). The count of everything that matched is always reported, so you can tell when you are seeing a slice. |
onlyFailures | boolean | Keep only 4xx/5xx responses and requests that failed before responding. The fastest way to find a broken asset or API call. |
pattern | string | Case-insensitive regular expression to filter by. Omit to see everything. Use it to cut noise on chatty pages, e.g. "cors|refused" or "\\.png$". |
session | string | Session ID to read from. Omit to use the default session. |
status | integer | Keep only responses with this exact HTTP status, e.g. 404 or 500. |
human_start_recording Start recording
Begins recording the session. Every humanized action until human_stop_recording is captured (frames + action timeline). The visible cursor is in the video. One recording per session at a time. For a natural-looking take: explore the flow first to find correct selectors, then dispatch the whole run — start_recording + every action + stop_recording — in a SINGLE turn (one batch of tool calls), so there are no model-thinking pauses between actions to leave dead air in the video.
| Parameter | Type | Description |
|---|---|---|
name | string | Label for the recording (used in the timeline + the fallback filename). |
quality | string | Capture/encode quality. Default "high" (1080p, visually lossless). |
session | string | Session ID. Omit for the default session. |
video | boolean | Capture video frames. Default true. Set false for a timeline-only recording. |
human_stop_recording Stop recording and save
Stops the active recording and writes it to one or more files in HUMANJS_OUTPUT_DIR. Each filename's extension picks its format: .mp4/.webm = video, .gif = animated gif, .json = action timeline, .ts = runnable HumanJS script, .spec.ts/.test.ts = @playwright/test spec (humanized, with derived assertions). Pass several to export the same recording multiple ways, e.g. ["demo.mp4", "checkout.spec.ts"] for a video plus a ready-to-commit test. Path components are rejected for safety.
| Parameter | Type | Description |
|---|---|---|
filenames * | array | One or more output filenames. The recording is saved to each, format chosen by extension. e.g. ["demo.mp4"], ["checkout.spec.ts"], or ["demo.mp4", "demo.json", "demo.ts"]. |
session | string | Session ID. Omit for the default session. |
human_create_session Create a browser session
Opens a new isolated session (its own browser context, cookies, viewport) under the given ID. Only needed for parallel browsers — for a single browser, just omit the session arg on other tools and the default session is used.
| Parameter | Type | Description |
|---|---|---|
id * | string | Unique session ID, e.g. "buyer", "seller". |
height | integer | Viewport height in CSS px. Requires width. |
personality | string | Personality preset for this session. Defaults to HUMANJS_PERSONALITY. |
speed | string | Humanization pace. "human" (default) = full realistic motion; "fast" = humanized but quick; "instant" = no humanized motion. Defaults to HUMANJS_SPEED. |
width | integer | Viewport width in CSS px. Defaults to HUMANJS_VIEWPORT. Requires height. |
human_close_session Close a browser session
Closes a session and frees its browser context. Closing the default session is allowed — it will be recreated lazily on the next call.
| Parameter | Type | Description |
|---|---|---|
id * | string | Session ID to close. |
human_list_sessions List open sessions
Lists every currently-open session with its personality. Use to orient before acting on a specific session.
human_set_personality Set session personality
Changes the humanization personality for a session at runtime. Pass a preset, or a blend of two presets (e.g. mostly careful with a touch of distracted). The browser, cookies, and scroll position are preserved — only the motion/typing/reading profile changes.
| Parameter | Type | Description |
|---|---|---|
blend | object | Blend two presets. Provide this OR `personality`, not both. |
personality | string | A preset to apply. Provide this OR `blend`, not both. |
session | string | Session ID. Omit for the default session. |
human_set_speed Set humanization speed
Changes a session's humanization pace at runtime. "human" = full realistic motion (best for recordings); "fast" = humanized but quicker; "instant" = no humanized motion (straight Playwright). Note: this changes how long each action takes to execute, not the wait between actions. Cannot change while recording.
| Parameter | Type | Description |
|---|---|---|
speed * | string | The pace to switch to. |
session | string | Session ID. Omit for the default session. |
human_set_viewport Resize the viewport
Resizes a session's browser viewport at runtime. Use for a bigger/crisper recording or to test responsive layouts. The default size for new sessions is set by HUMANJS_VIEWPORT (default 1440×900).
| Parameter | Type | Description |
|---|---|---|
height * | integer | Viewport height in CSS px. |
width * | integer | Viewport width in CSS px. |
session | string | Session ID. Omit for the default session. |
human_emulate_media Emulate media features
Emulates CSS media features for a session so you can verify the accessibility and theming paths a real user would get. `reducedMotion: 'reduce'` is the important one: it is the only way to check that a site's prefers-reduced-motion path actually works, and it is normally impossible to test without changing OS settings. Settings persist across navigations until changed; pass 'system' to stop emulating a feature.
| Parameter | Type | Description |
|---|---|---|
colorScheme | string | Emulate prefers-color-scheme, to check the light and dark themes. |
forcedColors | string | Emulate forced-colors (Windows High Contrast). 'active' reveals content that disappears when the author's colors are overridden. |
reducedMotion | string | Emulate prefers-reduced-motion. Use 'reduce' to verify the reduced-motion path renders and stays usable. |
session | string | Session ID. Omit for the default session. |
human_browser_info Browser configuration
Reports how the browser is obtained (ephemeral fresh profile, persistent profile, or attached over CDP), the channel, and whether logins persist. Use it to explain to the user why they are or are not signed in, and how to change it.
human_enable_persistence Enable a persistent profile
Switches HumanJS to a persistent browser profile so logins/cookies survive across runs. Takes effect on the next browser start; pass restartNow:true to apply immediately (restarting discards the current page — re-navigate after). For a permanent default, set HUMANJS_PERSIST=true in the MCP config instead. Note: this does NOT use your real Chrome profile (that stays an env-only, opt-in setting).
| Parameter | Type | Description |
|---|---|---|
restartNow | boolean | Restart the browser immediately to apply (discards the current page). Default false. |
userDataDir | string | Optional profile directory. Defaults to ~/.humanjs/profile. |
human_restart_browser Restart the browser
Closes the browser and all sessions; the next action launches a fresh one in the current mode. Use to apply a persistence change, or to recover a wedged browser. Discards open pages/tabs — re-navigate afterward. (Does not affect a CDP-attached browser beyond disconnecting.)