Skip to main content
Glama

browser-memory

One MCP gateway that gives AI agents a real browser and a memory per website. It proxies every tool of Playwright MCP and adds what an agent learns on each site: shortcuts, fixes, dead ends, and the site's own internal API, observed from real traffic. The next agent that lands on the same site starts where the last one stopped.

עברית

A second session navigates to a site and receives what the first session learned, without asking

A real run against a public sandbox site, with an isolated headless browser and an empty memory directory. Session 1 records two lessons. Session 2 is a fresh agent; when it navigates to the site, the gateway attaches the lessons to the navigation result on its own.


Why it is interesting

  • Memory that arrives without being asked for. An agent that sees two servers has to decide by itself when to consult memory, and in practice it does not. A gateway sits in the path, so it injects what is known about a domain the first time the session reaches it.

  • Learned, not written. Three seconds after each navigation the gateway reads the network log, drops telemetry, collapses ids to :id and keeps parameter names without values. A single visit to an admin panel maps its internal API (invoices, subscriptions, resources) with no one writing a line. Response bodies are never stored.

  • Capture that does not depend on the agent remembering. In one measured session an agent worked 49 turns across three sites, recorded nothing, and reported that it had. The gateway sees every call and result underneath the agent's story and infers lessons from evidence: an endpoint that returned data, a call that failed and then succeeded after a change, a form flow that worked.

  • Lessons become tools. Something that worked once can be saved as a procedure and shows up in the tool list as a regular, callable tool.

  • Fixes that fire by themselves. Every error body is matched against known symptoms, and a fix whose trigger appears verbatim is attached to the error. A fix that failed in its last two runs is not offered.

  • Measured, not assumed. npm run eval:compare runs the same real task against an empty memory and a mature one. On a two-site task (match every VPS on a hosting panel with every DNS zone on a CDN), four of four pairs moved the same way: median turns 15.5 → 12.5, time 105 s → 73.5 s, cost $0.91 → $0.74. The Hebrew README has the full tables, the ablation campaign, and what the numbers cannot claim (n = 4, overlapping ranges).

Related MCP server: orchords-web-pilot

Architecture

Chrome (one persistent profile, CDP 9222)
      ▲
playwright-mcp (HTTP)                  ← upstream, untouched
      ▲
browser-gateway (stdio)                ← the agent connects here, and only here
      │
      ├── memory/<domain>.json             lessons
      ├── memory/api/<domain>.json         the API observed on the wire
      ├── memory/procedures/<domain>.json  saved procedures, served as tools
      ├── memory/observations.jsonl        evidence for automatic capture
      ├── memory/audit.jsonl               every call, written underneath the agent
      └── memory/tabs.json                 tab ownership, survives a kill
src/
  gateway/     the MCP server: tool list, dispatch, the brief attached on arrival
  memory/      the store, relevance ranking, curation
  capture/     everything written without being asked: observe, evidence, API map, harvest
  browser/     reading and driving the page: aria, tabs, ask-the-user, diagnosis
  procedures/  saved procedures and how they run
  lib/         mechanism with no product opinion: locks, rotation, redaction, audit, trace
  report/      a measured run rendered as a dossier
eval/          real tasks for real agents, cold against warm

Lessons have kinds, ordered by how much time they save: fast-path (a snippet that fetches the data directly), recipe, fix (symptom → solution), dead-end, auth, landmark (stable selectors and paths) and fact.

The memory tools: domain_brief, domain_open, domain_unstick, domain_remember, domain_report, domain_forget, domain_index, domain_interface, domain_curate, procedure_draft, procedure_save, procedure_list, procedure_delete, and browser_ask_user for the moments only a person can handle (a CAPTCHA, a login code, a card number).

Running it

Requirements: Node.js 24 (the code is TypeScript run directly by Node) and a running Playwright MCP server.

npm ci

# An isolated headless browser for trying it out. Both processes must name
# the same output directory: the gateway reads the snapshots the upstream writes.
npx @playwright/mcp --port 8931 --headless --isolated --output-dir /tmp/bm-output

# The gateway, as an MCP server over stdio:
PLAYWRIGHT_MCP_URL=http://localhost:8931/mcp \
PLAYWRIGHT_MCP_OUTPUT_DIR=/tmp/bm-output \
BROWSER_MEMORY_DIR=./memory \
node src/gateway/index.ts

In this mode memory, the API map and capture all work. Tab ownership and browser_ask_user also talk to Chrome over CDP (BROWSER_CDP_URL); for those, run a persistent Chrome with --remote-debugging-port=9222 and point the upstream at it with --cdp-endpoint http://127.0.0.1:9222, the setup in the diagram above.

Add it to Claude Code (or any MCP client) as a stdio server:

claude mcp add browser -- node /path/to/browser-memory/src/gateway/index.ts

Variable

Default

What

PLAYWRIGHT_MCP_URL

http://localhost:8931/mcp

the upstream Playwright MCP

PLAYWRIGHT_MCP_OUTPUT_DIR

output/ inside BROWSER_WORK_DIR

where the upstream writes snapshots; must match its --output-dir

BROWSER_CDP_URL

http://127.0.0.1:9222

Chrome's debugging endpoint, for tab ownership and asking the user

BROWSER_MEMORY_DIR

memory/ inside the package

where lessons, API maps and logs live

BROWSER_WORK_DIR

work/ beside the checkout

screenshots, downloads, snapshots

BROWSER_MEMORY_WITHOUT

empty

switch layers off, for ablation runs

EVAL_INBOX

none

required for npm run eval -- --side-effects: the signed-in Gmail address the errands mail to

Tests and tools

npm run test:unit     # no browser needed
npm run test:browser  # against a live Chrome, under a lock
npm run typecheck

npm run watch         # the gateway's decisions, live, in a second terminal
npm run explain       # what is being served right now, grouped by origin
npm run eval:compare  # the same task against cold and warm memory

License

MIT

Available Tools

19 tools
browser_ask_userStop and ask the person to do this partA

Hand control to the user for a step that is not yours to do, then carry on when they have done it.

Use it the moment you recognise one, rather than after failing:

  • a CAPTCHA or "I am not a robot" challenge — but try it yourself first; escalate after two failed attempts

  • a sign-in, including SSO and two-factor — only once browser_credentials_list shows nothing stored for the site

  • card or payment details — never type a card number yourself

  • a form field whose correct value is not knowable from the page — a plausible guess in a real form is worse than a question

  • a cookie banner, terms acceptance or permission prompt

This brings your tab to the front, sends the user a message on their phone with a screenshot of the page — and, on the company server, a one-time link that shows them just your tab — and then waits. It returns as soon as the page shows they are done or they press "done" on the phone — they do not have to come back and tell you. If the message cannot be sent — or, on the company server, hq cannot make the phone link — it fails at once and says why; then fix that or tell the user yourself, in your reply, what is needed. Give untilTextGone or untilTextAppears when you can name what will change, and it will notice within a second or two instead of waiting for a URL change.

If this call is interrupted (a message arrived while it waited) after a phone link went out, the request is NOT cancelled: the link stays live, and when the user finishes, declines or it expires you get a message saying so. Do not call it again for the same step; answer the message and wait for that one. If no link went out, take a snapshot and ask again if it is still needed.

Say what you need in plain language, as if to someone who cannot see your reasoning.

Inputs: need (required), what (required), why, untilTextGone, +2 more.

browser_credentials_fillType the stored sign-in into this pageA

Fill the username and password fields on the current page from the store, without the password passing through you.

Take a snapshot first and pass the refs of the fields you can see. Fill both in one call where the page shows both; on a two-step form (email, then Next, then password) call it twice with whichever field is on screen. This does not submit — click the button yourself so you can read what the page does next.

If nothing is stored for the site this says so, and the next move is browser_ask_user with need: "login" followed by browser_credentials_save.

Inputs: domain, passwordRef, usernameRef.

browser_credentials_forgetDelete a stored sign-inA

Remove everything stored for a site. Use it when the user says the password changed and they do not want to give the new one yet, or when a login has repeatedly failed with what is stored — a stale password that keeps getting typed can lock the account.

Inputs: domain (required).

browser_credentials_listWhat sign-ins are storedA

List the sites this browser has stored credentials for, with usernames but never passwords.

Check this before treating a login page as a dead end — the account may already be here, in which case browser_credentials_fill signs in without involving the user at all.

Inputs: no named parameters.

browser_credentials_saveRemember a sign-in for next timeA

Store a username, password, or preferred Google account for a site, so the next login needs nobody.

Call this right after the user gives you credentials, before you use them — if the login then fails you have still saved them the retyping. Saving only a googleAccount is normal for sites behind SSO, where there is no password to hold.

