Skip to main content
Glama
1password-browser-mcp

1password-browser-mcp

1password-browser-mcp: an MCP agent filling a sign-in form with a login from 1Password

1password-browser-mcp

A browser MCP server that signs in with 1Password. It drives your own Chrome or Brave profile (cookies, sessions, extensions) and fills logins and one-time codes read from 1Password through its SDK and a service account, without the credential ever reaching the model, and without the warnings or refusals other browser MCPs add around sign-in. On top of that it offers the usual browsing tools for an MCP client (Claude Code, Claude Desktop, Cursor, ...): navigate, snapshot with element refs, click, type, screenshots, console, network, tabs, dialogs, uploads, JS eval.

Runs on macOS and Linux (Chrome, Chromium, Brave, Edge; headless or with a display). Requires Node 20+. Only the macOS focus hand-back is platform-specific. See Linux for details.

How it works

Chromium 136+ refuses --remote-debugging-port on the default profile directory, so the server does not touch your running browser. Instead, in the default mirror mode it:

  1. copies the identity-bearing parts of your profile (cookies, local/session storage, IndexedDB under a size cap, extensions and their state, saved logins, preferences) into ~/.browser-mcp/profiles/<browser>/ (first run ~10 s for a 2 GB profile, incremental after),

  2. launches a second instance of the real browser binary on that copy with the DevTools port open,

  3. connects over CDP with playwright-core.

Caches, service-worker caches and huge IndexedDB origins are skipped. Chromium encrypts cookies with a key in the macOS Keychain (on Linux: the GNOME Keyring / KWallet entry, or a fixed key when no keyring is in use) that is shared by binary, so the copied sessions decrypt and work. Sync is disabled in the mirrored instance so nothing it does is pushed back to your account.

The browser outlives the server: a restarted server simply re-attaches, so logins persist across client sessions. browser_close with kill=true quits it.

Windows and focus

On macOS the mirrored instance is launched in the background (open -g -n) and, because Chromium activates itself when its first window appears, the server hands focus back to whatever app you were using. On Linux the binary is spawned directly and the window manager decides where the new window goes. Every page the tools open afterwards is a tab in that one window; nothing raises the window unless you ask for it (browser_tabs select focus=true).

All driven tabs are kept in one highlighted tab group (default title "Claude", colour purple; BROWSER_MCP_TAB_GROUP_TITLE, BROWSER_MCP_TAB_GROUP_COLOR, or BROWSER_MCP_TAB_GROUP=false). The DevTools protocol has no tab-group API, so the server evaluates chrome.tabGroups calls inside an extension service worker. It uses any installed extension that declares the tabGroups permission (Claude in Chrome, ChatGPT, ...) or the bundled extension/ helper. The helper is passed with --load-extension, which current Chrome and Brave ignore; if no suitable extension is in your profile, load the helper once in your daily browser (chrome://extensions, Developer mode, Load unpacked, pick extension/) and the mirror inherits it. browser_status reports which extension does the grouping.

In auto mode the server picks a browser that is not running right now (with Brave open it drives Chrome, and vice versa; "running" is read from the profile's SingletonLock). A second instance of your daily browser works too (BROWSER_MCP_BROWSER=brave), but on macOS it shares the bundle id with the one you are using, and macOS then routes links clicked in other apps to whichever instance it last registered, which is often the mirrored one.

Other modes: attach connects to any browser you started yourself with --remote-debugging-port=9333 --user-data-dir=<non-default dir>; direct launches on the real profile dir (works only on browsers that still allow it, and only when that browser is not running).

Related MCP server: MultiZen

Several agents at once

Every MCP client starts its own server process; this is how they share or split the browser:

  • shared (default): all servers attach to one browser instance. Each session owns only the tabs it opened: browser_tabs lists and indexes just those, browser_snapshot and friends act on the session's active tab, and the session's tabs live in their own tab group ("Claude", "Claude 2", ... or BROWSER_MCP_SESSION_NAME, each with its own colour). browser_tabs all=true shows every tab in the browser, and selecting one of another session's tabs adopts it. When a server exits its tabs are closed (BROWSER_MCP_KEEP_TABS=true keeps them). A launch lock makes sure servers starting at the same moment bring up a single browser.

  • isolated (BROWSER_MCP_SESSIONS=isolated): each server launches its own browser on its own profile copy (~/.browser-mcp/profiles/<browser>-<session>) and its own port (first free one above BROWSER_MCP_PORT). Cookies and extensions are the same, but tabs, windows and extension state are separate, so agents cannot see or disturb each other. On exit the browser is quit and the copy removed unless BROWSER_MCP_ISOLATED_KEEP=true.

A registry in ~/.browser-mcp/sessions/ numbers live sessions; browser_status lists the others.

1Password

The server reads items through the official 1Password SDK with a service account token in OP_SERVICE_ACCOUNT_TOKEN. That is headless by construction: no desktop app, no browser extension, no CLI, no Touch ID or unlock prompt, no extra tabs. A fill takes about a second; the first call of a server process spends another second or two authenticating.

  • onepassword_fill detects the username, password and one-time-code fields on the active tab, picks the Login item whose website matches the page (or the one named with item=<title or id>), and types the values. submit=true presses Enter and waits for the navigation. dryRun=true reports the item and fields without filling. Pass usernameRef / passwordRef / otpRef from a snapshot when detection picks the wrong field. For multi-step forms call it again on the next step.

  • onepassword_otp fills the current TOTP code of the matching item.

  • onepassword_items lists matching items (title, vault, id, websites); onepassword_status reports whether the token works and which vaults it can read.

Credential values are never returned to the caller; results only say which fields were filled. Extension pages (wallet unlock screens, chrome-extension://...) and browser UI pages have no site to match, so name the item there; field detection falls back to Playwright locators because such pages often block page scripts (MetaMask's LavaMoat). Password and Crypto Wallet items are searched as well as Logins.

Service account

A service account can only read the shared vaults you grant it, never your Personal or Private vault, so put the logins the agent may use into a dedicated vault and grant read_items only. BROWSER_MCP_OP_VAULTS narrows the server further to a comma-separated allowlist of vault titles or ids. The token is a long-lived secret: 1Password prints it once, so keep it in your keychain or in 1Password itself, not in a config file. Service accounts also have hourly and daily request limits.

Create one from a CLI that is signed in through the app (one Touch ID prompt):

op service-account create browser-mcp --account my.1password.com --vault "<vault>:read_items"

Then put the token in the server's environment, e.g. in the MCP client config ("env": { "OP_SERVICE_ACCOUNT_TOKEN": "ops_..." }) or, on macOS, from the login keychain:

security add-generic-password -a "$USER" -s browser-mcp-op-service-account -w "ops_..."
export OP_SERVICE_ACCOUNT_TOKEN="$(security find-generic-password -a "$USER" -s browser-mcp-op-service-account -w)"

Without a token the browser tools work as usual and the onepassword_* tools return a clear error.

Skills

skills/wallet-test/SKILL.md is a Claude Code skill for wallet / dapp QA: it unlocks a dedicated test wallet extension (MetaMask or Rabby) from a 1Password item whose title starts with TEST, then drives a dapp through connect, sign and approve prompts on a testnet, answering the wallet's notification tabs as they appear. Copy the folder to ~/.claude/skills/wallet-test/ and invoke it with /wallet-test "TEST MetaMask" https://your-dapp.example. The file also describes the one-time test-wallet setup; keep real wallets in a profile the server never mirrors.

Install

git clone https://github.com/marekkirejczyk/1password-browser-mcp.git
cd 1password-browser-mcp && npm install && npm run build

Claude Code:

claude mcp add --scope user browser -e BROWSER_MCP_BROWSER=chrome -- node /absolute/path/to/1password-browser-mcp/dist/index.js

Claude Desktop / any JSON config:

{
  "mcpServers": {
    "browser": {
      "command": "node",
      "args": ["/absolute/path/to/1password-browser-mcp/dist/index.js"],
      "env": { "BROWSER_MCP_BROWSER": "chrome" }
    }
  }
}

Diagnostics: node dist/index.js doctor (add --launch to also sync, launch and connect). Manual tool calls: node scripts/mcp-client.mjs '[["browser_status",{}],["browser_navigate",{"url":"https://example.com"}]]'. End-to-end check of every tool against a live server: BROWSER_MCP_HEADLESS=true node scripts/smoke.mjs (needs network access to example.com and the-internet.herokuapp.com; --keep leaves the browser running).

Linux

Tested on Linux with Google Chrome (headless, and headful under xvfb-run). What differs from macOS:

  • Detection. Binaries are looked up on PATH (google-chrome, google-chrome-stable, chromium, chromium-browser, brave-browser, brave, microsoft-edge, ...). Profiles are read from $XDG_CONFIG_HOME (default ~/.config): google-chrome, chromium, BraveSoftware/Brave-Browser, microsoft-edge; Snap (~/snap/chromium/common/chromium) and Flatpak (~/.var/app/<id>/config/...) locations are used when they exist. Override with BROWSER_MCP_EXECUTABLE / BROWSER_MCP_USER_DATA_DIR.

  • No display. Without DISPLAY or WAYLAND_DISPLAY the launch fails fast with a clear message; set BROWSER_MCP_HEADLESS=true (--headless=new, extensions still load) or run the server under xvfb-run. 1Password fills need no window.

  • Root / containers. Chromium refuses to start as root and its sandbox usually cannot be set up in containers, so the server adds --no-sandbox when it runs as root or detects a container (/.dockerenv, /run/.containerenv, cgroup names), plus --disable-dev-shm-usage in containers. Passing --no-sandbox yourself in BROWSER_MCP_ARGS is still fine (it is not duplicated).

  • Pid lookup for a browser the server re-attaches to uses lsof, then /proc/net/tcp, then ss, so none of them has to be installed.

  • Cookie encryption. Chrome/Brave on Linux pick the password store from the desktop session (gnome-libsecret, kwallet, or basic). The mirrored instance inherits the server's environment; if it is started from a context without DBUS_SESSION_BUS_ADDRESS it may fall back to basic and fail to decrypt the copied cookies. Pass BROWSER_MCP_ARGS=--password-store=gnome-libsecret (or kwallet5) to match your daily browser.

  • Snap Chromium cannot read hidden directories in your home, including ~/.browser-mcp. Point BROWSER_MCP_MIRROR_DIR at a visible folder (e.g. ~/browser-mcp-profiles) or use a non-Snap build.

Tests and continuous integration

npm test builds the server and runs the end-to-end test in test/: it starts a headless Chrome on an empty temporary profile, attaches two server sessions to it, and signs each into its own local login fixture in parallel with credentials read from 1Password through the SDK. The fixtures check the submitted values against the vault, so the test proves the right secrets reached the right tab without ever printing them. It is safe to run repeatedly: stale browsers and temp profiles from an interrupted run are reaped at the start, and everything is removed at the end. About 8 s per run.

It needs a service account token with read access to one vault of test logins. The vault and item names are deliberately not in the repository; on the CI machine they live in the runner's .env next to the token:

variable

default

meaning

OP_SERVICE_ACCOUNT_TOKEN

login keychain item browser-mcp-op-service-account (macOS)

the token; the keychain fallback keeps it out of shells and CI config

BROWSER_MCP_TEST_VAULT

required

vault holding the test logins; nothing else is read

BROWSER_MCP_TEST_ITEMS

required

two Login item titles in that vault, comma-separated, one per tab

BROWSER_MCP_BROWSER / BROWSER_MCP_EXECUTABLE

chrome

browser to launch for the test

E2E_VERBOSE

print every tool call and timing

.github/workflows/e2e.yml runs the same command on a self-hosted macOS runner (labels self-hosted, macOS, browser-mcp), so the token never leaves that machine: GitHub stores no secret, the workflow passes none, and the job only runs for code from this repository (fork pull requests are skipped, which matters because the repository is public). Node comes from actions/setup-node; the machine only needs Chrome. To set up the runner on a Mac that stays logged in, run scripts/setup-runner.sh there once: it registers the machine with the repository, installs the runner as a LaunchAgent in that user's session (which gives jobs a display), and puts the token in the login keychain, or, when run over SSH where the keychain is locked, in the runner's private .env file, which the runner exports to jobs. Both places count as runner-local; the keychain is preferable, and the script prints how to move the token there later. The test's vault and item names always go into that .env (pass BROWSER_MCP_TEST_VAULT and BROWSER_MCP_TEST_ITEMS to the script, or answer its prompts).

Configuration (environment or --key=value)

variable

default

meaning

BROWSER_MCP_BROWSER

auto

brave, chrome, chromium, edge; auto prefers an installed browser with a profile that is not currently running

BROWSER_MCP_EXECUTABLE

detected

browser binary

BROWSER_MCP_USER_DATA_DIR

browser default

source profile root

BROWSER_MCP_PROFILE

Default

profile folder (Profile 1, ...)

BROWSER_MCP_MODE

mirror

mirror, direct, attach

BROWSER_MCP_PORT

9333

DevTools port

BROWSER_MCP_CDP_URL

http://127.0.0.1:<port>

endpoint to attach to

BROWSER_MCP_MIRROR_DIR

~/.browser-mcp/profiles

where mirrored profiles live

BROWSER_MCP_MIRROR_SYNC

always

always (every launch), once, never

BROWSER_MCP_MIRROR_INDEXEDDB_MAX_MB

100

skip IndexedDB origins larger than this (extensions always copied)

BROWSER_MCP_MIRROR_HISTORY

true

copy History too

BROWSER_MCP_DISABLE_SYNC

true

pass --disable-sync to the mirrored instance

BROWSER_MCP_HEADLESS

false

--headless=new

BROWSER_MCP_ARGS

extra browser flags (on Linux --no-sandbox is added automatically as root / in containers)

OP_SERVICE_ACCOUNT_TOKEN

none

1Password service account token (the SDK's own variable); without it the onepassword_* tools are unavailable. See Service account

BROWSER_MCP_OP_VAULTS

every vault the token can read

comma-separated vault titles or ids the server may read

BROWSER_MCP_SESSIONS

shared

shared (one browser, per-session tabs) or isolated (one browser per server)

BROWSER_MCP_SESSION_NAME

number from the registry

label used in the tab-group title and the isolated profile copy

BROWSER_MCP_KEEP_TABS

false

shared: leave this session's tabs open when the server exits

BROWSER_MCP_ISOLATED_KEEP

false

isolated: keep the browser and profile copy after the server exits

BROWSER_MCP_TAB_GROUP

true

keep this session's tabs in one tab group

BROWSER_MCP_TAB_GROUP_TITLE / BROWSER_MCP_TAB_GROUP_COLOR

Claude / one colour per session

group label and colour (grey, blue, red, yellow, green, pink, purple, cyan, orange)

BROWSER_MCP_SNAPSHOT_MAX_CHARS

20000

snapshot truncation

BROWSER_MCP_SNAPSHOT_AFTER_ACTIONS

false

return a snapshot after click/type/etc. by default

BROWSER_MCP_ACTION_TIMEOUT_MS

15000

Playwright action timeout

BROWSER_MCP_LOG_FILE

~/.browser-mcp/browser-mcp.log

server log; browser stderr goes to browser-mcp.browser.log

Caveats

  • On macOS, when the mirrored instance is the same app as your daily browser, the system may route links opened from other apps to it. Prefer the other browser (the auto default) or quit the mirror with browser_close kill=true when done.

  • The mirror is a point-in-time copy. Logins you perform in your regular browser after the last sync are picked up on the next launch of the mirrored instance (MIRROR_SYNC=always).

  • The copied profile contains your session cookies and extension state; it sits in ~/.browser-mcp with mode 0700. Delete that folder to purge it.

  • Copying LevelDB stores while the source browser runs can occasionally produce an inconsistent copy of one extension's state. Relaunching re-syncs.

  • Extension pages (wallet unlock screens such as Rabby or MetaMask, chrome-extension://...) and browser UI pages have no site to match, so pass item=<title> to onepassword_fill there.

Available Tools

27 tools
browser_clickClickC

Click an element identified by ref or selector.

Inputs: ref, force, button, selector, +3 more.

browser_closeCloseA

Detach from the browser (it keeps running, sessions stay alive) or quit it with kill=true.

Inputs: kill.

browser_consoleConsole messagesC

Return recent console messages and page errors from the active tab.

Inputs: clear, limit, onlyErrors.

browser_dialogHandle dialogB

Accept or dismiss a pending alert/confirm/prompt dialog on the active tab.

Inputs: accept (required), promptText.

browser_evaluateEvaluate JavaScriptA

Run JavaScript in the page. Provide an expression or a function body; with ref/selector the function receives the element as its argument. Returns the JSON-serialised result.

Inputs: expression (required), ref, selector.

browser_fill_formFill formA

Fill several fields at once. Each field takes a ref or selector plus a value; checkboxes take "true"/"false", selects take the option value or label.

Inputs: fields (required), snapshot.

browser_findFind in snapshotA

Search the accessibility snapshot for lines containing a text (case-insensitive) and return them with refs.

Inputs: query (required), limit.

browser_get_textGet textC

Return the visible text of the page or of an element.

Inputs: ref, maxChars, selector.

browser_historyBack / forward / reloadB

Go back, go forward, or reload the active tab.

Inputs: action (required), snapshot.

browser_hoverHoverC

Hover over an element.

Inputs: ref, selector, snapshot.

browser_navigateNavigateC

Navigate the active tab to a URL and return a snapshot.

Inputs: url (required), newTab, snapshot, waitUntil.

browser_networkNetwork requestsC

Return recent network requests from the active tab (method, status, URL).

Inputs: clear, limit, filter.

browser_press_keyPress keyB

Press a key or chord (e.g. "Enter", "Tab", "Escape", "Control+a", "ArrowDown") on the focused element or on a target.

Inputs: key (required), ref, selector, snapshot.

browser_resizeResize viewportC

Resize the active tab viewport.

Inputs: width (required), height (required).

browser_screenshotScreenshotA

Take a screenshot of the active tab (or of one element) and return it as an image.

Inputs: ref, format, quality, fullPage, +1 more.

browser_scrollScrollA

Scroll the page (or scroll an element into view when ref/selector is given).

Inputs: ref, pixels, selector, snapshot, +1 more.

browser_select_optionSelect optionC

Select option(s) in a by value or label.

Inputs: values (required), ref, selector, snapshot.

browser_snapshotAccessibility snapshotA

Return the accessibility tree of the active tab with element refs (e.g. [ref=e12]) usable by browser_click, browser_type, etc. Preferred over screenshots for reading or locating content.

Inputs: maxChars.

browser_statusBrowser statusA

Report which browser/profile this server drives, whether it is connected, open tabs, and 1Password availability. Connects (launching the browser if needed) when connect=true.

Inputs: connect.

browser_tabsTabsB

List, open, select, or close tabs. Indexes refer to the list returned by action=list.

Inputs: action (required), url, focus, index.

browser_typeType textA

Type into an input/textarea/contenteditable. Replaces the current value unless append=true. Optionally presses Enter afterwards.

Inputs: text (required), ref, append, slowly, +3 more.

browser_upload_fileUpload fileA

Set files on a file input (or click a button that opens a file chooser and feed it the files).

Inputs: paths (required), ref, selector, viaChooser.

browser_wait_forWaitB

Wait for text to appear/disappear, a selector, a URL pattern, network idle, or a fixed time.

Inputs: url, text, timeMs, selector, +3 more.

onepassword_fill1Password: fill loginA

Fill the login form on the active tab from 1Password. Strategies: cli (1Password CLI reads the item, the server types the values; fully programmatic), inline (extension inline menu on the focused field), popup (extension popup page: search item, Open & Fill), shortcut (macOS keystrokes, needs Accessibility). auto = cli, inline, popup. Credential values are never returned. For multi-step forms (username first) call it again on the next step.

Inputs: item, dryRun, otpRef, submit, +3 more.

onepassword_items1Password: list matching itemsA

List 1Password Login, Password and Crypto Wallet items matching the active tab's site (or a given host/query) via the 1Password CLI: title, username, vault, id. No secrets are returned.

Inputs: host, query, refresh.

onepassword_otp1Password: fill one-time codeB

Fill a TOTP / one-time code field from the matching 1Password item (CLI first, then extension inline menu). The code is never returned to the caller.

Inputs: item, otpRef, submit, strategy.

onepassword_status1Password: statusA

Check 1Password integration: extension present in the driven profile, CLI availability and sign-in state, autofill shortcut, Accessibility permission for the shortcut strategy.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 27 tools

    Disambiguation4/5

    Most tools target distinct browser actions, and the browser_ vs onepassword_ prefixes make the domain split clear. There is some overlap among reading tools (snapshot, find, get_text) and between type/fill_form, but descriptions generally guide selection.

    Naming Consistency5/5

    All tools use consistent snake_case with predictable browser_ and onepassword_ prefixes followed by clear action/resource names. Multi-action tools like browser_tabs and browser_history are still readable and consistent.

    Tool Count3/5

    At 27 tools the surface is heavy, though browser automation naturally requires many granular actions. A few operations could potentially be consolidated, but most tools earn their place, making this borderline rather than clearly excessive.

    Completeness4/5

    The server covers a broad browser automation lifecycle: navigation, inspection, interaction, dialogs, uploads, JS evaluation, console/network, and 1Password fill/OTP/items/status. Minor gaps like drag-and-drop, download handling, or credential save/update prevent a perfect completeness score.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables any MCP-compatible AI agent to drive your own Chrome browser with your existing login state, filling forms, clicking elements, fetching data, and handling captchas without API keys or re-authentication.
      353 npm
      614
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Lets any MCP client drive isolated local Chromium or Firefox profiles — navigating, clicking, typing, extracting content, taking screenshots, evaluating JS, and managing tabs and cookies — each with its own spoofed fingerprint, proxy, and locale. Per-profile cookies and login state persist across launches, so agents can complete real authenticated workflows.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Exposes a localhost MCP endpoint that lets AI agents drive isolated browser profiles — navigating, clicking, typing, extracting, screenshotting, evaluating JS, and managing tabs and cookies — so real authenticated workflows can be completed from MCP clients like Cursor or Claude Desktop. Cookies, login state, fingerprints, and proxies persist per profile across launches and AI sessions.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to drive isolated local browser profiles, each with its own persistent cookies, login state, fingerprint, and proxy, so authenticated workflows carry across sessions. Exposes tools for navigation, clicking, typing, extraction, screenshots, JS evaluation, tab and cookie management, and raw CDP commands to any MCP client.
      MIT