chrome-profile-mcp
Allows driving a real Chrome profile (with existing logins, cookies, sessions) via Playwright MCP, enabling browser automation on a specific Chrome profile.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@chrome-profile-mcpOpen Gmail in my work Chrome profile and check for new emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
chrome-profile-mcp
Drive your real Chrome profiles (with existing logins, cookies, sessions) from Claude Code via @playwright/mcp --extension + the Playwright Chrome Extension relay.
Why this exists
Upstream @playwright/mcp --extension auto-discovers which Chrome profile to open — Default first, then numeric Profile N, preferring last_used — with no knob to pin a specific profile. If the browser extension is installed in several profiles, the relay tab can land in the wrong one (e.g. Diana's instead of jamu's).
This repo adds one env var, PLAYWRIGHT_MCP_PROFILE_DIRECTORY, via a small idempotent patch script, so each MCP server deterministically opens its own profile.
No extension code is modified. No credentials or tokens are stored here.
Related MCP server: agentic-browser-mcp
How it works
npm ciinstalls pinned@playwright/mcp@0.0.80(which pullsplaywright-core).npm run postinstallrunspatch-profile-directory.mjs, which rewrites one line innode_modules/playwright-core/lib/coreBundle.js(createExtensionBrowser):
// before (upstream)
const profileDirectory = userDataDir ? await findPlaywrightExtensionProfile(userDataDir) : void 0;
// after (patched)
const profileDirectory = process.env.PLAYWRIGHT_MCP_PROFILE_DIRECTORY ?? (userDataDir ? await findPlaywrightExtensionProfile(userDataDir) : void 0); // PATCHEDEach MCP server runs the vendored CLI with its own token + profile:
{
"mcpServers": {
"mcp-jamu": {
"type": "stdio",
"command": "node",
"args": ["<repo>/node_modules/@playwright/mcp/cli.js", "--extension"],
"env": {
"PLAYWRIGHT_MCP_EXTENSION_TOKEN": "<token-from-that-profile>",
"PLAYWRIGHT_MCP_PROFILE_DIRECTORY": "Profile 5"
}
}
}
}The token must equal that profile's extension localStorage auth-token (open chrome-extension://mmlmfjhmonkocbjadbfplnigmagldckm/connect.html in the target profile to view/regenerate it). Matching token → silent auto-connect; mismatch → Invalid token provided.; no token → manual tab picker.
Setup
git clone <this-repo> ~/.chrome-mcp/extension-servers # or anywhere
cd ~/.chrome-mcp/extension-servers
npm ci # installs + patches (postinstall)
node patch-profile-directory.mjs # re-run any time node_modules is reinstalledRequirements: Google Chrome (stable channel path), Playwright Extension installed in each target profile, @playwright/mcp@0.0.80 (pinned; the patch anchors to this bundle layout and fails loudly otherwise).
Constraints / gotchas
Never set
--user-data-dirto the live Chrome home — a second copy fightsSingletonLock. With defaults (channel: chrome→~/Library/Application Support/Google/Chromeon macOS) the relay attaches to the running Chrome session.Never run two servers with the same/empty profile pin — each needs its own relay port + connect tab.
One profile = one token. Never commit tokens — use
.mcp.jsonenv (local, gitignored by clients) or your process manager's secret store.Patch is version-pinned: bumping
@playwright/mcprequires re-verifying the anchor strings inpatch-profile-directory.mjs.Tools surface as
browser_*(browser_navigate,browser_snapshot, …), notpuppeteer_*.
Verify
# should print: Version 0.0.80
./node_modules/.bin/playwright-mcp --version
# should print the patched line
grep -n PLAYWRIGHT_MCP_PROFILE_DIRECTORY node_modules/playwright-core/lib/coreBundle.jsThen point an MCP client at the vendored CLI, call browser_navigate https://example.com, and confirm the visit lands in the pinned profile's History (copy the live History file first — Chrome locks it while running).
Files
File | Purpose |
| Exact-pinned |
| Idempotent patch script (the actual patch) |
| Template server entries (tokens redacted) |
| Excludes |
License
MIT — patch script and docs. Upstream packages retain their own licenses (Apache-2.0).
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Run multi-step tasks in a real Chrome browser: persistent environments, live view, human takeover.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables browser automation over MCP using a real Chrome browser with existing profile, supporting real tabs, downloads, cookies, and RPA workflows.44 npmMIT
- AlicenseAqualityBmaintenanceEnables MCP clients to automate a real Chrome browser via Playwright, supporting session sharing and tools for navigation, clicking, typing, and more.112MIT
- AlicenseAqualityDmaintenanceDrives your real local Chrome with profile isolation, allowing LLMs to interact with your logged-in sessions without modifying your actual profile.1348 npmMIT
- FlicenseAqualityCmaintenanceExposes Codex's Chrome plugin as an MCP server, enabling MCP clients to drive a real, logged-in Chrome browser by navigating, snapshotting the DOM, clicking, typing, taking screenshots, running Playwright, and sending raw CDP commands.20-