Stored at mode 600 outside the repository. Passwords are never read back out; they can only be typed into a page by browser_credentials_fill.

Inputs: domain (required), note, password, username, +1 more.

browser_unavailableB

The browser server at http://localhost:8931/mcp is not reachable (fetch failed). Browser tools are offline; domain memory still works. Check: systemctl --user status playwright-mcp.service

Inputs: no named parameters.

domain_briefWhat earlier agents learned about this siteA

Call this BEFORE working on any website, with the URL you are about to visit. Returns, in full, what previous agents learned there — API shortcuts that skip the UI, the exact steps and addresses that already worked, known failures and their fixes. Everything you need is in the answer; nothing has to be opened separately. Passing your goal ranks it against that. Skipping this means rediscovering, slowly, what is already known.

Inputs: url (required), goal, limit.

domain_curateConsolidate what a site has accumulatedA

Run this when a site has built up enough knowledge to be worth tidying — domain_brief will say so. It returns candidates found mechanically: lessons that overlap, values hardcoded into procedures that should be parameters, knowledge that is really about the web rather than this site, entries nobody has used, and procedures that are broken or never proven.

It changes nothing. Every item is a candidate and the judgement is yours: whether two lessons really say the same thing, whether a pattern generalizes, whether a literal would differ on the next call. Apply what you agree with using domain_remember, domain_forget and procedure_save, then call this again with done: true to record that the pass happened.

The goal is a site that converges on a small set of proven operations, not an archive that grows forever. Every entry costs ranking quality and tokens on every single brief.

Inputs: url (required), done.

domain_forgetDelete a lesson that is simply wrongA

Remove a lesson entirely. Prefer domain_report({ outcome: "failed" }) when you are unsure — that preserves the evidence trail. Delete only what is flatly wrong or obsolete.

Inputs: id (required), url (required).

domain_indexWhich sites have memoryA

List every domain with recorded lessons, how many, and how often they have been used.

Inputs: no named parameters.

domain_interfaceWhat this site can already doA

The operations a site has accumulated: proven procedures with their signatures, shortcuts not yet turned into operations, how access works, and what is known not to work. Read this when you are about to do real work on a site that has been visited before — it is shorter than the lessons and tells you what is callable right now.

Inputs: url (required).

domain_openRead specific lessons in fullA

Fetch the complete text — including runnable snippets — for lessons you picked out of domain_brief. Open only what you will act on; that is what keeps this cheap. An id ending -superseded is what a lesson said before it was corrected: it answers "when did this change, and to what", and it is labelled as something not to act on.

Inputs: ids (required), url (required).

domain_rememberRecord what you learned for the next agentA

Write down something that will save the next agent time on this site. Re-using an existing title overwrites that lesson, so correcting yourself is cheap and duplicates do not pile up.

Write for a stranger who has none of your context. Be specific and concrete: real selectors, real endpoints, real error strings. "The dashboard is slow" helps nobody; "GET /api/v1/stats returns the same numbers the dashboard renders, no UI needed" saves ten minutes.

Pass url:"*" for a lesson that holds on any site — how SPAs are usually built, where to look first on an unfamiliar dashboard. Those are what make the first visit to an unknown site fast.

Credentials are stripped automatically before anything is written, so never paste a token to "make the snippet complete" — write the snippet as it should be run, without secrets.

Kinds, most valuable first:

  • fast-path — a snippet that gets the data directly (internal API, fetch) instead of driving the UI

  • recipe — the ordered steps that achieved a goal, so the next agent replays instead of re-deriving

  • fix — a symptom the agent will actually observe, paired with what resolves it

  • dead-end — something that looks like it should work but does not — the wrong turn nobody documents

  • auth — how sessions, logins and tokens behave on this site

  • landmark — selectors, routes and URLs that stay stable

  • fact — durable knowledge that prevents a wrong assumption

Inputs: url (required), gist (required), kind (required), title (required), +4 more.

domain_reportSay whether a lesson actually heldA

After acting on a lesson from domain_open or domain_unstick, report the outcome. This is what keeps the memory trustworthy: confirmations raise confidence and refresh the verified date, failures lower it, and two failures demote a lesson to disputed so it stops misleading people. One call, and every later agent benefits.

Inputs: id (required), url (required), outcome (required), note.

