{"_id":"@avidian/mcp-har","name":"@avidian/mcp-har","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@avidian/mcp-har","version":"0.1.0","description":"MCP server for HAR files - gives AI agents tools to read and analyse HTTP Archive (HAR) files.","type":"module","main":"dist/index.js","bin":{"mcp-har":"dist/index.js"},"scripts":{"dev":"bun run src/index.ts","build":"bun build src/index.ts --target node --outfile dist/index.js --packages=external && node -e \"const fs=require('fs');const f='dist/index.js';const c=fs.readFileSync(f,'utf8');fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c);fs.chmodSync(f,0o755)\"","compile":"bun build src/index.ts --compile --outfile dist/mcp-har","compile:linux-x64":"bun build src/index.ts --compile --target=bun-linux-x64 --outfile dist/mcp-har-linux-x64","compile:macos-arm64":"bun build src/index.ts --compile --target=bun-darwin-arm64 --outfile dist/mcp-har-macos-arm64","compile:macos-x64":"bun build src/index.ts --compile --target=bun-darwin-x64 --outfile dist/mcp-har-macos-x64","compile:all":"bun run compile:linux-x64 && bun run compile:macos-arm64 && bun run compile:macos-x64","lint":"eslint .","lint:fix":"eslint . --fix","format":"prettier --write .","format:check":"prettier --check .","typecheck":"tsc -b","test":"bun test","check":"bun run typecheck && bun run lint && bun run test && bun run format:check","prepublishOnly":"bun run build"},"dependencies":{"@fastify/cors":"^11.2.0","@modelcontextprotocol/sdk":"^1.12.0","@toon-format/toon":"^2.3.1","commander":"^15.0.0","fastify":"^5.9.0","fuse.js":"^7.5.0","zod":"^3.25.0"},"devDependencies":{"@eslint/js":"^9.29.0","@types/node":"^22.15.0","eslint":"^9.29.0","eslint-config-prettier":"^10.1.0","prettier":"^3.5.0","typescript":"^5.8.0","typescript-eslint":"^8.34.0"},"engines":{"node":">=20"},"keywords":["mcp","har","http-archive","ai","model-context-protocol","agent"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/avidianity/mcp-har.git"},"author":{"name":"avidian"},"gitHead":"bef5c7dbb3b005ef5a9acf87d590fb587c87319e","_id":"@avidian/mcp-har@0.1.0","bugs":{"url":"https://github.com/avidianity/mcp-har/issues"},"homepage":"https://github.com/avidianity/mcp-har#readme","_nodeVersion":"26.3.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-rYJQcbYeyuw9lGMTnSYINAyMugqo11ILz9GPI0cN0SR7pD1/FN/hVYUuUWanr63bOSw7JTSvQxA6JJ/JQD9HKw==","shasum":"c99941a9ae025cb464122cbffa3d7c0b71d63908","tarball":"https://registry.npmjs.org/@avidian/mcp-har/-/mcp-har-0.1.0.tgz","fileCount":4,"unpackedSize":46180,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCjsgsNKBgzY8MrBXa8wu8kUonbHG4AmV2lf3zXzHJi/wIhAMg81RnKOEb6316k9Ka0oVlG1xKup23Iqa0q71wtUTsx"}]},"_npmUser":{"name":"avidian","email":"manlupigjohnmichael@gmail.com"},"directories":{},"maintainers":[{"name":"avidian","email":"manlupigjohnmichael@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-har_0.1.0_1785264568743_0.09793705637359063"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-28T18:49:28.590Z","0.1.0":"2026-07-28T18:49:28.891Z","modified":"2026-07-28T18:49:29.112Z"},"maintainers":[{"name":"avidian","email":"manlupigjohnmichael@gmail.com"}],"description":"MCP server for HAR files - gives AI agents tools to read and analyse HTTP Archive (HAR) files.","homepage":"https://github.com/avidianity/mcp-har#readme","keywords":["mcp","har","http-archive","ai","model-context-protocol","agent"],"repository":{"type":"git","url":"git+https://github.com/avidianity/mcp-har.git"},"author":{"name":"avidian"},"bugs":{"url":"https://github.com/avidianity/mcp-har/issues"},"license":"MIT","readme":"# @avidian/mcp-har\n\nMCP server for HAR files.\nGives AI agents tools to read and analyse HTTP Archive (HAR 1.2) files: their entries, bodies, timings, pages, and differences between two captures.\n\n## Installation\n\n### npm (requires Node.js >= 20)\n\n```\nnpm install -g @avidian/mcp-har\n```\n\n### Compiled binary (no runtime needed)\n\n```\nsh -c \"$(curl -fsSL https://raw.githubusercontent.com/avidianity/mcp-har/main/install.sh)\"\n```\n\nOr download manually from [GitHub Releases](https://github.com/avidianity/mcp-har/releases).\n\n## Configuration\n\nNone.\nmcp-har is stateless: every tool call carries its own HAR, so there are no credentials or environment variables to set.\nThe only optional setting is `PORT`, used by the HTTP transport (default `5485`).\n\n## Usage\n\n### stdio (default - Claude Desktop, VS Code, Cursor)\n\n```\nmcp-har\n```\n\n### HTTP (Streamable HTTP transport)\n\n```\nmcp-har --transport http --port 5485\n```\n\n### MCP client configuration\n\n```json\n{\n  \"mcpServers\": {\n    \"har\": {\n      \"command\": \"mcp-har\"\n    }\n  }\n}\n```\n\n## HAR Source\n\nEvery tool takes exactly one **HAR Source** - the way a HAR reaches the tool.\nProvide exactly one of:\n\n| Parameter     | Meaning                                                   |\n| ------------- | --------------------------------------------------------- |\n| `har_path`    | Path to a local HAR file.                                 |\n| `har_url`     | URL to fetch a HAR file from.                             |\n| `har_content` | Inline HAR content: raw HAR JSON, or that JSON as base64. |\n\nPassing zero or more than one is an error that names the offending parameters.\nRaw JSON and base64 are told apart automatically: HAR JSON always begins with `{`, which base64 never does.\n\n`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`.\n\n## Data formats (agent boundary)\n\n| Direction                      | Format                        | Notes                                                          |\n| ------------------------------ | ----------------------------- | -------------------------------------------------------------- |\n| MCP -> Agent (structured data) | **TOON**                      | Summaries, listings, entry details, search hits, stats, diffs. |\n| MCP -> Agent (bodies)          | Raw text / base64 / file path | Request and response bodies, per the chosen output mode.       |\n| MCP -> Agent (notices, errors) | Plain text                    | Short messages such as \"Entry 3 has no request body.\"          |\n\n[TOON](https://github.com/toon-format/toon) is a token-efficient encoding for structured data (vs JSON).\n\nSensitive values (Authorization headers, cookies, tokens) are **never masked**.\nThe agent supplies the HAR, so it can already read the file; redaction here would only hide what `search_entries` exists to find.\n\n## Tools\n\n### Overview and discovery\n\n| Tool              | Description                                                                                         |\n| ----------------- | --------------------------------------------------------------------------------------------------- |\n| `get_har_summary` | Entry count, pages, capture time range, distinct domains, status-code distribution, total bytes.    |\n| `list_entries`    | Compact table of Entries with filters (method, status, domain, URL, MIME), sorting, and pagination. |\n| `list_pages`      | Browser Pages with id, title, load timings, and per-Page Entry count.                               |\n| `get_stats`       | Aggregates grouped by `domain`, `mime_type`, `status`, or `page`: count, duration, bytes.           |\n\n### Entry detail\n\n| Tool                | Description                                                                                      |\n| ------------------- | ------------------------------------------------------------------------------------------------ |\n| `get_entry`         | Full metadata for one Entry by Entry Index: headers, cookies, params, timings, sizes. No bodies. |\n| `get_request_body`  | Request body by Entry Index. Output `text` (truncated), `path` (temp file), or `base64`.         |\n| `get_response_body` | Response body by Entry Index, same output modes. Decodes HAR base64-encoded content.             |\n\n### Search\n\n| Tool             | Description                                                                                          |\n| ---------------- | ---------------------------------------------------------------------------------------------------- |\n| `search_entries` | Search URL, headers, cookies, params, and text bodies. Modes: `substring`, `regex`, `fuzzy`. Scoped. |\n\n### Compare\n\n| Tool        | Description                                                                                        |\n| ----------- | -------------------------------------------------------------------------------------------------- |\n| `diff_hars` | Match two HARs by method + URL + occurrence; report changed / added / removed Entries with deltas. |\n\n## Entry Index\n\nEntries are addressed by their **Entry Index**: the zero-based position in the HAR's `log.entries[]`.\n`list_entries` and `search_entries` report it; `get_entry` and the body tools take it.\nFiltering and sorting reorder or drop rows but never renumber the index, so it always points at the same Entry in the original HAR.\n\n## Development\n\n```\n# Install dependencies\nbun install\n\n# Run in dev mode\nbun run dev\n\n# Type check\nbun run typecheck\n\n# Lint\nbun run lint\n\n# Format\nbun run format\n\n# Test\nbun run test\n\n# Everything (typecheck + lint + test + format:check)\nbun run check\n\n# Build for npm\nbun run build\n\n# Compile native binary\nbun run compile\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-69c2158a01daab0c2051869a67c967e0"}