mcp

v0.5.0
@humanjs/mcp Checked 5 days ago Published 1 month ago

Model 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.

ParameterTypeDescription
url *stringAbsolute URL to navigate to.
sessionstringSession 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.

ParameterTypeDescription
selectorstringPlaywright-compatible selector. Provide this OR x/y — not both. Prefer role/text selectors over brittle CSS.
sessionstringSession ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers.
xnumberX 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.
ynumberY 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.

ParameterTypeDescription
selectorstringPlaywright-compatible selector. Provide this OR x/y — not both. Prefer role/text selectors over brittle CSS.
sessionstringSession ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers.
xnumberX 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.
ynumberY 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.

ParameterTypeDescription
selectorstringPlaywright-compatible selector. Provide this OR x/y — not both. Prefer role/text selectors over brittle CSS.
sessionstringSession ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers.
xnumberX 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.
ynumberY 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.

ParameterTypeDescription
selector *stringSelector of the element to hover.
sessionstringSession 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.

ParameterTypeDescription
selectorstringPlaywright-compatible selector. Provide this OR x/y — not both. Prefer role/text selectors over brittle CSS.
sessionstringSession ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers.
xnumberX 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.
ynumberY 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).

ParameterTypeDescription
fromSelectorstringSource selector. Provide this OR fromX/fromY.
fromXnumberSource X coordinate. Requires fromY.
fromYnumberSource Y coordinate. Requires fromX.
sessionstringSession ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers.
toSelectorstringDestination selector. Provide this OR toX/toY.
toXnumberDestination X coordinate. Requires toY.
toYnumberDestination 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.

ParameterTypeDescription
selector *stringSelector of the input/textarea/contenteditable.
value *stringText to type. May contain newlines.
sessionstringSession 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.

ParameterTypeDescription
selector *stringSelector of the field to paste into.
value *stringText to insert.
sessionstringSession 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.

ParameterTypeDescription
selector *stringSelector of the field to clear.
sessionstringSession 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.

ParameterTypeDescription
selector *stringSelector of the element whose text to select.
sessionstringSession ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers.
textstringOptional 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.

ParameterTypeDescription
selector *stringSelector of the checkbox/radio input.
sessionstringSession 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.

ParameterTypeDescription
selector *stringSelector of the checkbox input.
sessionstringSession 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.

ParameterTypeDescription
selector *stringSelector of the <select> element.
values *Option value, or array of values for a multi-select.
sessionstringSession 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).

ParameterTypeDescription
files *Filename(s) inside HUMANJS_UPLOAD_DIR — a basename only, no path components.
selector *stringSelector of the file input.
sessionstringSession 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.

ParameterTypeDescription
key *stringKey or chord, e.g. "Enter", "Tab", "Mod+S", "Ctrl+Shift+K".
sessionstringSession 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.

ParameterTypeDescription
axisstringAxis to scroll. Defaults to "y".
bynumberRelative pixel delta (negative = up/left).
sessionstringSession ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers.
targetstringOne of "natural" (one viewport), "end", "top", or an element selector to scroll until visible. Defaults to "natural". Ignored if `by` or `to` is set.
tonumberAbsolute scroll position on the chosen axis.
withinstringSelector 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.

ParameterTypeDescription
kindstringReading style. Auto-detected as "code" for <pre>/<code> when omitted.
selectorstringSelector of the text to read. Provide this OR text.
sessionstringSession ID to act on. Omit to use the default session (created lazily on first call). Use human_create_session for parallel browsers.
textstringLiteral 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.

ParameterTypeDescription
filenamestringOptional plain filename (e.g. "homepage.png"). When set, the screenshot is saved to HUMANJS_OUTPUT_DIR. Path components are rejected for safety.
fullPagebooleanCapture the full scrollable page instead of just the viewport. Ignored if `selector` is set.
selectorstringOptional selector. If omitted, captures the entire viewport.
sessionstringSession 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.

ParameterTypeDescription
sessionstringSession 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.

ParameterTypeDescription
selectorstringOptional region selector to scope the outline. Omit for the whole page.
sessionstringSession 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.

ParameterTypeDescription
selector *stringSelector of the element to read.
allbooleanRead 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.
limitintegerWith `all`, the maximum number of matches to return (default 100). The total number found is always reported.
sessionstringSession 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.

ParameterTypeDescription
attribute *stringAttribute name, e.g. "aria-label", "href", "data-state".
selector *stringSelector of the element.
allbooleanRead 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.
limitintegerWith `all`, the maximum number of matches to return (default 100). The total number found is always reported.
sessionstringSession 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.

ParameterTypeDescription
selector *stringSelector of the region to dump. Target narrowly.
allbooleanRead 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.
limitintegerWith `all`, the maximum number of matches to return (default 10). The total number found is always reported.
sessionstringSession 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.

ParameterTypeDescription
clearbooleanEmpty 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…
limitintegerMaximum 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.
onlyErrorsbooleanKeep only console.error output and uncaught page errors, dropping log/info/warn/debug.
patternstringCase-insensitive regular expression to filter by. Omit to see everything. Use it to cut noise on chatty pages, e.g. "cors|refused" or "\\.png$".
sessionstringSession 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.

ParameterTypeDescription
clearbooleanEmpty 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…
limitintegerMaximum 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.
onlyFailuresbooleanKeep only 4xx/5xx responses and requests that failed before responding. The fastest way to find a broken asset or API call.
patternstringCase-insensitive regular expression to filter by. Omit to see everything. Use it to cut noise on chatty pages, e.g. "cors|refused" or "\\.png$".
sessionstringSession ID to read from. Omit to use the default session.
statusintegerKeep 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.

ParameterTypeDescription
namestringLabel for the recording (used in the timeline + the fallback filename).
qualitystringCapture/encode quality. Default "high" (1080p, visually lossless).
sessionstringSession ID. Omit for the default session.
videobooleanCapture 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.

ParameterTypeDescription
filenames *arrayOne 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"].
sessionstringSession 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.

ParameterTypeDescription
id *stringUnique session ID, e.g. "buyer", "seller".
heightintegerViewport height in CSS px. Requires width.
personalitystringPersonality preset for this session. Defaults to HUMANJS_PERSONALITY.
speedstringHumanization pace. "human" (default) = full realistic motion; "fast" = humanized but quick; "instant" = no humanized motion. Defaults to HUMANJS_SPEED.
widthintegerViewport 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.

ParameterTypeDescription
id *stringSession 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.

ParameterTypeDescription
blendobjectBlend two presets. Provide this OR `personality`, not both.
personalitystringA preset to apply. Provide this OR `blend`, not both.
sessionstringSession 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.

ParameterTypeDescription
speed *stringThe pace to switch to.
sessionstringSession 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).

ParameterTypeDescription
height *integerViewport height in CSS px.
width *integerViewport width in CSS px.
sessionstringSession 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.

ParameterTypeDescription
colorSchemestringEmulate prefers-color-scheme, to check the light and dark themes.
forcedColorsstringEmulate forced-colors (Windows High Contrast). 'active' reveals content that disappears when the author's colors are overridden.
reducedMotionstringEmulate prefers-reduced-motion. Use 'reduce' to verify the reduced-motion path renders and stays usable.
sessionstringSession 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).

ParameterTypeDescription
restartNowbooleanRestart the browser immediately to apply (discards the current page). Default false.
userDataDirstringOptional 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.)