Har Forensics Mcp

io.github.aryanspv由 GitHub 账号 aryanspv 发布v0.3.2更新于 Oct 24, 2026

Tells you what leaked in a .har capture, who's on the page, and what to strip. No network calls.

概览

AI 生成的概览

本地 MCP 服务器,离线审计 .har 浏览器抓包,报告泄露的凭据、第三方来源以及分享前需要清除的内容。

可以做什么
  • 在磁盘上查找 .har 抓包文件,并对选定文件做逐项判定的初步检查
  • 按严重程度列出发现项,为第三方供应商打分并追溯谁加载了谁
  • 分析性能:最慢请求、各来源握手开销、未压缩资源、重定向耗时
  • 用过滤条件查询请求,并查看单条请求的请求头、Cookie、正文与各阶段耗时
  • 把请求转成可运行的 cURL 或 fetch 片段(凭据已遮蔽),并对比两份抓包
  • 生成已脱敏的 .redacted.har 副本和脱敏的 markdown 审计摘要
适用场景
当你手上有浏览器开发者工具导出的 HAR 文件,需要弄清其中暴露了哪些密钥或个人数据、涉及哪些第三方,或页面为何变慢,并在把抓包附到工单或聊天前先做检查时使用。
运行要求
通过 npx 以本地 stdio 进程运行(npm 包 har-forensics-mcp),需要 Node 20 或更高版本。无需 API 密钥、账号或网络访问。需在编辑器(Claude Code、Cursor、Windsurf、Zed、VS Code Copilot)的 MCP 配置中注册并重启编辑器。
安装前请注意
HAR 抓包常含有效的会话 Cookie、Authorization 请求头和有时是卡号;该服务器只在本地读取且不发起网络请求,但把其输出粘贴到聊天中就会离开你的机器。sanitize_har 会写出新文件,并拒绝覆盖已存在的目标或原始抓包。超过约 512 MB 的文件会被拒绝。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Har Forensics Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

har-forensics-mcp

Audit a .har capture from inside your editor. Other HAR tools show you a list of requests. This one answers the question you opened the file for: what leaked, who's on the page, and what to strip before you send it anywhere.

Reads a file from local disk, computes, writes to stdout. It makes no network calls, which is the point: a real capture holds live session cookies, Authorization headers, and sometimes card numbers.

Works with anything that speaks MCP over stdio — Cursor, Claude Code, Windsurf, Zed, VS Code Copilot.

Setup

Claude Code:

bash
claude mcp add --scope user har-forensics -- npx -y har-forensics-mcp

--scope user registers it for every directory. Without it the server is scoped to whichever directory you ran the command in — which still reports success, and then the tools are silently absent everywhere else.

Cursor — .cursor/mcp.json in the project, or ~/.cursor/mcp.json globally:

json
{  "mcpServers": {    "har-forensics": {      "command": "npx",      "args": ["-y", "har-forensics-mcp"]    }  }}

Windsurf / Zed / VS Code Copilot take the same command + args shape in their own MCP config files.

Restart the editor, then point a tool at a capture:

Run analyze_har on ~/Downloads/checkout.har

Requires Node 20+. Nothing else — no clone, no build, no API key, no account.

Tools

ToolAnswers
find_captures"Where are my .har files?" — scans Downloads, Desktop, Documents, cwd, temp.
analyze_har"What's in this capture?" — triage overview, one verdict per check. Start here.
har_briefThe full audit as redacted markdown. The artifact to quote or paste.
har_findingsFindings, worst-first, filterable by severity. Paged.
har_vendorsEvery third party, scored 0–100 by blast radius, with an HTTP Archive scrutiny tier.
har_provenanceWho loaded whom — the fourth parties your vendors brought with them.
har_perf"Why was this slow?" — slowest requests by dominant phase, per-origin handshake cost, uncompressed assets, time lost to redirects.
har_cspA starter Content-Security-Policy synthesized from observed traffic.
har_huntQuery requests — is:thirdparty, status:>=400, type:script, host:…. Returns entry indices.
har_entryEverything about one request: headers, cookies, body, timing phases.
har_curlThat request as a runnable cURL or fetch(), credentials masked.
har_diffBefore vs. after: what was added, what regressed, which third parties are new.
sanitize_harWrite a .redacted.har safe to attach to a ticket.

har_hunt → har_entry → har_curl is the loop: find the request, read it, replay it. Every tool that returns a list takes a limit and tells you the total, so nothing silently returns a first page as if it were the whole answer.

Every tool except sanitize_har is annotated readOnlyHint, and all of them are openWorldHint: false — the no-network guarantee below, in a form your client can read and act on rather than prose you have to take on trust.

Three properties it inherits from the web app

No network. The analyzers contain no fetch, and this transport does not add one. That invariant is the product — Cloudflare shipped a DLP profile in March 2026 that detects HAR files in HTTP traffic and lets admins block the upload outright, because unsanitized HARs are a known credential-exfiltration path.

Summaries, never dumps. Every tool returns a rendered conclusion, not raw entries, and every list is bounded with its total stated. The captures this exists for run to tens of thousands of entries and hundreds of megabytes; handing an agent the entry list would blow its context and make it slower at a job the analyzers already did. (This was a promise the code broke until 0.2.0 — har_findings had no cap and returned ~93,000 tokens on a 10,000-entry capture. The 27-entry demo returned ~175, which is exactly why it went unnoticed.)

Redacted by default. har_brief and har_findings route through the same redactor the browser export uses, built from a single shared secret-pattern table. An agent reading a capture in an editor is more likely to paste a finding into a chat window than a human with a download folder.

What it will not do

  • Overwrite anything. sanitize_har refuses to write over an existing target or the original capture.
  • Read a file above ~512 MB. Guarded rather than left to OOM — pinned just under V8's maximum string length, since the file is read as one string.
  • Answer a query it did not understand. A misspelled filter (is:third-party, staus:404) is an error, not an empty result. Those were the same response until 0.2.0, which meant a typo could report a capture clean.
  • Judge time against your clock. A HAR is a historical artifact, so token expiry is measured against each entry's startedDateTime. Comparing to now marks every token in a week-old capture as expired and buries the one that was genuinely dead when the browser sent it.

Reading the code

This package ships one file, dist/server.js. It is deliberately not minified — the build treats it as something a human debugging an editor integration will read far more often than something a machine will parse for size — so it is the same code a build would produce, already built. There is no separate source repository to clone; the shipped file is the artifact to audit.

License

MIT. Bundled vendor data is generated from third-party-web — MIT, Copyright (c) 2017 Patrick Hulce, derived from HTTP Archive.

来源:README.md,提交 3684af6

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.3.2最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。