cleanhar-mcp
cleanhar-mcp — Correlation-Preserving HAR / cURL / JWT Sanitizer MCP Server + GitHub Action
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 |
| Scrubs HAR 1.2 JSON ( |
|
| Scrubs browser DevTools |
|
| Extracts |
|
| Decodes JWT |
|
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-mcpGitHub 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 |
| Input |
| Newline-, comma-, or space-separated files or directories to scan. |
| Input |
| Exit |
| Input |
| Comma-separated directory names skipped during recursive workspace scan. |
| Output | — | Number of HAR, HTTP, cURL, and documentation files inspected. |
| Output | — | Total count of unredacted credential leaks detected. |
| Output | — | Structured JSON summary of findings with file, line, kind, and masked preview. |
Verification
npm testLicense
MIT License — 0 external npm dependencies, 0 network calls, 100% local execution.
Available Tools
4 toolsdiagnose_har_failuresARead-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_safeARead-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_dumpARead-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_archiveARead-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
Scored across 4 tools
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.
All tool names use consistent snake_case with a leading verb followed by a noun phrase. The pattern is predictable: sanitize_*, inspect_*, and diagnose_*.
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.
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
Related MCP Connectors
Zero-auth Streamable HTTP MCP server for cited Web3, token risk, and on-chain deep research.
Unified 15-tool SEO, SERP, clean Markdown & GEO (LLM citation Share-of-Voice) MCP server.
Zero-LLM guardrail MCP to detect prompt injections, redact/HMAC PII, and validate tool args.
Experimental MCP server for current empirical verification of explicit public HTTPS endpoint claims.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLocal-first CLI and MCP server for redacting sensitive text before sharing logs, configs, and errors with AI tools.MIT
- AlicenseAqualityDmaintenanceAn MCP server for parsing and analyzing HAR files, enabling AI assistants to inspect network traffic with automatic redaction of sensitive authentication headers.7MIT
- AlicenseNot gradedqualityDmaintenanceA Python MCP server that loads and analyzes HAR files locally, providing structured summaries to AI assistants to avoid token explosion and sensitive content filtering.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceProfessional MCP server for HAR (HTTP Archive) network captures, enabling AI agents to extract endpoints, detect secrets, generate code, and export to Postman/OpenAPI.MIT