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.
Docker¶
docker run --rm --init -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.