
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 擷取檔,希望助理逆向解析 API、整理端點文件、找出驗證流程或產生用戶端 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 分