
hardly
io.github.b1tninja由 GitHub 账号 b1tninja 发布v1.0.0更新于 Oct 29, 2026
Generic HAR analysis MCP server: index and query captures without burning tokens on raw files.
概览
把浏览器 HAR 抓包索引到 SQLite,并以小型、脱敏、分页的工具让助手梳理接口、认证流程与数据形态。
- 可以做什么
- 打开并索引 HAR 抓包,生成会话概览、站点摘要和带严重级别的报告
- 列出并查看接口、表单与标签、数据与媒体类型,以及凭据和认证的工作方式
- 把分析结果导出为 OpenAPI 规范或客户端代码,仅在允许覆盖时写入文件
- 驱动真实浏览器以无头或交互方式录制 HAR,发送前需确认
- 通过任务计划、模式选择、帮助主题、提示词和内置文档引导助手
- 适用场景
- 当手上有体积很大的 HAR 抓包,希望助手逆向接口、整理接口文档、找出认证流程或生成客户端 SDK,而不必读取原始文件时适用。只知道网址、需要先录制抓包时也适用。
- 运行要求
- 本地 Python 3.10+ 进程,通常用 uvx hardly serve 以 stdio 运行;也可用 pip、pipx 或 uv tool install 安装。浏览器抓包需安装 capture 附加组件并安装 Playwright Chromium,有头抓包还需要显示环境。未声明需要账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 hardly,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
hardly
[PyPI] [Python] [CI] [License: MPL-2.0]
A generic, content-neutral CLI and MCP server for reading and capturing HAR files and turning them into what a client SDK needs: endpoints, forms and labels, data and media kinds, and how credentials and authentication work.
Why
Browser HAR captures are often tens of megabytes. Agents that read them burn tokens and still miss structure. hardly streams a HAR into SQLite once, then exposes small, redacted, paginated tools over MCP (and a matching CLI). Bodies are truncated, secrets are redacted, lists are paginated: you hardly need the whole file.
hardly knows technologies (HTML forms, ASP.NET WebForms, GraphQL, OAuth/OIDC, cookies/CSRF, bot walls, ArcGIS REST...) and resource kinds (JSON, CSV, HTML tables, PDF, images...), not any particular site. Downstream SDKs keep their own recipes and vocabularies. See docs/scope.md.
Install
To work on hardly itself: pip install -e ".[dev]" (CONTRIBUTING.md).
Python 3.10+. Give an output path to save; otherwise nothing is written. Everything lives in
memory unless you pass output_path (hardly session open HAR -o index.db). Python:
with open_session(har) as s: ... (integrating.md).
60-second quick start
For agents, start with hardly_guide_task_plan(goal, har_path, url) (CLI:
hardly guide task-plan --goal ...): it returns an ordered plan with example calls and the current
environment state.
Names tell the effect
The CLI and the MCP server share one vocabulary: the command is the tool name without hardly_
(hardly_session_open is hardly session open HAR, hardly_send_entry is hardly send entry HAR 12 --confirm).
Merged tools take a sections list, for example hardly_auth_report(sections=['credentials', 'cookies']). Reference: docs/tools.md (71 tools), docs/cli.md
(commands); stability promise: docs/api-stability.md.
Three modes
After any capture, continue in archive mode on the returned session_id. hardly never evades
captchas or bot walls: it identifies them and tells you to stop, ask a person, or re-run elsewhere
(docs/gate-policy.md). Details: docs/capture.md.
Install and run without cloning
MCP client config for the published package:
Browser capture needs a local install ([capture] extra, then python -m playwright install chromium;
headed capture needs a display). The container image ghcr.io/b1tninja/hardly (multi-arch, built on each
release) is for archive/headless analysis only; mount your working directory at /workspace.
Release and verification details: docs/releasing.md.
MCP setup (Cursor and others)
Local venv (recommended; headed capture needs a display):
On Windows use ...\\.venv\\Scripts\\python.exe. hardly serve starts the same server.
Docker (offline analysis only; mount your working directory):
Host paths under the mount map to /workspace/.... To skip building locally, use the published
image ghcr.io/b1tninja/hardly:latest in place of hardly-mcp:latest.
Agent onboarding
hardly_guide_task_plan,hardly_guide_mode,hardly_server_status(stale MCP? restart the server),hardly_guide_help(topic).- MCP prompts:
analyze_har,discover_apis,capture_portal,document_api,find_auth_flow,reverse_engineer_api,build_client_sdk,diagnose_blocked_capture,verify_client. - MCP resources:
hardly://cheatsheetandhardly://docs/<name>for the bundled docs. - Agent Skill:
hardly skill install [--dest DIR](default~/.claude/skills/hardly), orhardly skill print. Source: skills/hardly.
Documentation
Library use
Development and tests
Live soak against public demo sites (no private HARs): hardly soak live --list, then
hardly soak live (or --ids datatables-ajax,quotes-login,…). Catalog covers loopback
WebForms/token login, HTML/AJAX tables, form logins, GraphQL, and JSON/OpenAPI — see
hardly.live_targets and docs/test-targets.md.
CONTRIBUTING.md, AGENTS.md; release notes in
CHANGELOG.md.
Security
HAR files often contain live passwords and session tokens. hardly redacts by default, but treat captures as secrets: do not commit or share them, and rotate credentials if one leaked. Use hardly only on targets you are authorised to access. See SECURITY.md.
License
MPL-2.0. Generated output (stubs, OpenAPI, reports) is not covered; see NOTICE.md.
来源:README.md,提交 5d8ee69
工具
0版本历史
1- v1.0.0最新Oct 29, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分