agent-browser

Public

Forked from mbagley/agent-browser

5 Downloads

README

mbagley/agent-browser

LM Studio plugin that exposes Vercel agent-browser as model tools. Gives any LLM a Chrome it can drive — open pages, capture accessibility snapshots, click @eN element refs, type, wait, evaluate JS, and take screenshots.

Prerequisites

  • LM Studio with plugins enabled.
  • npx available on the system. The default binCommand is npx agent-browser, so no global install of agent-browser is required — npx fetches it on first run. Run agent-browser install once to download Chrome for Testing.

LM Studio's plugin runtime does not inherit the user's shell PATH, so this plugin discovers the npx (or agent-browser) binary at startup by scanning common Node-toolchain locations (Homebrew, Volta, fnm, nvm, asdf, the npm global prefix, and standard system bins) and, as a fallback, asking a login shell. If discovery fails, set the agent-browser command plugin setting to an absolute path — e.g. the output of which npx or which agent-browser.

Develop

npm install
npm run dev          # lms dev — auto-rebuilds and reloads the plugin in LM Studio
npm run test:verify  # build + integration test against nytimes.com (network)

Publish

npm run push  # lms push

Tools

ToolPurpose
browser_openLaunch and/or navigate to a URL
browser_snapshotAccessibility-tree snapshot with @eN refs
browser_screenshotSave PNG to disk
browser_clickClick by selector, text query, or @eN ref
browser_typeClear and fill an input
browser_pressPress a keyboard key
browser_get_textRead visible text of an element
browser_page_infoCurrent URL and title
browser_waitWait for selector / ms / URL pattern / load state
browser_findSemantic find by role/text/label/placeholder/testid
browser_navigateBack / forward / reload
browser_evalRun JS in the page and return its result
browser_closeClose the session

Configuration

FieldDefaultNotes
binCommandnpx agent-browserOverride to agent-browser if installed globally
sessionlmstudioIsolated session name (own browser + cookies)
headedfalseShow the Chrome window
timeoutMs30000Default per-operation timeout
screenshotDir(blank)Where browser_screenshot writes files

Human-like browsing (on by default)

The plugin ships defaults that make the browser blend in rather than read as an obvious automated client. These are applied as global flags on every agent-browser call (the daemon honors them when it launches Chrome). Clear any field to disable that piece individually.

FieldDefaultNotes
userAgentrecent Chrome/macOS UASent via --user-agent. Clear to use agent-browser's default.
viewport1440x900WIDTHxHEIGHT. Becomes --window-size in --args.
acceptLanguageen-US,en;q=0.9Sent via --headers '{"Accept-Language":"…"}'.
colorSchemelightReported through prefers-color-scheme. no-preference skips the flag.
extraBrowserArgs--disable-blink-features=AutomationControlledComma-separated Chromium flags merged into --args. The default suppresses navigator.webdriver, the most common automation tell.