Skip to main content

Comet-Bridge (Cursor browser automation)

Comet-Bridge is a CDP-based browser automation orchestrator used by Cursor agents for persistent, authenticated browser sessions. It connects to the Perplexity Comet browser via Chrome DevTools Protocol and provides multi-step workflow execution, tab-group management, and identity-aware ownership enforcement. Comet-Bridge is distinct from the Equabot-managed browser. Use Comet-Bridge for persistent authenticated sessions (QBO, Mercury, Google) and multi-step playbooks. Use the Equabot browser for quick in-IDE checks and ephemeral validation.

Architecture

Cursor Agent

   ├─ MCP tools (comet_connect, comet_ask, comet_lifecycle_*)
   │     └─ comet-mcp stdio server ──► Comet Browser (CDP)
   │                                      └─ Tab Groups Extension

   ├─ CLI fallback (comet auto/browse/scrape/...)
   │     └─ cursor-comet.mjs ──► Comet scripts ──► Comet Browser

   └─ Lifecycle sync ──► Command Center /api/comet/lifecycle
                               └─ taskThreads.ts lifecycle adapter
                                    └─ src/data/comet-runs/*.json

Channel routing

The browser-automation-routing rule selects the channel by intent:
Use caseChannelWhy
Quick localhost checks, UI snapshotscursor-ide-browser MCPFast, ephemeral, no setup
Persistent sessions, multi-step automationComet-Bridge (MCP or CLI)CDP profile, keepalive, ownership
When Comet MCP is unavailable, agents fall back to the comet CLI wrapper. The safety protocol (identity, ownership) is enforced on both paths.

Run lifecycle

Every Comet browser run has a lifecycle tracked by the Command Center lifecycle store.

States

StateDescription
pendingRun created, not yet started (queued or deferred)
runningRun in progress; browser session active
completedRun finished successfully
abortedRun intentionally stopped (user cancel, timeout)
failedRun ended with error (script failure, CDP disconnect)

Transition table

From / Topendingrunningcompletedabortedfailed
pendingstartabortfail
runningcompleteabortfail
completed
aborted
failed
completed, aborted, and failed are terminal (no further transitions). Operations are idempotent from terminal states.

Operations

OperationMeaning
startCreate/register run; transitions to running (or pending if deferred)
updateUpdate run metadata while running (auditSessionId, tabGroupId, workflowId)
completeMark run as successfully finished
abortMark run as intentionally stopped
failMark run as failed with a reason

Identity fields

FieldRequiredMeaning
runIdYesUnique identifier for this browser run
taskThreadIdYesLinks run to a task thread in Command Center
agentIdMulti-agent onlyAgent identity for tab ownership and isolation
routeNoChannel used: mcp, cli, or http
fallbackUsedNotrue if execution used a fallback path
In multi-agent mode, both taskThreadId and agentId are required. Single-agent runs may omit agentId.

Graceful degradation

Lifecycle sync to Command Center is best-effort on both execution paths:
PathTimeoutSource
CLI (auto.mjslifecycle-sync.mjs)2 sAbortSignal.timeout(2000)
MCP (comet-mcp/src/index.ts)5 sAbortSignal.timeout(5000)
On failure (timeout or non-2xx response), the sync function logs a [lifecycle-sync] warning and returns null. The run itself continues uninterrupted. A local JSON backup (auto-{timestamp}.json) is always written regardless of whether the sync succeeds, so run data is never lost. The endpoint URL can be overridden via the COMET_CC_LIFECYCLE_URL environment variable.

MCP tools

Comet-Bridge exposes tools via its MCP server (comet-mcp):
ToolPurpose
comet_connectConnect to Comet browser (auto-starts if needed)
comet_askSend prompt to Perplexity and wait for response
comet_pollCheck status of long-running tasks
comet_stopStop current task
comet_screenshotCapture current page
comet_modeSwitch Perplexity mode (search/research/labs/learn)
comet_shortcutTrigger a Comet Query Shortcut (reusable AI prompts)
comet_read_pageExtract page content as accessibility tree / clean text
comet_wait_for_idleWait for network activity to settle
comet_tab_groupsManage Chrome tab groups (requires extension)
comet_lifecycle_startRegister a new lifecycle run
comet_lifecycle_completeMark a run as completed
comet_lifecycle_abortAbort a run
comet_lifecycle_updateUpdate metadata on a running run (auditSessionId, tabGroupId, workflowId)
comet_task_statusCheck task thread status from the orchestration layer
comet_delegateDelegate a task to a sub-agent with lifecycle tracking

Tab ownership

In multi-agent mode, tabs are owned by a single identity (agentId or taskThreadId). Ownership is marked via the document title prefix [comet-agent:<id>] and enforced at three tiers:
  1. Entry gate — identity required before browser work begins
  2. Page-level — tab assigned to the requesting identity
  3. Action-level — every sensitive action (click, fill, navigate) verifies ownership
Cross-identity access is blocked with a deterministic OwnershipError.

See also