@avidian/mcp-har
v0.1.0
Published
MCP server for HAR files - gives AI agents tools to read and analyse HTTP Archive (HAR) files.
Maintainers
Readme
@avidian/mcp-har
MCP server for HAR files. Gives AI agents tools to read and analyse HTTP Archive (HAR 1.2) files: their entries, bodies, timings, pages, and differences between two captures.
Installation
npm (requires Node.js >= 20)
npm install -g @avidian/mcp-harCompiled binary (no runtime needed)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/avidianity/mcp-har/main/install.sh)"Or download manually from GitHub Releases.
Configuration
None.
mcp-har is stateless: every tool call carries its own HAR, so there are no credentials or environment variables to set.
The only optional setting is PORT, used by the HTTP transport (default 5485).
Usage
stdio (default - Claude Desktop, VS Code, Cursor)
mcp-harHTTP (Streamable HTTP transport)
mcp-har --transport http --port 5485MCP client configuration
{
"mcpServers": {
"har": {
"command": "mcp-har"
}
}
}HAR Source
Every tool takes exactly one HAR Source - the way a HAR reaches the tool. Provide exactly one of:
| Parameter | Meaning |
| ------------- | --------------------------------------------------------- |
| har_path | Path to a local HAR file. |
| har_url | URL to fetch a HAR file from. |
| har_content | Inline HAR content: raw HAR JSON, or that JSON as base64. |
Passing zero or more than one is an error that names the offending parameters.
Raw JSON and base64 are told apart automatically: HAR JSON always begins with {, which base64 never does.
diff_hars compares two HARs, so it takes two HAR Sources with prefixed names: a_path / a_url / a_content and b_path / b_url / b_content.
Data formats (agent boundary)
| Direction | Format | Notes | | ------------------------------ | ----------------------------- | -------------------------------------------------------------- | | MCP -> Agent (structured data) | TOON | Summaries, listings, entry details, search hits, stats, diffs. | | MCP -> Agent (bodies) | Raw text / base64 / file path | Request and response bodies, per the chosen output mode. | | MCP -> Agent (notices, errors) | Plain text | Short messages such as "Entry 3 has no request body." |
TOON is a token-efficient encoding for structured data (vs JSON).
Sensitive values (Authorization headers, cookies, tokens) are never masked.
The agent supplies the HAR, so it can already read the file; redaction here would only hide what search_entries exists to find.
Tools
Overview and discovery
| Tool | Description |
| ----------------- | --------------------------------------------------------------------------------------------------- |
| get_har_summary | Entry count, pages, capture time range, distinct domains, status-code distribution, total bytes. |
| list_entries | Compact table of Entries with filters (method, status, domain, URL, MIME), sorting, and pagination. |
| list_pages | Browser Pages with id, title, load timings, and per-Page Entry count. |
| get_stats | Aggregates grouped by domain, mime_type, status, or page: count, duration, bytes. |
Entry detail
| Tool | Description |
| ------------------- | ------------------------------------------------------------------------------------------------ |
| get_entry | Full metadata for one Entry by Entry Index: headers, cookies, params, timings, sizes. No bodies. |
| get_request_body | Request body by Entry Index. Output text (truncated), path (temp file), or base64. |
| get_response_body | Response body by Entry Index, same output modes. Decodes HAR base64-encoded content. |
Search
| Tool | Description |
| ---------------- | ---------------------------------------------------------------------------------------------------- |
| search_entries | Search URL, headers, cookies, params, and text bodies. Modes: substring, regex, fuzzy. Scoped. |
Compare
| Tool | Description |
| ----------- | -------------------------------------------------------------------------------------------------- |
| diff_hars | Match two HARs by method + URL + occurrence; report changed / added / removed Entries with deltas. |
Entry Index
Entries are addressed by their Entry Index: the zero-based position in the HAR's log.entries[].
list_entries and search_entries report it; get_entry and the body tools take it.
Filtering and sorting reorder or drop rows but never renumber the index, so it always points at the same Entry in the original HAR.
Development
# Install dependencies
bun install
# Run in dev mode
bun run dev
# Type check
bun run typecheck
# Lint
bun run lint
# Format
bun run format
# Test
bun run test
# Everything (typecheck + lint + test + format:check)
bun run check
# Build for npm
bun run build
# Compile native binary
bun run compileLicense
MIT
