Skip to main content
Glama

Web Client Errors MCP

Detect client-side JavaScript and network errors on any website — built for AI coding agents.

npm version License: MIT TypeScript

What It Does

Web Client Errors MCP is a Model Context Protocol (MCP) server that detects and analyzes client-side errors on websites. It uses Playwright to launch a real browser, navigate to any URL, and capture:

  • JavaScript errors — Uncaught exceptions, reference errors, type errors

  • Network errors — Failed requests, CORS issues, 4xx/5xx responses

  • Console warnings — Potentially problematic console output

  • Resource loading failures — Missing assets, failed fetches

Designed specifically for AI coding agents (like CRUSH) to help debug web applications effectively.

Related MCP server: Browser Runtime MCP

Why This Exists

When building or debugging web applications, client-side errors are notoriously difficult to catch — they happen in users' browsers, not in your terminal. This tool gives AI agents the ability to:

  • Instantly detect errors on any website

  • Get detailed error information with stack traces

  • Analyze error patterns and get fix suggestions

  • Debug production issues without manual browser testing

🎯 UNIX Philosophy

This project follows the UNIX philosophy:

  • Do one thing: Detect client-side web errors

  • Do it well: Reliable, accurate, comprehensive detection

  • Work together: Integrates seamlessly with CRUSH

  • Handle text: Natural language interface through CRUSH

  • Adapt: Works on any website, any framework

📋 Quick Start with CRUSH

Install and Configure

git clone https://github.com/LarsArtmann/web-client-errors-mcp.git
cd web-client-errors-mcp
bun install
bun run build

Add to your CRUSH .mcp.json:

{
  "mcp": {
    "web-client-errors": {
      "type": "stdio",
      "command": "bun",
      "args": ["/path/to/web-client-errors-mcp/dist/core/mcp-server.js"],
      "disabled": false
    }
  }
}

Use with CRUSH

# Restart CRUSH, then:
"detect errors on https://example.com"
"analyze error session from previous detection"

🛠️ Tools

detect_errors

Detects client-side errors on any website using Playwright browser automation.

Parameters:

Parameter

Type

Required

Description

url

string

Yes

Website URL to scan

waitTime

number

No

Milliseconds to wait for errors (default: 5000)

captureScreenshot

boolean

No

Take screenshot (default: true)

includeNetworkErrors

boolean

No

Include network errors (default: true)

includeConsoleWarnings

boolean

No

Include console warnings (default: true)

interactWithPage

boolean

No

Scroll/click to trigger lazy errors (default: false)

Example: "detect errors on https://mysite.com with 10 second wait"

analyze_error_session

Analyzes collected errors to find patterns and provide fix suggestions.

Parameters:

Parameter

Type

Required

Description

sessionId

string

Yes

ID from error detection

includeSuggestions

boolean

No

Include AI fix suggestions (default: true)

severity

string

No

Filter: error/warning/info/all (default: all)

Example: "analyze error session abc-123"

get_error_details

Gets detailed information about a specific error including stack trace and context.

Parameters:

Parameter

Type

Required

Description

errorId

string

Yes

Error message or ID to investigate

includeStackTrace

boolean

No

Include full stack trace (default: true)

includeContext

boolean

No

Include error context and analysis (default: true)

Example: "get details for TypeError undefined property"

🔧 Development

bun install       # Install dependencies
bun run build     # Compile TypeScript
bun run dev       # Watch and rebuild
bun run typecheck # Type checking
bun test          # Run tests
bun run lint      # Lint code

# Or use just
just build        # Build project
just test         # Run tests
just check        # Full quality check
just ci           # CI pipeline

📁 Project Structure

src/
├── core/
│   └── mcp-server.ts      # MCP server implementation
├── services/
│   ├── browser-manager.ts # Playwright browser automation
│   └── error-detection.ts # Error classification & analysis
├── repositories/
│   └── session-store.ts   # Session & error storage
├── types/
│   └── domain.ts          # Domain types (branded, discriminated)
├── config.ts              # Configuration management
└── logger.ts              # Structured logging setup

🔌 Resources

The MCP server exposes these resources for AI agents:

  • errors://recent — Most recent errors from all sessions

  • errors://stats — Aggregated error statistics

📖 Architecture

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│  AI Coding      │────▶│  MCP Server      │────▶│  Playwright     │
│  Agent (CRUSH)  │     │  (This Project)  │     │  Browser        │
└─────────────────┘     └──────────────────┘     └─────────────────┘
                               │
                               ▼
                         ┌──────────────────┐
                         │  Session Store   │
                         │  Error Analysis  │
                         └──────────────────┘

📚 Documentation

Document

Description

CONTRIBUTING.md

Contribution guidelines

docs/BRANCHING-FLOW.md

Branching strategy

📄 License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      F
      maintenance
      Unleashes LLM-powered agents to autonomously execute and debug web apps directly in your code editor, with features like webapp navigation, network traffic capture, and console error collection.
      2
      1,230
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to monitor and debug browser runtime errors, console logs, and page diagnostics in real time via a Chrome extension and local MCP server.
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to rapidly drive and inspect real web pages through persistent browser sessions, using accessibility-tree snapshots and DevTools-grade diagnostics to identify and diagnose issues.
      26
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables coding agents to access local browser diagnostics—runtime errors, console logs, network failures, breadcrumbs, DOM snapshots, and screenshots—and run closed-loop verification to debug and confirm fixes.
      -