npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

browserbase-session-debugger

v0.2.0

Published

MCP server for debugging completed Browserbase sessions — inspect logs, recordings, DOM snapshots, and network activity from past runs

Readme

browserbase-session-debugger

npm version

MCP server for debugging completed Browserbase sessions. Inspect CDP logs, rrweb recordings, DOM snapshots, and network activity from past browser runs.

What is this?

This is a post-run forensics tool — not for controlling live browsers. The official @browserbasehq/mcp-server-browserbase handles live browser control via Stagehand. This tool is for investigating what happened in sessions that already completed (or failed).

Use cases:

  • "Why did my automation session fail?"
  • "What did the DOM look like when the selector couldn't be found?"
  • "Show me all network failures in this session"
  • "Compare this failing session to the one that worked yesterday"

Setup

Add to your MCP client config (Claude Desktop, Cursor, etc.):

{
  "mcpServers": {
    "browserbase-debug": {
      "command": "npx",
      "args": ["-y", "browserbase-session-debugger"],
      "env": {
        "BROWSERBASE_API_KEY": "<your-api-key>",
        "BROWSERBASE_PROJECT_ID": "<your-project-id>",
        "STAGEHAND_MODEL_API_KEY": "<model-provider-key>"
      }
    }
  }
}

Get your API key and project ID from the Browserbase dashboard.

STAGEHAND_MODEL_API_KEY is only required for the get_replay_session_metrics and get_session_ai_summary tools. Use the model-provider key matching whichever LLM the original Stagehand run used — supported providers include OpenAI, Anthropic, Google Gemini, Vertex AI, Azure, Cerebras, DeepSeek, Groq, Mistral, Ollama, Perplexity, TogetherAI, xAI, Bedrock, and Cohere. See the Stagehand replay docs and model providers.

Remote (Streamable HTTP)

If you're hosting the server remotely (e.g., on a VPS, Railway, Fly.io), users can connect via URL with no local installation:

{
  "mcpServers": {
    "browserbase-debug": {
      "url": "https://your-server.com/mcp"
    }
  }
}

To start the server in HTTP mode:

BROWSERBASE_API_KEY=<key> BROWSERBASE_PROJECT_ID=<id> node build/index.js --http
# or
TRANSPORT=http PORT=3000 node build/index.js

Local development

{
  "mcpServers": {
    "browserbase-debug": {
      "command": "node",
      "args": ["/path/to/browserbase-session-debugger/build/index.js"],
      "env": {
        "BROWSERBASE_API_KEY": "<your-api-key>",
        "BROWSERBASE_PROJECT_ID": "<your-project-id>",
        "STAGEHAND_MODEL_API_KEY": "<model-provider-key>"
      }
    }
  }
}

Tools

Core

| Tool | Description | |------|-------------| | list_sessions | List sessions filtered by status (ERROR, TIMED_OUT, COMPLETED, RUNNING) and/or metadata query | | get_session_details | Get full details of a specific session | | get_session_logs | Get Chrome DevTools Protocol logs, optionally filtered by domain (Network, Console, Page, Runtime, DOM) | | get_session_recording | Get rrweb recording summary (event counts, time range, snapshots) | | get_session_downloads | Check if a session has downloaded files (served as ZIP) |

Smart Analysis

| Tool | Description | |------|-------------| | get_session_errors | Extract all errors: JS exceptions, console errors, network failures | | get_network_log | HAR-lite view of all network requests with status, timing, and size | | get_dom_snapshot | Reconstruct DOM state at any point in the recording | | compare_sessions | Side-by-side diff of two sessions (events, errors, network URLs) |

Stagehand Integration

| Tool | Description | |------|-------------| | get_stagehand_actions | Reconstruct Stagehand act/extract/observe/navigate calls from CDP logs with timing and parameters |

AI Replay Metrics

Backed by Stagehand's replay-metrics endpoint (alpha). Requires STAGEHAND_MODEL_API_KEY.

| Tool | Description | |------|-------------| | get_replay_session_metrics | Per-action LLM token usage, cost, duration, parameters, and results — inspect the agent's train of thought and debug AI fallbacks. Supports verbose and filter_method | | get_session_ai_summary | High-level totals (tokens, cost, LLM time), breakdown by method, slowest and most expensive actions — fast triage |

Example prompts

  • "Show me all failed sessions"
  • "What errors happened in session abc123?"
  • "Get the network log for session abc123, only show failures"
  • "What did the DOM look like at the end of session abc123?"
  • "Compare session abc123 with session def456 — what changed?"
  • "Show me the Console logs from session abc123"
  • "What Stagehand actions were performed in session abc123?"
  • "Show me the detailed Stagehand timeline for session abc123"
  • "What did the Stagehand AI think while running session abc123?"
  • "How much did session abc123 cost in tokens?"
  • "Which Stagehand actions were the slowest in session abc123?"

Requirements

  • Node.js 18+
  • Browserbase account with API key

Building from source

npm install
npm run build

License

MIT