DEDUPED Hot AI repos, turned into use cases Get 5 a day

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.

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.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page