Skip to main content
Glama

cleanhar-mcp — Correlation-Preserving HAR / cURL / JWT Sanitizer MCP Server + GitHub Action

z121245017-ai/cleanhar-mcp MCP server

Zero-dependency, 100% offline Model Context Protocol (MCP) Server, CLI, and GitHub Action enabling AI coding agents (Claude Desktop, Cursor, Windsurf, Antigravity) and CI pipelines to debug authentication race conditions, 4xx/5xx/CORS failures, and DevTools Copy as cURL traces with 0% raw secret exposure.

Instead of destructive [REDACTED] strings that hide token-refresh bugs, cleanhar-mcp replaces sensitive tokens with deterministic, ephemeral HMAC-SHA256 correlation tags such as [JWT#1_9f4c · alg:HS256 · EXPIRED -10m] vs [JWT#2_3a81 · alg:HS256 · exp:+15m].

MCP Tools Exposed (stdio)

Tool

Purpose

Safety Annotations

sanitize_har_archive

Scrubs HAR 1.2 JSON (log.entries or single HAR entry) with correlation-preserving HMAC-SHA256 token tags across headers, cookies, query strings, JSON/form payloads, and Base64 response bodies so AI agents can debug auth race conditions with 0% secret exposure.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

sanitize_curl_and_http_dump

Scrubs browser DevTools "Copy as cURL" commands (including ANSI-C $'...' quoting), raw HTTP/1.1 traces, and .env / DSN strings into safe, shareable repro commands.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

diagnose_har_failures

Extracts 4xx/5xx/CORS/expired-JWT/slow requests, computes P50/P95 waterfall latency, and generates sanitized GitHub/Jira Markdown incident summaries with reproducible curl commands.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

inspect_jwt_metadata_safe

Decodes JWT alg, sanitized iss domain, and clock-skew/expiry status (EXPIRED vs exp:+15m, alg:none, nbf drift) without returning raw sub, PII claims, or signature bytes.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

Related MCP server: py-har-mcp

Quick Start (MCP Client & Local CLI)

# Start MCP server over stdio (supports both NDJSON and Content-Length framing)
npx -y github:z121245017-ai/cleanhar-mcp

# List MCP tool schemas from terminal
npx -y github:z121245017-ai/cleanhar-mcp --list

# Scrub a DevTools cURL command from terminal
npx -y github:z121245017-ai/cleanhar-mcp --cli sanitize_curl_and_http_dump '{"rawInput":"curl https://api.acme.example/v1/orders -H \"Authorization: Bearer EXAMPLE_TOKEN_VALUE\""}'

Claude Desktop / Cursor / Windsurf / Antigravity Config

{
  "mcpServers": {
    "cleanhar": {
      "command": "npx",
      "args": ["-y", "github:z121245017-ai/cleanhar-mcp"]
    }
  }
}

Docker (node:22-alpine, non-root USER node)

docker build -t cleanhar-mcp .
docker run -i --rm cleanhar-mcp

GitHub Action (z121245017-ai/cleanhar-mcp@v1)

Add cleanhar-mcp@v1 to .github/workflows/ to block pull requests that accidentally commit unredacted .har captures, curl commands, Authorization: Bearer tokens, JWTs, Cookie headers, or live API keys inside test fixtures or Markdown docs—emitting inline ::error file=...,line=...:: PR annotations:

name: CleanHAR Secret & HAR Leak Gate

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

jobs:
  har-and-curl-leak-audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Block unredacted HAR captures, cURL dumps, and Bearer tokens
        uses: z121245017-ai/cleanhar-mcp@v1
        with:
          paths: '.'
          fail-on-secrets: 'true'

Action Inputs & Outputs

Name

Kind

Default

Description

paths

Input

.

Newline-, comma-, or space-separated files or directories to scan.

fail-on-secrets

Input

true

Exit 1 when unredacted credentials are found in .har, .http, .curl, .json, or .md files.

ignore

Input

node_modules,.git,dist,build,coverage,vendor

Comma-separated directory names skipped during recursive workspace scan.

scanned-files

Output

—

Number of HAR, HTTP, cURL, and documentation files inspected.

secrets-found

Output

—

Total count of unredacted credential leaks detected.

report-json

Output

—

Structured JSON summary of findings with file, line, kind, and masked preview.

Verification

npm test

License

MIT License — 0 external npm dependencies, 0 network calls, 100% local execution.

Available Tools

4 tools
diagnose_har_failuresA
Read-onlyIdempotent

Analyze an HTTP Archive (HAR 1.2 JSON) to extract 4xx/5xx errors, CORS/network blocks, expired-JWT auth race conditions, slow requests, and P50/P95/max waterfall latencies, returning structured diagnostics and a sanitized GitHub/Jira Markdown incident summary.

Inputs: harJson (required), reportTitle, sessionSalt, reportLanguage, +2 more.

inspect_jwt_metadata_safeA
Read-onlyIdempotent

Safely decode a JWT or Authorization Bearer header to inspect header alg, sanitized issuer domain (iss), claim count, and clock-skew/expiry status (exp, iat, nbf) without returning raw sub, PII claims, or signature bytes.

Inputs: tokenOrHeader (required), referenceTimeIso, clockSkewToleranceSec.

sanitize_curl_and_http_dumpA
Read-onlyIdempotent

Scrub browser DevTools "Copy as cURL" commands (including multi-line continuations and ANSI-C $'...' quotes), raw HTTP/1.1 request dumps, and .env or database DSN strings into safe, shareable repro commands with correlation-preserving token tags.

Inputs: rawInput (required), scrubIpv4, scrubEmail, scrubPhone, +3 more.

sanitize_har_archiveA
Read-onlyIdempotent

Scrub a browser HTTP Archive (HAR 1.2 JSON or single HAR request entry) with correlation-preserving HMAC-SHA256 token tags (e.g. [JWT#1_9f4c · alg:HS256 · EXPIRED -10m] vs [JWT#2_3a81 · alg:HS256 · exp:+15m]) across headers, cookies, query strings, JSON/form bodies, and Base64 responses so AI agents can debug auth race conditions with 0% secret exposure.

Inputs: harJson (required), scrubIpv4, scrubEmail, scrubPhone, +3 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 4 tools

    Disambiguation5/5

    The four tools have clearly distinct jobs: sanitizing HAR archives, sanitizing cURL/raw HTTP/.env/DSN inputs, inspecting JWT metadata safely, and diagnosing HAR failures. Although two tools both sanitize, their input types and outputs are explicitly differentiated.

    Naming Consistency5/5

    All tool names use consistent snake_case with a leading verb followed by a noun phrase. The pattern is predictable: sanitize_*, inspect_*, and diagnose_*.

    Tool Count5/5

    Four tools is well-scoped for a focused HAR sanitization and diagnostics server. Each tool covers a distinct workflow, and there are no redundant or filler tools.

    Completeness4/5

    The surface covers the core workflows: sanitizing HAR data, sanitizing related cURL/dump/DSN artifacts, safe JWT inspection, and HAR failure diagnosis. Minor gaps exist around generic log/console sanitization or configurable policy controls, but core use cases are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Professional MCP server for HAR (HTTP Archive) network captures, enabling AI agents to extract endpoints, detect secrets, generate code, and export to Postman/OpenAPI.
      MIT