Token导航 LogoToken导航TokenDH.com
Har Parser MCP logo
运维云端stdio官方级别未说明来源级核验

Har Parser MCP

MCP Server

一个用于解析和分析HTTP存档(HAR)文件的MCP服务器,提供网络流量捕获的洞察、API问题调试和请求复制功能。

工具数

5

提示词数

0

GitHub Stars

1

资源数

0
安全审计PythonClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

c0dn

提供方

c0dn

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uvx --from git+https://github.com/c0dn/har-parser-mcp.git har-parser-mcp

详细介绍

HAR解析器MCP服务器

用于解析和分析HTTP存档(HAR)文件的模型上下文协议(MCP)服务器。从网络流量捕获中提取见解,调试API问题,并轻松再现请求。

特性

  • 元数据分析 -获取一个包含请求计数、状态分布和错误检测的健康仪表板
  • 智能搜索 -按URL模式、资源类型、状态代码或错误条件筛选条目
  • 请求详情 -深入了解具有格式化正文和时间细分的单个请求
  • cURL生成 -将任何捕获的请求转换为cURL命令以进行再现
  • 二元萃取 -解码并保存base64编码的二进制响应(图像、PDF等)
  • 智能高速缓存 -解析后的HAR文件会被缓存,并在文件更改时自动失效

安装

使用uvx(推荐)

uvx --from git+https://github.com/c0dn/har-parser-mcp.git har-parser-mcp

使用pip

pip install git+https://github.com/c0dn/har-parser-mcp.git
har-parser-mcp

来源

git clone https://github.com/c0dn/har-parser-mcp.git
cd har-parser-mcp
uv sync
uv run har-parser-mcp

配置

克劳德桌面

添加到您的Claude Desktop配置(~/.config/claude/claude_desktop_config.json 在Linux上, ~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):

{
  "mcpServers": {
    "har-parser": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/c0dn/har-parser-mcp.git", "har-parser-mcp"]
    }
  }
}

克劳德代码

添加到您的Claude Code MCP设置中:

{
  "mcpServers": {
    "har-parser": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/c0dn/har-parser-mcp.git", "har-parser-mcp"]
    }
  }
}

工具

read_har_metadata

解析HAR文件并返回摘要仪表板。

Parameters:
  file_path: string - Path to the .har file

Returns:
  - Total entries, pages, and duration
  - Response size statistics
  - Status code distribution (2xx, 3xx, 4xx, 5xx)
  - Network error and incomplete request counts

search_har_entries

使用灵活的条件搜索和过滤HAR条目。

Parameters:
  file_path: string - Path to the .har file
  query: string (optional) - Regex pattern to match URLs or response bodies
  resource_type: string (optional) - Filter by type: xhr, document, stylesheet, image, font, script, media, websocket
  has_error: boolean (optional) - Filter to only 4xx/5xx/network errors
  status_code: integer (optional) - Filter by exact status code

Returns:
  - List of matching entries with index, method, URL, status, and timing

get_entry_details

按索引获取特定请求的完整详细信息。

Parameters:
  file_path: string - Path to the .har file
  entry_index: integer - Zero-based index of the entry

Returns:
  - Full request/response headers
  - Request/response bodies (auto-formatted for JSON)
  - Cookies sent and received
  - Detailed timing breakdown (DNS, connect, SSL, TTFB, download)
  - Server IP address

generate_curl_command

将HAR条目转换为可复制的cURL命令。

Parameters:
  file_path: string - Path to the .har file
  entry_index: integer - Zero-based index of the entry
  unsafe: boolean (optional) - Include sensitive headers (Authorization, Cookie, etc.)

Returns:
  - Ready-to-use cURL command
  - Warning if sensitive headers are exposed

extract_binary_content

解码base64编码的二进制响应并保存到临时文件。

Parameters:
  file_path: string - Path to the .har file
  entry_index: integer - Zero-based index of the entry

Returns:
  - Path to extracted file
  - MIME type and file size
  - Original URL

用例

  • API调试 -分析失败的请求、检查标头并重现问题
  • 性能分析 -识别缓慢的请求并分析时间故障
  • 安全性审计 -审查请求/响应中的敏感数据
  • 文档 -从记录的流量中提取API模式
  • 测试 -生成cURL命令以再现特定场景

如何捕获HAR文件

Chrome/Edge

  1. 打开DevTools(F12)
  2. 转到“网络”选项卡
  3. 执行要捕获的操作
  4. 在网络列表中右键单击→ “将所有内容另存为HAR”

火狐

  1. 打开DevTools(F12)
  2. 转到“网络”选项卡
  3. 执行要捕获的操作
  4. 点击齿轮图标→ “全部另存为HAR”

游猎

  1. 启用“开发人员”菜单(首选项→ 高级)
  2. 开放式Web检查器(开发→ 显示Web检查器)
  3. 转到“网络”选项卡
  4. 执行要捕获的操作
  5. 导出(文件→ 出口HAR)

发展

# Install dependencies
uv sync

# Run tests
uv run pytest

# Type checking
uv run mypy src

# Linting
uv run ruff check src tests

许可证

麻省理工学院

目录标签

目录标签

安全审计PythonClaude网络分析本地部署API调试性能分析请求复制

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP