DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to keep logins and cookies between agent browsing runs with Invisible Playwright MCP

Store the browser profile in a folder so the agent stays signed in to sites after a restart.

Short answer: Install uv with the README command for your system; then choose an empty folder to hold the profile, for example ./agent-profile; run uvx invisible-playwright-mcp ui --profile-dir ./agent-profile so the profile is kept there. All steps.

Authorization notice. Invisible Playwright MCP is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.

Credentials. The profile folder holds logins and cookies for your accounts, so protect it and delete it when you no longer need the sessions.

Who it is forA user who needs an agent to return to the same sites repeatedly, such as a dashboard or account page, without signing in every time.

The problemEach new browser start normally begins with no cookies, so the agent must log in again on every task.

The outcomeA profile folder that holds logins and cookies across restarts, and a fixed browser identity when you also set a seed.

What you need first

  • uv installed, using the install command for your operating system from the README
  • An OpenRouter API key for the standalone web UI and for model calls
  • An MCP-capable assistant such as Claude Code, Codex or Gemini CLI, for the MCP route
  • Permission to automate the sites you point it at, and a read of their terms

Steps

  1. Install uv with the README command for your system.
  2. Choose an empty folder to hold the profile, for example ./agent-profile. (inferred, check the README)
  3. Run uvx invisible-playwright-mcp ui --profile-dir ./agent-profile so the profile is kept there. (inferred, check the README)
  4. Add --seed 42 to the same command if you want the same browser identity on every run. (inferred, check the README)
  5. Sign in to the site once through the browser, then restart and check the agent is still signed in.

Prompt for your agent

Using the invisible-playwright-mcp server from feder-cr/invisible_playwright_mcp with a profile directory set to <profile-folder>, open <site-url> and report whether the account page loads without a login prompt. Expected output: a yes or no with the page title. Verify that the profile folder now contains the session data after the first run.

Caveat. The README says sessions and profiles are stored locally and are yours to delete, but it does not describe how the profile is encrypted, so do not assume it is protected beyond your own file permissions.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for feder-cr/invisible_playwright_mcp and "Keep logins and cookies between agent browsing runs"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer