πŸš€ Big News:Socket Has Acquired Secure Annex.Learn More β†’
Socket
Book a DemoSign in
Socket

cbrowser

Package Overview
Dependencies
Maintainers
1
Versions
340
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbrowser

Cognitive browser automation that thinks like your usersβ€”and helps AI agents navigate too. Simulate real user cognition with abandonment detection, constitutional safety, chaos engineering, and UX friction discovery. Sites that pass CBrowser's cognitive t

latest
Source
npmnpm
Version
18.68.0
Version published
Maintainers
1
Created
Source

CBrowser β€” Cognitive Browser Automation

The browser automation that thinks like your users. 120 MCP tools. 26 cognitive traits. 11 disability personas. The only framework that predicts when users give up.

npm version Documentation License: MIT MCP Ready TypeScript Node

npm install cbrowser
npx cbrowser cognitive-effort --url "https://your-site.com" --persona first-timer

5-Minute Quickstart

Get from zero to your first cognitive insight in 3 commands:

# 1. Install CBrowser
npm install cbrowser

# 2. Install the browser engine (~150MB)
npx playwright install chromium

# 3. Run your first cognitive audit
npx cbrowser cognitive-effort --url "https://your-site.com" --persona first-timer

What you get: A cognitive transport score (0-1), abandonment risk percentage, and the UX bottleneck β€” in under 30 seconds.

No API key needed for basic commands (navigate, screenshot, click, extract, explore). Cognitive journeys require an Anthropic API key:

npx cbrowser config set-api-key <your-anthropic-key>

Check your environment: Run npx cbrowser doctor to verify everything is set up correctly.

Accessibility: CBrowser supports --no-color (or NO_COLOR env var), --plain (no emoji/decorations), and --json-output (structured JSON) for screen readers, CI pipelines, and scripting.

Table of Contents

Cognitive Transport Chain

The 6-layer Sequential Transport Chain computes exactly how hard your page is for any persona β€” and predicts whether they'll abandon:

LayerWhat It MeasuresResearch Basis
SaliencyVisual attention captureCIE-Lab Wβ‚‚ perceptual model
Cognitive LoadInformation processing demandSweller (1988) CLT
DecisionChoice complexity and fatigueHick-Hyman Law
MotorPhysical interaction difficultyGrossman & Balakrishnan (2005)
FrustrationEmotional cost accumulationCeaparu et al. (2004)
ReadabilityText comprehension effortPerry & Zorzi (2013) reading model
npx cbrowser cognitive-effort --url "https://your-site.com" --persona first-timer
# β†’ CTC: 0.76, abandonment risk: 42%, bottleneck: decision

Returns: total CTC score, per-layer breakdown, bottleneck identification, abandonment risk percentage, and motor accessibility overlay.

Visual Overlays & Attention Analysis

See where users look, what they miss, and whether your CTAs capture attention β€” per persona:

# Full visual cognitive story β€” 4 annotated images + narrative
npx cbrowser visual-cognitive-story --url "https://your-site.com" --persona cognitive-adhd

# Attention heatmap β€” where does this persona look?
npx cbrowser attention-analysis --url "https://your-site.com" --persona first-timer

# Compare how two personas experience the same page
npx cbrowser attention-compare --url "https://your-site.com" --persona-a first-timer --persona-b power-user

Overlays generated:

  • Attention heatmap β€” CIE-Lab saliency on grayscale base (red = high attention)
  • Motor accessibility β€” Green/yellow/red per element by P(hit)
  • Attention quality β€” CTAs green, distractors red, headings blue
  • Comparison diff β€” Blue = persona A attention, red = persona B

Metrics: CTA capture rate, value prop salience, distractor ratio, quality score (0-100), entropy.

AI Friendliness Suite

Five tools to make your site ready for the AI agent era:

ToolWhat It Does
agent_ready_auditScore site on findability, stability, accessibility, semantics (A-F grade)
ai_benchmarkCompare AI-friendliness across competitor URLs
webmcp_ready_auditAudit MCP server for WebMCP compatibility
remediation_patchesGenerate actionable code fixes for audit findings
llms_txt_generateGenerate AI-readable llms.txt site description
npx cbrowser agent-ready-audit "https://your-site.com" --html
npx cbrowser ai-benchmark "https://site-a.com,https://site-b.com"

Cognitive User Simulation

26 research-backed cognitive traits + 10 motivational values model how real users think, struggle, and give up:

TraitResearch BasisWhat It Models
PatienceNah (2004); Nielsen (1993)Tolerance for delays; abandonment at 8+ seconds
Working MemoryMiller (1956)7Β±2 item capacity; affects form complexity tolerance
ComprehensionCard, Moran & Newell (1983)UI convention understanding; GOMS model timing
Risk ToleranceKahneman & Tversky (1979)Prospect theory; loss aversion affects CTA clicks
Self-EfficacyBandura (1977)Belief in ability to solve problems; low = faster abandonment
SatisficingSimon (1956)Accept "good enough" vs. optimize; 50% faster decisions
Trust CalibrationFogg (2003)8 trust signals; affects click-through by 40%
Information ForagingPirolli & Card (1999)"Scent" following behavior; predicts navigation patterns
Social ProofCialdini (2001)Influence of reviews, ratings, popularity indicators
FOMOPrzybylski et al. (2013)Fear of missing out; urgency and scarcity responses

See Trait Index for all 26 traits including: Persistence, Resilience, Curiosity, Change Blindness, Anchoring Bias, Time Horizon, Attribution Style, Metacognitive Planning, Procedural Fluency, Transfer Learning, Authority Sensitivity, Emotional Contagion, Mental Model Rigidity, Interrupt Recovery, Reading Tendency, and Site Familiarity.

Full documentation: Research Methodology Β· Trait Index Β· Bibliography

17 Built-in Personas

6 general: first-timer, power-user, mobile-user, screen-reader-user, elderly-user, impatient-user

11 accessibility: motor-impairment-tremor, low-vision-magnified, cognitive-adhd, dyslexic-user, deaf-user, elderly-low-vision, color-blind-deuteranopia, autism-spectrum, intellectual-disability, aphasia-receptive, dyscalculia

Values System

Beyond cognitive traits, CBrowser models 10 motivational values from three psychological frameworks:

FrameworkResearch Basis
Schwartz's Universal ValuesSchwartz (1992) β€” 10 core values: Power, Achievement, Hedonism, Stimulation, Self-Direction, Universalism, Benevolence, Tradition, Conformity, Security
Self-Determination TheoryDeci & Ryan (1985) β€” Autonomy, Competence, Relatedness
Maslow's HierarchyMaslow (1943) β€” 5 need levels

See Values Framework for full documentation.

Custom Persona Builder

# Interactive questionnaire (8 core traits)
npx cbrowser persona-questionnaire start

# Comprehensive questionnaire (all 26 traits)
npx cbrowser persona-questionnaire start --comprehensive --name "my-tester"

# From a description β€” AI generates trait values
npx cbrowser persona-create "A 68-year-old retiree who just got their first smartphone"

Abandonment Detection

The simulation stops when a realistic user would give up:

⚠️ ABANDONED after 8 steps
Reason: Patience depleted (0.08) - "This is taking too long..."
Friction points:
  1. Password requirements unclear (step 4)
  2. Form validation error not visible (step 6)

Accessibility Empathy Testing

Simulate how users with disabilities experience your site:

npx cbrowser empathy-audit "https://your-site.com" \
  --goal "complete signup" \
  --disabilities "motor-impairment-tremor" \
  --html

Constitutional AI Safety

AI agents need boundaries. CBrowser classifies every action by risk level:

ZoneExamplesBehavior
🟒 GreenNavigate, read, screenshotAuto-execute
🟑 YellowClick buttons, fill formsLog and proceed
πŸ”΄ RedSubmit, delete, purchaseRequires verification
⬛ BlackBypass auth, inject scriptsNever executes

Site Knowledge System

CBrowser learns your site over time:

  • Page Understanding β€” DOM analysis, page type classification, available affordances
  • Site Model Learning β€” Persistent knowledge graph across sessions
  • Cross-Session Profiles β€” AES-256-GCM encrypted cookie/state profiles
  • Goal Decomposition β€” Sub-goal trees with fallback strategies

Natural Language Testing

# Test: Checkout Flow
go to https://your-site.com/products
click "Add to Cart" button
verify page contains "1 item in cart"
click checkout
fill email with "test@example.com"
click "Place Order"
verify url contains "/confirmation"
npx cbrowser test-suite checkout-test.txt --html

# Auto-repair broken tests
npx cbrowser repair-tests broken-test.txt --auto-apply --verify

Visual Testing

# AI visual regression
npx cbrowser ai-visual capture "https://your-site.com" --name homepage
npx cbrowser ai-visual test "https://staging.your-site.com" homepage --html

# Cross-browser (Chrome, Firefox, Safari)
npx cbrowser cross-browser "https://your-site.com" --html

# Responsive (mobile, tablet, desktop)
npx cbrowser responsive "https://your-site.com" --html

# A/B comparison (staging vs production)
npx cbrowser ab "https://staging.your-site.com" "https://your-site.com" --html

Competitive UX Benchmark

Run identical cognitive journeys across your site and competitors:

npx cbrowser competitive-benchmark \
  --sites "https://your-site.com,https://competitor-a.com,https://competitor-b.com" \
  --goal "sign up for free trial" \
  --persona first-timer \
  --html

Geo Proxy

Test from 12 global regions via residential proxies:

npx cbrowser cognitive-journey \
  --start "https://your-site.com" \
  --persona first-timer \
  --goal "sign up" \
  --geo-region uk

Regions: us-west, us-east, us-central, uk, germany, france, japan, australia, brazil, india, canada, singapore

MCP Server Integration

CBrowser runs as an MCP server for Claude.ai, Claude Desktop, and Claude Code.

Claude.ai (Easiest β€” No Install)

Add the MCP connector and optionally install the Claude.ai Skill:

  • Go to Customize β†’ Connectors β†’ "Add custom connector"
  • Paste: https://demo.cbrowser.ai/mcp
  • Download the Claude.ai Skill (.zip) β€” gives Claude context about tools, pricing, and workflows
  • Go to Customize β†’ Skills β†’ Upload the zip

Note: The Claude.ai Skill is a lightweight knowledge file for the web interface. It is NOT the same as the Claude Code Skill (see below).

Claude Code Skill (CLI β€” Not for Claude.ai)

For Claude Code terminal users:

curl -fsSL https://raw.githubusercontent.com/alexandriashai/cbrowser/main/scripts/install-skill.sh | bash
npm install -g cbrowser && npx playwright install

The Claude Code Skill is a full CLI integration with workflow routing, TypeScript tools, persistent memory, and constitutional safety. See Skill Installation Guide for details.

Claude Desktop

{
  "mcpServers": {
    "cbrowser": {
      "url": "https://demo.cbrowser.ai/mcp"
    }
  }
}

Local MCP Server

{
  "mcpServers": {
    "cbrowser": {
      "command": "npx",
      "args": ["cbrowser", "mcp-server"]
    }
  }
}

108 MCP Tools

CategoryToolsCount
Navigationnavigate, screenshot, scroll, extract, analyze_page, find_element_by_intent6
Interactionclick, smart_click, fill, dismiss_overlay4
Cognitive Corecognitive_journey_init, cognitive_journey_update_state, cognitive_journey_autonomous, cognitive_effort, cognitive_load_estimate, site_cognitive_assessment6
Cognitive Transportcognitive_distance, cognitive_interpolate, cognitive_coverage, transport_map4
Attention & Visual Storyattention_analysis, attention_compare, visual_cognitive_story3
Personalist_cognitive_personas, compare_personas, persona_create_*, persona_questionnaire_*, persona_trait_lookup, persona_values_*15
Testingnl_test_inline, nl_test_file, generate_tests, repair_test, detect_flaky_tests, coverage_map6
Visual Testingvisual_baseline, visual_regression, responsive_test, cross_browser_test, cross_browser_diff, ab_comparison6
Site Intelligencepage_understand, site_model_query, site_model_status, site_profile_*6
AI Friendlinessagent_ready_audit, ai_benchmark, webmcp_ready_audit, remediation_patches, llms_txt_generate, llms_txt_validate, llms_txt_diff, structured_data_suggest8
Analysishunt_bugs, chaos_test, competitive_benchmark, empathy_audit4
Performanceperf_baseline, perf_regression2
Marketing (Enterprise)marketing_campaign_*, marketing_audience_discover, marketing_compete, marketing_funnel_analyze, marketing_influence_matrix, marketing_lever_analysis, marketing_personas_list, list_influence_patterns11
Securitysecurity_audit, web_security_scan2
Stealth (Enterprise)stealth_enable, stealth_disable, stealth_status, stealth_check, stealth_diagnose, cloudflare_detect, cloudflare_wait7
Session & Browsersave_session, load_session, delete_session, list_sessions, list_baselines, browser_health, browser_recover, reset_browser, heal_stats, status10
Utilityassert, ask_user, set_api_key, api_key_status, clear_api_key, get_api_key_prompt6

Token Cost & Selective Loading

120 MCP tools consume ~45,000 tokens in LLM context. For cost-sensitive use, load selectively:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import {
  registerNavigationTools,
  registerInteractionTools,
  registerExtractionTools,
} from "cbrowser/mcp-tools";

const server = new McpServer({ name: "my-app", version: "1.0.0" });
const context = { getBrowser: () => browser };

// ~5,000 tokens instead of ~45,000
registerNavigationTools(server, context);
registerInteractionTools(server, context);
registerExtractionTools(server, context);

Categories: navigation, interaction, extraction, assertion, analysis, session, healing, visualTesting, testing, bugAnalysis, personaComparison, cognitive, cognitiveTransport, attention, siteKnowledge, values, performance, audit, browserManagement, security, marketing, remediation, llmsTxt.

CI/CD Integration

GitHub Actions

name: CBrowser Tests
on: [pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: alexandriashai/cbrowser@v18
        with:
          test-file: tests/e2e/checkout.txt
          sensitivity: strict

Docker

docker run --rm -v $(pwd)/tests:/work/tests ghcr.io/alexandriashai/cbrowser:latest \
  test-suite tests/checkout.txt --html

API Reference

import { CBrowser } from 'cbrowser';

const browser = new CBrowser({
  headless: true,
  persistent: true,
});

await browser.navigate('https://example.com');

const result = await browser.smartClick('Sign In', {
  maxRetries: 3,
  minConfidence: 0.8,
});

const assertion = await browser.assert("page contains 'Welcome'");
if (!assertion.passed) {
  console.error(assertion.message);
}

await browser.close();

Modular Imports

import { runVisualRegression, runCrossBrowserTest } from 'cbrowser/visual';
import { runNLTestSuite, detectFlakyTests, repairTest } from 'cbrowser/testing';
import { huntBugs, runChaosTest, findElementByIntent } from 'cbrowser/analysis';
import { capturePerformanceBaseline, detectPerformanceRegression } from 'cbrowser/performance';

Configuration

VariableDefaultDescription
CBROWSER_DATA_DIR~/.cbrowserData storage directory
CBROWSER_HEADLESStrueRun headless
CBROWSER_BROWSERchromiumBrowser engine
CBROWSER_TIMEOUT30000Default timeout (ms)
CBROWSER_PROXYβ€”Proxy URL
npx cbrowser config set-api-key  # Required for cognitive journeys

Enterprise Edition

CBrowser Enterprise adds:

FeatureDescription
Marketing SuiteTest which design/copy/UX patterns influence which buyer segments
8 Marketing PersonasB2B (enterprise-buyer, startup-founder, procurement-manager, technical-evaluator) + Consumer (impulse-shopper, price-researcher, loyal-customer, skeptical-first-timer)
Influence MatrixConversion effectiveness for variant Γ— persona combinations
Lever AnalysisWhich psychological persuasion patterns work for each persona
Constitutional StealthFull stealth measures for authorized penetration testing
Web Security ScanOWASP-based security scanning

All 120 MCP tools included with no rate limits.

License

MIT License β€” Free and open source. See LICENSE.

Β© 2026 Alexandria Eden Β· cbrowser.ai Β· alexandria.shai.eden@gmail.com

Research

Keywords

browser-automation

FAQs

Package last updated on 01 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts