Skip to main content
Glama
WebTrace MCP Server

WebTrace MCP Server

by kings0527

WebTrace

AI-driven JSVMP Auto-Reversal Chrome/Edge Extension with MCP Server

Features

  • MCP Server: Expose reverse engineering capabilities via MCP protocol for AI Agents

  • JSVMP Auto-Detection: Automatically identify VM dispatch loops (while-switch/if-else/handler-table)

  • QuickJS WASM Sandbox: Execute and trace JSVMP bytecode in isolated environment

  • Stealth Engine: Three-layer stealth (Extension hiding + Proxy Hook cloaking + Timing alignment)

  • Babel AST Instrumentation: Auto-instrument VM dispatch loops for trace collection

  • Cross-browser: Chrome & Edge (Manifest V3)

Related MCP server: ghidraMCP

Quick Start

Build

npm install
npm run build

Load Extension

  1. Open chrome://extensions/

  2. Enable "Developer mode"

  3. Click "Load unpacked" → select dist/ directory

Connect AI Agent

See docs/SKILL-INTEGRATION.md

Connect Codex CLI

WebTrace now includes a local stdio bridge for MCP clients that cannot connect to an Edge extension RuntimePort directly. The bridge listens for the extension at ws://127.0.0.1:3100/mcp and proxies MCP JSON-RPC over stdio to Codex. If the port is already used by another Codex session, the bridge automatically tries the next ports in the range.

codex mcp add webtrace -- node /Users/kk/git/web-trace/bin/webtrace-codex-bridge.mjs

After changing extension code, rebuild and reload the unpacked extension in edge://extensions. The extension service worker automatically connects to the bridge port range when Codex starts it, so multiple Codex sessions can use WebTrace at the same time.

Architecture

┌─────────────────────────────────────────────────────┐
│                   AI Agent (MCP Client)              │
│            Qoder / Cursor / Claude Code             │
└────────────────────┬────────────────────────────────┘
                     │ MCP Protocol (WebSocket/Port)
┌────────────────────▼────────────────────────────────┐
│              Service Worker (Background)              │
│  ┌─────────┐  ┌──────────┐  ┌──────────────────┐   │
│  │MCP Server│  │Tab Manager│  │Offscreen Manager │   │
│  └─────────┘  └──────────┘  └────────┬─────────┘   │
└───────────────────────────────────────┼─────────────┘
                                        │
┌───────────────────────────────────────▼─────────────┐
│              Offscreen Document                       │
│  ┌──────────────────┐  ┌─────────────────────────┐  │
│  │QuickJS WASM      │  │Babel AST Engine         │  │
│  │(Sandbox + Trace) │  │(Detect + Instrument)    │  │
│  └──────────────────┘  └─────────────────────────┘  │
└─────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────┐
│              Target Web Page                          │
│  ┌────────────┐  ┌────────────┐  ┌──────────────┐  │
│  │Stealth     │  │VM Tracer   │  │API Hooks     │  │
│  │Bootstrap   │  │(Proxy)     │  │(fetch/XHR)   │  │
│  └────────────┘  └────────────┘  └──────────────┘  │
└─────────────────────────────────────────────────────┘

MCP Tools

Tool

Description

detect_protection

Detect page protection type and level

analyze_jsvmp

Analyze JSVMP code structure

trace_execution

Execute in sandbox with full trace

extract_bytecode

Extract bytecode arrays from page

hook_api

Set up API hooks on page

get_hook_logs

Retrieve hook logs

page_state

Get page state (cookies/storage/scripts), optionally by tabId or url

list_tabs

List browser tabs, including window and incognito metadata

activate_tab

Activate a tab by tabId

navigate

Navigate the current tab, a target tab, or a new tab

dom_snapshot

Read visible text, forms, inputs, buttons, and links from a tab

query_dom

Query DOM nodes by CSS selector

deobfuscate

Deobfuscate JS code

For InPrivate/incognito pages, Edge must allow the extension in InPrivate mode. Site access set to "all sites" is not enough by itself.

Integration

Tech Stack

  • TypeScript + Vite

  • Chrome Extension Manifest V3

  • MCP (Model Context Protocol)

  • QuickJS WASM (quickjs-emscripten)

  • Babel AST (@babel/parser + traverse)

License

MIT