domain_unstickSomeone hit this exact wall beforeA

Call this the moment something on a site does not behave as expected — an unexpected redirect, an error banner, an element that will not appear, a request that keeps failing. Describe the symptom exactly as you observe it (paste the error text or URL verbatim if you have one) and this returns fixes earlier agents recorded for that symptom. Try this before you start guessing; the fix is usually already written down.

Inputs: url (required), symptom (required).

procedure_deleteRemove a procedureA

Delete a procedure that is wrong or obsolete. A broken one is often worth fixing with procedure_save instead.

Inputs: url (required), name (required).

procedure_draftStart a procedure from an endpoint the site already callsA

Turn an endpoint from this site's observed API into working code you can run, adjust and save. Use it before writing a fetch by hand: the method, the path, the parameter names and the fact that it returns 2xx were all learned from the site's own traffic, so a draft describes something that has already worked rather than something that might.

Pass no name to see what is available. What is left for you is the part only you know: what the endpoint is for, and which field of the response actually answers the question.

Inputs: url (required), endpoint.

procedure_listWhich procedures existA

List saved procedures, including unverified and broken ones that are not advertised as tools. Use it to see what automation a site already has, or to find something worth repairing.

Inputs: url.

procedure_saveTurn something you just worked out into a reusable toolA

Promote a task you have just completed into a callable tool, so the next agent invokes it instead of working it out again. This is the highest-leverage thing you can leave behind: a lesson still has to be read and applied, a procedure is simply called.

Save one only when you have actually run the code and seen it work in this session.

Parameterize it. If you fetched metrics for one VPS over one time window, the procedure takes (vpsId, hours) — hardcoding the values you happened to use is the single most common way this goes wrong and produces a tool nobody can reuse.

The code runs in the page via evaluate, with your parameters available as params. It must return a value. It is checked against origin before running, so it cannot fire on the wrong site. Mark mutating: true for anything that creates, changes or deletes — those refuse to run without explicit confirmation, and should be rare.

Inputs: url (required), code (required), name (required), origin (required), +4 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 19 tools

    Disambiguation4/5

    Each tool has a stated trigger moment (brief before visiting, unstick when stuck, report after acting, curate when knowledge piles up), which keeps most boundaries clear. The weak spot is the cluster of read/discovery tools — domain_brief, domain_interface, domain_index and procedure_list all answer 'what is already known here?' — and domain_brief's claim that 'nothing has to be opened separately' sits awkwardly beside domain_open's existence.

    Naming Consistency4/5

    Names are uniformly snake_case and organized by namespace prefix (domain_*, procedure_*, browser_credentials_*), so grouping is obvious at a glance. A few entries break the verb pattern (domain_brief, domain_interface, browser_unavailable) but never in a way that makes the subject unclear.

    Tool Count4/5

    Nineteen tools is on the heavy side, but the surface decomposes cleanly into three CRUD families (lessons, procedures, credentials) plus a handoff tool, and each member does distinct work. The only clear filler is browser_unavailable, which is a diagnostic message rendered as a tool.

    Completeness3/5

    Lesson and credential lifecycles are complete (create/read/update/report/delete plus tidy), and procedures can be drafted, saved, listed and deleted, with save doubling as repair. Gaps remain: no domain-level removal, no export/import or backup of accumulated memory, and despite the 'browser-memory' name there are no actual page-interaction tools — a snapshot/click/navigate surface is assumed to live in a separate server, which leaves dead ends if that server is down.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Exposes Playwright browser automation as MCP tools, enabling AI assistants to control a real browser tab-by-tab for form filling, navigation, and more, while preserving the user's active session.
      -
    • F
      license
      A
      quality
      C
      maintenance
      Enables coding agents to drive a real Playwright-backed browser session, navigating, observing, interacting, and capturing proof on web pages via MCP tools across stdio and Streamable HTTP transports.
      15
      2
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables browser automation through MCP with native Playwright operations, deterministic assertions, and natural-language grounded actions, structured extraction, and bounded agent workflows over live page elements.
      13
      Apache 2.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM clients to drive a real browser toward one outcome per step, with page reading and element/action decisions delegated to the TypeSafe System One API while Playwright performs the actions. Exposes tools for navigation, goal-directed actions, yes/no checks, option choice, text extraction, snapshots, screenshots, and calling a page's own WebMCP tools.
      675 npm
      MIT