Go MCP server that drives perplexity.ai in a headed Playwright browser (Pro login, Deep research, continue, export).
Agents: start at AGENTS.md. Skills: ai-copilots/.
Status: P3 — session, research, continue, and export are wired.
Consilium design: see that repo’s docs/planned/perplexity-browser/.
| Tool | Status |
|---|---|
perplexity_session |
Yes: status, diagnose (read-only; no Goto/Reload), wait_for_login, close, cancel |
perplexity_research |
Yes — new thread; default mode=search (Search compose); mode=deep via compose / then Deep Research (+ Use); fallback legacy mode pills; submit, wait, extract |
perplexity_continue |
Yes — follow-up on active thread |
perplexity_export |
Yes — ⋯ menu → Export as Markdown (not Share) / Deep Research download via Playwright ExpectDownload+SaveAs (GUID filenames OK under CDP); scrape fallback; export_manual only if both fail |
make bootstrap # go mod tidy + Playwright Chromium (npm + nodejs driver assemble)
make build
make test
make smoke # prints session JSON (need_login on a cold profile is OK)Requires playwright-go v0.6100.0+ (assembles driver from npm + nodejs.org). See scripts/bootstrap-note.md.
Profile (dedicated Chromium/Chrome user-data dir; login cookies persist across MCP restarts):
~/.perplexity-browser-mcp/profile # default (bundled Chromium)
~/.perplexity-browser-mcp/profile-chrome # recommended with PERPLEXITY_BROWSER_CHANNEL=chrome
~/.perplexity-browser-mcp/exports
If Cloudflare / “security verification” blocks you on Chromium for Testing, use real Chrome over CDP:
"env": {
"PERPLEXITY_BROWSER_HEADLESS": "0",
"PERPLEXITY_BROWSER_USER_DATA_DIR": "/Users/YOU/.perplexity-browser-mcp/profile-chrome",
"PERPLEXITY_BROWSER_CDP_URL": "http://127.0.0.1:9222"
}When PERPLEXITY_BROWSER_CDP_URL is set, the MCP auto-launches Google Chrome with the same flags as scripts/chrome-cdp.sh if nothing is listening on that port (PERPLEXITY_BROWSER_CDP_AUTO_LAUNCH=1, default). Playwright-go then attaches over CDP. Chrome cold-starts on PERPLEXITY_BROWSER_WARMUP_URL (default https://www.google.com); the MCP then navigates to Perplexity when needed. If the restored tab is blank or off-site, status / wait_for_login warm up then open Perplexity; an already-open Perplexity tab is left alone. close disconnects only; Chrome stays open for login. Set PERPLEXITY_BROWSER_CDP_AUTO_LAUNCH=0 to require a manual chrome-cdp.sh start.
Alternative without CDP (Playwright launches Chromium/Chrome directly):
"env": {
"PERPLEXITY_BROWSER_HEADLESS": "0",
"PERPLEXITY_BROWSER_CHANNEL": "chrome",
"PERPLEXITY_BROWSER_USER_DATA_DIR": "/Users/YOU/.perplexity-browser-mcp/profile-chrome"
}If the browser window is closed, the next tool call relaunches from that same profile (you should not need to sign in again). close only stops the window; it does not wipe the profile.
Install the perplexity-browser plugin so skills (perplexity-browser-research, perplexity-browser-ops) and MCP load together. See docs/PLUGIN.md.
- Clone into
~/.cursor/plugins/local/perplexity-browser(real directory, not a symlink outside that folder). make buildin the plugin directory.- Developer: Reload Window, then start a new Agent chat.
- Disable any user-level
perplexity-browserMCP entry so tools are not duplicated (dual-run).
The plugin MCP runs scripts/mcp-serve.sh, which always execs perplexity-browser-mcp serve.
If you are not using the plugin, register stdio MCP yourself and must pass serve:
{
"mcpServers": {
"perplexity-browser": {
"command": "/absolute/path/to/perplexity-browser/bin/perplexity-browser-mcp",
"args": ["serve"],
"env": {
"PERPLEXITY_BROWSER_HEADLESS": "0"
}
}
}
}Bare command without args: ["serve"] prints the agent guide and is not MCP.
One global MCP entry is fine. The server shares one browser profile but isolates thread state per Cursor workspace:
- Auto (default): MCP client
roots/list→ workspace folder name (e.g.cr-case-intake→sessions/cr-case-intake.json). - Override: pass
session_idon a tool call. - Fallback:
PERPLEXITY_BROWSER_SESSION_IDenv when roots are unavailable (smoke CLI, non-Cursor clients).
continue / export activate the scope (navigate to that session URL if needed). Responses include session_id and active_session_id.
If two repos share the same folder basename, pass an explicit session_id on one of them.
The MCP is repo-agnostic. Each consumer project needs a workflow doc (prepare → research → export → file results).
Scaffold in a consumer repo:
perplexity-browser-mcp init /path/to/repo
perplexity-browser-mcp init . --layout docsSee docs/repo-integration.md for layouts, agent customization, and smoke test.
| Command | Purpose |
|---|---|
perplexity-browser-mcp init [dir] |
Write host overlay (default: .cursor/perplexity/project-persona.md + one pack) |
perplexity-browser-mcp help |
Init flags and examples |
Use the plugin or ai-copilots/BOOTSTRAP.md for skill discovery; host packs live under .cursor/perplexity/.
| Variable | Default |
|---|---|
PERPLEXITY_BROWSER_USER_DATA_DIR |
~/.perplexity-browser-mcp/profile |
PERPLEXITY_BROWSER_EXPORT_DIR |
~/.perplexity-browser-mcp/exports |
PERPLEXITY_BROWSER_STATE_PATH |
~/.perplexity-browser-mcp/state.json (legacy; migrated for default session) |
PERPLEXITY_BROWSER_SESSION_ID |
default — default logical session when tools omit session_id |
PERPLEXITY_BROWSER_SESSIONS_DIR |
~/.perplexity-browser-mcp/sessions — one \<session_id\>.json per caller |
PERPLEXITY_BROWSER_HEADLESS |
0 |
PERPLEXITY_BROWSER_BASE_URL |
https://www.perplexity.ai |
PERPLEXITY_BROWSER_WARMUP_URL |
https://www.google.com — cold-start landing before Perplexity; set off to disable |
PERPLEXITY_BROWSER_DEFAULT_TIMEOUT_MS |
900000 |
PERPLEXITY_BROWSER_SEARCH_TIMEOUT_MS |
180000 |
PERPLEXITY_BROWSER_POLL_MS |
800 (idle/stability poll) |
PERPLEXITY_BROWSER_POLL_FAST_MS |
350 (poll while generating) |
PERPLEXITY_BROWSER_STABLE_POLLS |
2 |
PERPLEXITY_BROWSER_CDP_URL |
(empty) — when set, attach over CDP instead of Playwright launch |
PERPLEXITY_BROWSER_CDP_AUTO_LAUNCH |
1 — launch Chrome like scripts/chrome-cdp.sh when CDP connect fails |
PERPLEXITY_BROWSER_CHROME_APP |
OS default Google Chrome path |
- Page watch (observe-only): After a successful
SubmitPrompt, research/continue responses includepage_watch(navigation, reload, script navigation, page errors). The MCP home reload inGotoHomeruns before submit, so it is not recorded. Rebuild and restart the MCP server to pick up changes. Readreset_detectedwhen the answer text looks like the compose chrome (What do you want to know?) instead of a thread. - Search reuses an already-open Perplexity home compose (no Goto, no reload). A thread URL hops to home without reload. Cold land from blank or off-site still reloads once to clear first-paint collection/project modals over
#ask-input. - Automation does not click bare New (that control opens Collections/Projects). It uses New Thread only when needed, and dismisses Cancel/Escape overlays before typing.
- Completion wait no longer treats bare Cancel, page-wide “searching/thinking” text inside the finished answer, or
mainlength churn (related/sources) as “still generating.” - Rebuild (
make build) updatesbin/perplexity-browser-mcp. Restart the MCP server in Cursor so the running process picks up the new binary.
Releases are v* tags plus GitHub Release binaries from GoReleaser.
Auto patch on main: every push to main that is not docs/chore/ci-only creates vX.Y.(Z+1) and publishes a release (workflow auto-patch-release.yml). Put [skip release] in the commit subject to opt out once.
Skip (no tag): when every commit subject since the last v* tag is only docs:, chore:, or ci: (conventional prefixes).
Manual minor/major: run workflow Auto patch release with bump=minor or bump=major (or push a v* tag yourself). Use major only for breaking public API changes.
After a new tag, consumer agents MUST pin:
git -C providers/perplexity-browser fetch --tags origin
git -C providers/perplexity-browser checkout "vX.Y.Z"Apache-2.0