Persistent Login Profile¶
Use a persistent profile when an MCP client should keep cookies, local storage, cache, or extension state between browser sessions.
npm¶
mkdir -p .profiles/default
PLAYWRIGHT_MCP_USER_DATA_DIR="$PWD/.profiles/default" \
npx -y cloakbrowser-mcp@latest
Point your MCP client at the same stdio command. Keep one active server per profile directory; the bridge rejects duplicate active use to reduce Chromium profile corruption risk.
After an unclean shutdown, the bridge reclaims .cloakbrowser-mcp-profile.lock only when its recorded process ID is valid and the process no longer exists. Locks with a live owner, unreadable or invalid contents, or an uncertain process status still block startup. This recovery does not terminate surviving Chromium processes or remove Chromium's own locks.
Restart only one server per profile at a time: rechecking and removing a stale lock are not atomic. If writing a newly created lock fails, the bridge closes its file descriptor and removes the file only if the path still identifies that file.
Docker¶
docker run --rm -i \
-e PLAYWRIGHT_MCP_USER_DATA_DIR=/data/profiles/default \
-v "$PWD/artifacts:/data" \
swimmwatch/cloakbrowser-mcp:latest
Use container paths in environment variables. The host path is only used in the -v mount.
Verify¶
- Ask the MCP client to open a login page and sign in.
- Stop the server cleanly.
- Start it again with the same
PLAYWRIGHT_MCP_USER_DATA_DIR. - Ask the client to revisit the site and confirm the login state is still present.
Related¶
CloakBrowser 0.6.0¶
With CloakBrowser stealth enabled, an explicitly configured persistent profile retains its fingerprint seed in .cloakbrowser-seed. The first launch after upgrading assigns a seed if the file is absent. An explicit --fingerprint, including --fingerprint=off, takes precedence and leaves the file unchanged. No seed file is changed when stealth is disabled. Corrupt seed files are regenerated with a warning; file access failures stop startup.