Available Tools

16 tools
activate_tabB

激活指定 tabId 的标签页,并可聚焦其所在窗口。

Inputs: tabId (required), focusWindow.

analyze_jsvmpC

分析JSVMP代码结构,识别VM派发循环。

Inputs: code (required), timeout, chunkSize, deobfuscate, +1 more.

analyze_wasmC

反汇编和分析WASM模块结构,识别加密算法特征。

Inputs: wasmBinary, disassemble, moduleIndex, functionName, +1 more.

deobfuscateC

对混淆的JavaScript代码执行反混淆处理。

Inputs: code (required), transforms.

detect_protectionB

检测指定URL或当前页面的反爬/反调试保护类型和等级。

Inputs: url.

dom_snapshotC

读取目标标签页的DOM摘要,包括可见文本、输入框、按钮、链接和表单。

Inputs: url, tabId, maxElements, includeHidden, +1 more.

dump_wasm_memoryC

读取WASM实例的线性内存指定区域。

Inputs: length (required), offset (required), encoding, instanceId.

extract_bytecodeC

从页面中提取JSVMP字节码数组。

Inputs: selector, scriptUrl, variableName.

extract_wasmC

从页面或指定URL中提取WASM模块并解析其结构信息。

Inputs: scriptUrl, pageContext.

get_hook_logsC

获取已设置的Hook收集到的API调用日志。

Inputs: limit, filter, hookId.

hook_apiC

在当前页面中设置指定浏览器API的Hook。

Inputs: mode (required), apiName (required), options.

list_tabsA

列出当前浏览器所有标签页,用于在多窗口、多标签页或隐身窗口中选择目标页。

Inputs: includeRestricted.

page_stateB

获取目标标签页的完整状态信息,默认使用当前活跃标签页。

Inputs: url, tabId.

query_domC

按CSS选择器读取目标标签页DOM节点的文本、属性、可见性和可选outerHTML。

Inputs: selector (required), url, limit, tabId, +3 more.

trace_executionC

在隔离的QuickJS WASM沙箱中执行JSVMP代码并收集执行trace。

Inputs: code (required), inputs, timeout, chunkSize, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 16 tools

    Disambiguation4/5

    Tools are grouped into clearly different concerns (tab/page control, DOM reading, hooking, JSVMP analysis, WASM analysis), so most selections are unambiguous. The closest pairs are dom_snapshot vs query_dom and extract_bytecode vs extract_wasm, which are distinguishable by description but a careless agent could still pick the wrong one.

    Naming Consistency4/5

    All names use snake_case and almost all follow a verb_noun or verb_object pattern (detect_protection, extract_bytecode, dump_wasm_memory). A few are noun-only (page_state, dom_snapshot) and a few are bare verbs (deobfuscate, navigate), which is a minor deviation but not confusing.

    Tool Count4/5

    16 tools is on the heavy side of the ideal 3-15 band, but each tool maps to a real step in the reverse-engineering workflow (tab selection, protection detection, JSVMP/WASM extraction and analysis, hooking). No tool appears redundant filler.

    Completeness4/5

    The surface covers the full pipeline from tab navigation through protection detection, obfuscation removal, VM/WASM analysis, and API hook collection. Minor gaps exist around lifecycle cleanup (no remove_hook or clear_hook_logs) and no way to close or reopen tabs, but agents can work around these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      An MCP server for JavaScript reverse engineering that enables AI to perform browser debugging, script analysis, and automated hook injection. It streamlines complex workflows like deobfuscation, network tracing, and risk assessment through direct browser integration.
      35
      31 npm
      1,054
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      An Model Context Protocol server that enables LLMs to autonomously reverse engineer applications by exposing Ghidra's decompilation and analysis tools. It allows AI agents to list code structures, rename methods, and analyze binaries directly through MCP-compatible clients.
      Apache 2.0
    • A
      license
      B
      quality
      A
      maintenance
      An anti-detection browser MCP server designed for JavaScript reverse engineering through the Camoufox engine. It enables AI assistants to perform dynamic debugging, function hooking, and network interception while bypassing sophisticated bot detection mechanisms.
      42
      577
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A JavaScript reverse engineering MCP server that enables AI coding assistants to debug and analyze JavaScript code in web pages.
      16
      Apache 2.0