Use agent-browser
Keep your CLI workflow. Run the browser in Tabfleet.
Connect through CDP
Tabfleet provides a remote browser endpoint compatible with agent-browser’s CDP mode. The CLI runs in your environment and connects to the cloud browser; Tabfleet’s MCP adapter does not execute the agent-browser package inside the service.
Install agent-browser using its official installation guide. The shell example needs curl, jq, uuidgen, and an environment variable named TABFLEET_API_KEY. It was verified with agent-browser 0.27.0.
Launch, inspect, and clean up
This script saves the temporary connection URL in memory, connects the CLI, takes a snapshot, and closes the service session on exit. Keep terminal traces and shell debug logging disabled around signed URLs.
#!/usr/bin/env bash
set -euo pipefail
: "${TABFLEET_API_KEY:?Set TABFLEET_API_KEY first}"
REQUEST_ID=$(uuidgen)
SESSION=$(curl --fail-with-body -sS \
https://api.tabfleet.com/v1/sessions \
-H "Authorization: Bearer $TABFLEET_API_KEY" \
-H "Idempotency-Key: $REQUEST_ID" \
-H 'Content-Type: application/json' \
-d '{"durationSeconds":300,"idleTimeoutSeconds":120}')
SESSION_ID=$(printf '%s' "$SESSION" | jq -r '.id')
CDP_URL=$(printf '%s' "$SESSION" | jq -r '.cdpUrl')
cleanup() {
agent-browser --session tabfleet-demo close || true
curl --fail-with-body -sS -X DELETE \
"https://api.tabfleet.com/v1/sessions/$SESSION_ID" \
-H "Authorization: Bearer $TABFLEET_API_KEY"
}
trap cleanup EXIT
agent-browser --session tabfleet-demo --cdp "$CDP_URL" open https://example.com
agent-browser --session tabfleet-demo snapshot -iReconnect to an active session
New CDP connections require an unexpired token. POST to /v1/sessions/:id/connection to get another connection URL. The browser must still be active. The lease is not extended by renewing a token.
One external controller can connect per browser. The live viewer uses a separate connection and may run at the same time. See agent-browser’s CDP documentation for the CLI connection model.
Disconnection is not cleanup
agent-browser close disconnects the CLI. Always DELETE the Tabfleet session as well. If cleanup returns 202, it is still retrying; query session status until it reaches closed. Inactivity or the hard lease may also close a browser, so recover from 410 by deliberately creating a new session.