/integrations:playwright-mcp-singleton-lock-workaroundfrom integrations
Workaround for "Browser is already in use for .../mcp-chrome-..., use --isolated to run multiple instances of the same browser" error from Playwright MCP. Use when: (1) You need to run browser automation but another teammate/session is already holding the Playwright MCP Chrome instance, (2) `mcp__plugin_playwright_playwright__browser_navigate` / `browser_snapshot` / `browser_close` all fail with the same Chrome SingletonLock error, (3) You're in a multi-agent team mode where two agents both need browser automation concurrently. Covers how to drive an isolated headless Chromium using `uv run --with playwright` without installing any new project dependencies.
Ships in integrations. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The Playwright MCP server (@playwright/mcp) launches Chromium against a fixed
--user-data-dir at ~/Library/Caches/ms-playwright/mcp-chrome-<hash>/. Chrome
enforces a SingletonLock file inside that directory so only ONE Chrome
process can own it at a time.
In a multi-agent team mode (Claude Code's TeamCreate + multiple subagents),
if two agents both need Playwright MCP browser automation, the second one to
call any mcp__plugin_playwright_playwright__browser_* tool gets:
Error: Browser is already in use for /Users/<you>/Library/Caches/ms-playwright/mcp-chrome-XXXXXXX, use --isolated to run multiple instances of the same browser
Every subsequent call — browser_navigate, browser_snapshot, browser_close,
even tabs_context_mcp — returns the same error. browser_close does NOT
release the lock because the lock is held by a different MCP server instance,
not this one.
The --isolated flag the error mentions is an argument to the playwright-mcp
CLI itself, which is spawned by the Claude Code harness — you cannot pass it
from the tool call site. Claude-in-chrome is often unavailable as a fallback
("Browser extension is not connected").
Apply this workaround when ALL of the following are true:
ps aux | grep playwright-mcp shows a running MCP server from a different sessionmcp__plugin_playwright_playwright__browser_* call returns
"Browser is already in use for .../mcp-chrome-..., use --isolated..."browser_close returns the same error (you can't even reset state)mcp__claude-in-chrome__tabs_context_mcp returns
"Browser extension is not connected"If you're NOT in team mode and hit this, try killing the stale playwright-mcp
process first: pgrep -f playwright-mcp | xargs kill — that may be enough.
Drive a fully isolated Chromium from Python using the Playwright binary cache
that Playwright MCP already populated at ~/Library/Caches/ms-playwright/.
No new project dependencies are installed — uv run --with playwright
creates an ephemeral venv that lasts only for the command.
uv run --with playwright python -c "
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
b = p.chromium.launch(headless=True)
b.close()
print('chromium ok')
"
Expected output: chromium ok. If it says "Executable doesn't exist at ...",
you need uv run --with playwright playwright install chromium first — but
if the Playwright MCP server has ever run successfully on this machine, the
binary is already there.
Put the script in /tmp/ (not in the repo — it's throwaway). Give it a real
viewport, capture console and pageerror events, and assert on
page.evaluate("document.body.innerText") contents. Key idiom:
from playwright.sync_api import sync_playwright
console_messages = []
errors = []
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
ctx = browser.new_context(viewport={"width": 1440, "height": 900})
page = ctx.new_page()
page.on("console", lambda m: console_messages.append({"type": m.type, "text": m.text}))
page.on("pageerror", lambda e: errors.append(str(e)))
page.goto("http://localhost:8501", wait_until="networkidle", timeout=60_000)
page.wait_for_timeout(3000)
page.wait_for_function("document.body.innerText.includes('Data source')", timeout=30_000)
# Walk iframes for iframe-isolated widgets (e.g. extra-streamlit-components)
for f in page.frames:
try:
loc = f.get_by_text("Parquet", exact=False)
if loc.count() > 0:
loc.first.click(timeout=5000)
break
except Exception:
pass
page.wait_for_timeout(4000)
body = page.evaluate("document.body.innerText")
page.screenshot(path="/path/to/evidence.png", full_page=True)
browser.close()
print("BINANCE in body:", "BINANCE" in body)
print("console errors:", sum(1 for m in console_messages if m["type"] == "error"))
print("page errors:", len(errors))
uv run --with playwright python /tmp/verify_ui.py
That's it. The ephemeral chromium launched by this command uses a different user-data-dir than the MCP server, so SingletonLock never conflicts.
Write a second script that clicks every tab and asserts controls render without tracebacks. Run them as two separate processes so each gets a fresh browser context.
You should be able to answer yes to all of:
browser.close() exit cleanly without "Browser is already in use"?playwright to pyproject.toml / requirements.txt?If all yes, you have a working parallel path and the teammate is unaffected.
Real incident (2026-04-08, nautilus-trader-streamlit Task 1.11):
Agent fixer-2 needed to visually verify a Streamlit PARQUET tab fix using
Playwright MCP. Agent explorer-1 (same team, different session) was still
holding the MCP Chrome instance. Every browser_navigate call returned:
Error: Browser is already in use for ~/Library/Caches/ms-playwright/mcp-chrome-082c387, use --isolated to run multiple instances of the same browser
browser_close returned the same error. mcp__claude-in-chrome__tabs_context_mcp
returned "Browser extension is not connected."
Workaround used:
# /tmp/verify_parquet_ui.py drives its own chromium via sync_playwright().
# Isolated user-data-dir — no conflict with MCP.
uv run --with playwright python /tmp/verify_parquet_ui.py
Output:
Assertion 1 — Parquet tab visible: True
Assertion 2a — BINANCE in Exchange: True
Assertion 2b — BTCUSDT in Symbol: True
Assertion 2c — 60min in TimeFrame: True
Assertion 2d — bar_type rendered: True
Console errors count: 0
Page errors count: 0
OVERALL: PASS
Screenshot saved to .playwright-mcp/phase1-task111-parquet-working.png.
Team lead received evidence; task #11 marked complete. explorer-1's session
was unaffected.
uv run --with <pkg> is the key primitive. It creates an ephemeral venv
just for that command, installs playwright (and its 3 deps) in ~20ms on
warm cache, and never touches your project pyproject.toml. This is the
right escape hatch whenever you need a one-shot dev tool without polluting
dependencies.PLAYWRIGHT_BROWSERS_PATH
or the default ~/Library/Caches/ms-playwright/, and both the MCP server
and your ephemeral script resolve to the same install. You are NOT downloading
a second chromium.sync_playwright() block gets an isolated user-data-dir by default
(Playwright generates a temp dir for each launch()). This is DIFFERENT from
what the Playwright MCP server does — MCP pins a fixed dir for session
persistence, which is what causes the SingletonLock.browser_close is not a fix. In the team-mode scenario, the lock is held
by a different process. browser_close can't release someone else's lock;
it just returns the same error.kill the other playwright-mcp process. That kills your teammate's
active work. Use the isolated workaround instead.extra-streamlit-components tab bars render
inside an iframe at a URL like
http://localhost:8501/component/extra_streamlit_components.TabBar.tab_bar/....
page.get_by_text("Parquet") on the main page will NOT find it. You MUST
iterate page.frames and call f.get_by_text(...) on each frame. See the
sibling skill streamlit-ui-visual-verification for more.<repo>/.playwright-mcp/ so they end up in the git working tree for commit
(team-lead expects .png evidence in SendMessage). The directory name is a
convention that matches what the Playwright MCP server uses.streamlit-ui-visual-verification (how to verify Streamlit
dashboards without falling into the "server-up ≠ UI-works" trap)team-mode-orchestration-verification (why you trust the
filesystem / rendered DOM over teammate self-reports)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cajias/claude-skills --plugin integrations7 skills in this plugin
/grafana-dashboard-datasource-uid-mismatchFix for Grafana dashboard panels silently showing "No data" even though
Prometheus (or any other datasource) has the data and the same query
works in Prometheus's own UI. Use when: (1) a freshly-imported or
provisioned Grafana dashboard shows "No data" on every panel; (2) the
metric exists in Prometheus's `/api/v1/query` response but doesn't
render in any Grafana panel; (3) you set up Grafana via Docker
provisioning (`provisioning/datasources/*.yml` +
`provisioning/dashboards/*.json`) and the dashboard doesn't bind to
the datasource; (4) bringing up a stack on a fresh `grafana_data`
volume causes the dashboard to break even though it worked before;
(5) Grafana logs show
`level=error msg="Failed to provision data sources" error="Datasource provisioning error: data source not found"`
after adding `uid:` to a datasource YAML and restarting. Root cause is
a datasource UID mismatch between the dashboard JSON's hardcoded
`"uid": "prometheus"` and the auto-generated UID Grafana gives an
unpinned datasource.
/mcp-file-upload-base64-transport-limitWhy you cannot upload a real file (>~15 KB) through content-MCP tools that
take base64 inline — Google Drive `create_file`, similar Notion/media MCPs —
and what to do instead. Use when: (1) `create_file` (or any MCP upload) fails
with "Request contains an invalid argument" on a .pptx/.pdf/.png/.zip; (2) an
upload subagent loops for many minutes / hours retrying the same file;
(3) you Read a base64 file to feed a tool and it truncates (e.g. "returned
only the first 22,377 of 124,988 characters", 25K-token cap, one unbreakable
line); (4) you're about to push a binary to Drive/Notion via an MCP and the
file is more than ~11 KB; (5) you need to embed a deck/file in Notion (Notion
MCP is URL/text-only — no binary upload). Also records that Office files
(.pptx/.docx/.xlsx) DO auto-convert to native Google editor types on
create_file by default.
/notion-publish-generated-markdownGotchas when publishing AI/subagent-drafted Notion-flavored markdown via the
Notion MCP (notion-create-pages / notion-update-page) — especially design-phase
artifacts with callouts, <table> blocks, and mermaid diagrams. Use when:
(1) a published Notion page shows literal "<callout" / "<table" / "&"
instead of rendered blocks; (2) a subagent returns drafted markdown with HTML
entities escaped (< > &) that you are about to pass to
notion-create-pages; (3) a mermaid diagram silently fails to render and a
subgraph/node id is a reserved word such as `graph`, `end`, or `subgraph`;
(4) you fanned out drafters to publish pages and need to confirm the pages
actually landed.
/openpencil-mcp-gotchasOperational gotchas + recovery for driving the OpenPencil design editor through its MCP server (open-pencil / openpencil-mcp; the mcp__open-pencil__* tools — render, export_image, export_svg, set_image_fill, set_layout_child, set_font_range, new_document, save_file). Use when: (1) export_image returns "No visible nodes to export" though get_page_tree shows real nodes; (2) rendered text overflows/overlaps because a font (Inter, Newsreader, IBM Plex, Geist) is not installed and the app rasterizes with a wider fallback; (3) justify="space-between" in render JSX does not right-align children; (4) the app stops responding and every mcp__open-pencil__* call returns {"error":"RPC timeout (30s)"}; (5) set_image_fill hangs the app when given a real-photo-sized base64; (6) setting up open-pencil MCP for Claude Code. Complements the official open-pencil/skills@open-pencil API skill with the edge cases it does not cover.
/workers-best-practicesReviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge./wranglerCloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.Other plugins' skills for the same job