Desktop & WebZero Extra Tools NeededMCP Tool: analyze_network_capture

How to REA Network Captures: HAR Blueprints, WebSocket Frames & Mock Server Replay

Transform recorded network traffic into complete API blueprints: parse HTTP Archive (HAR) files, decode WebSocket frames and Protobuf bodies, and spin up local mock servers with evidence-gated writes for autonomous agent testing.

AI Overview Direct AnswerHow to REA: Saved Network Captures & Private APIs Quickstart Summary

In this official REA guide for Saved Network Captures & Private APIs, AI coding agents (Claude Code, Cursor, Windsurf) execute 'rea analyze-network-capture ./traffic.har --json > evidence.json' to safely extract file layout, symbols, and code logic without launching unverified binaries.

Investigation ScenarioReal-World Objective

The Problem & Target Artifact

Private API reverse engineering: You recorded an authenticated desktop app session using Proxyman. You want to synthesize a standalone TypeScript SDK for the undocumented REST and WebSocket endpoints without manually inspecting hundreds of requests.

Target Artifact: Standard HTTP Archive (.har) or mitmproxy capture dump.
AI PromptClaude Code / Cursor / Windsurf

Natural Language Agent Instructions

Copy and paste this prompt directly into your AI coding agent when REA is registered via Model Context Protocol (MCP):

Prompt Template:Select All to Copy
Use REA to analyze this network capture (traffic.har). Correlate authenticated REST requests, decode Protobuf payloads, and generate a clean-room TypeScript API client.
ExecutionTerminal & MCP Tool Call

Run REA Analysis Command

Execute the following command in your terminal or inspect the MCP JSON-RPC call executed by your agent:

CLI Command Execution
rea analyze-network-capture ./traffic.har --json > evidence.json

What REA Extracts & Returns

Correlated request/response pairs with query parameters, JSON bodies, and auth headers
WebSocket session timeline: text frames, binary payloads, and heartbeat intervals
Protobuf/gRPC message decoding without requiring pre-compiled .proto schema files
Local mock replay environment generation (rea environment-serve) for safe offline agent testing

Synthesized Clean-Room API Client (TypeScript)

The verified findings and synthesized clean-room structures generated from this investigation:

Synthesized Clean-Room API Client (TypeScript)
// Clean-room API client synthesized from network Evidence
export class TargetApiClient {
  constructor(private token: string, private baseUrl = "https://api.target.com/v1") {}

  async fetchTelemetry(deviceId: string): Promise<{ status: string; load: number }> {
    const res = await fetch(`${this.baseUrl}/devices/${deviceId}/telemetry`, {
      headers: {
        "Authorization": `Bearer ${this.token}`,
        "X-App-Client": "Desktop-Electron"
      }
    });
    return res.json();
  }
}
Internal MechanicsProduction Engineering

Evidence-Gated Mock Serving & Replay Isolation

REA parses HAR files into an immutable Evidence ledger. Through `rea environment-serve`, it converts recorded network flows into a local mock server serving Model Context Protocol endpoints. Read tools answer directly from recorded responses, while write tools verify that requested payloads match recorded patterns, preventing unauthorized external requests.

Security Guardrails & Analysis Boundary Rules

Redacts sensitive bearer tokens and session cookies from published Evidence bundles.
Decodes gRPC-web and raw WebSocket binary frames with length-prefix verification.
Allows AI agents to test API integrations offline without hitting rate limits or triggering security alerts.