RawTrace MCP
Records raw DOM mutations and network events during AI agent browser interactions, enabling detailed debugging and analysis of Playwright automations.
README
RawTrace MCP
RawTrace MCP is a local MCP server that wraps Playwright and Chrome DevTools Protocol to record raw DOM mutation and network event streams while an AI coding agent interacts with a web page.
It is designed for building and debugging complex Playwright automations where post-click snapshots are not enough.
Warning
RawTrace MCP records raw browser data by design. It may capture cookies, authorization headers, request bodies, response bodies, tokens, personal information, WebSocket messages, hidden form values, and DOM text. Treat every trace as sensitive. Do not commit traces to GitHub. Use only on systems and accounts you are authorized to inspect.
RawTrace does not silently mask, redact, or omit sensitive fields by default. Every monitor_start call must include:
{
"acknowledgeRawCapture": true
}
Install
npm install -g rawtrace-mcp
For local development:
npm install
npm run build
node dist/cli.js
MCP Configuration
Stdio is the default transport:
[mcp_servers.rawtrace]
type = "stdio"
command = "npx"
args = ["-y", "rawtrace-mcp"]
startup_timeout_sec = 120
Codex example:
[mcp_servers.rawtrace]
type = "stdio"
command = "npx"
args = ["-y", "rawtrace-mcp"]
startup_timeout_sec = 120
Claude Code example:
claude mcp add rawtrace -- npx -y rawtrace-mcp
Local development:
[mcp_servers.rawtrace]
type = "stdio"
command = "node"
args = ["C:\\path\\to\\rawtrace-mcp\\dist\\cli.js"]
startup_timeout_sec = 120
Streamable HTTP:
rawtrace-mcp --transport http --host 127.0.0.1 --port 3757
HTTP binds to 127.0.0.1 by default. Binding to a non-loopback host requires --unsafe-remote and --auth-token.
After changing MCP client configuration, restart the client or start a new session. The tools should appear with the server name you configured, for example rawtrace.browser_get_elements, rawtrace.monitor_start, and rawtrace.monitor_search_events. If tools do not appear, verify that Node.js is at least 22, npx -y rawtrace-mcp starts successfully, and the MCP client can read its configuration file.
Tools
RawTrace MCP currently exposes 42 MCP tools:
- Browser lifecycle and tabs:
browser_launch,browser_close,browser_list_tabs,browser_new_tab,browser_switch_tab,browser_close_tab. - Navigation:
browser_navigate,browser_reload,browser_go_back,browser_go_forward. - Page observation:
browser_get_state,browser_get_dom,browser_get_elements,browser_optimize_selector,browser_get_accessibility,browser_screenshot,browser_get_network. - Browser actions:
browser_click,browser_type,browser_press,browser_hover,browser_scroll,browser_select_option,browser_check,browser_wait,browser_wait_for_response,browser_handle_dialog. - Raw trace tools:
monitor_start,monitor_stop,monitor_get_summary,monitor_read_events,monitor_search_events,monitor_search_bodies,monitor_export. - Dangerous page execution:
browser_eval. - Credential and browser state tools:
browser_get_cookies,browser_set_cookies,browser_clear_cookies,browser_get_storage,browser_set_storage,browser_export_storage_state,browser_import_storage_state.
Inspection tools that read raw page content or body files require acknowledgeRawCapture: true, the same safety acknowledgment used by monitor_start. browser_eval also requires acknowledgeDangerousEval: true. If browser_eval times out, RawTrace closes the timed-out page and switches to another or new page, because browser-side JavaScript evaluation cannot be safely canceled in place.
Credential/state tools require both acknowledgeRawCapture: true and acknowledgeCredentialAccess: true; browser_launch requires the same acknowledgments when using storageStatePath. Applying Playwright storageState clears existing cookies, localStorage, and IndexedDB before importing the new state. For CDP-connected browsers or explicit userDataDir profiles, browser_launch({ storageStatePath }) and browser_import_storage_state also require acknowledgeStorageStateOverwrite: true.
When no monitor is running, large DOM/text, screenshots, eval results, and storageState artifacts are written under rawtrace-traces/inspections/. When a monitor is active, large raw values are written under the trace bodies/ directory and returned by reference.
Trace Output
Trace bundles are written under rawtrace-traces/ by default:
trace_2026-06-14T064500Z_ab12cd34/
manifest.json
actions.ndjson
dom.ndjson
network.ndjson
cookies.ndjson
websocket.ndjson
console.ndjson
frames.ndjson
bodies/
snapshots/
The stable v1 trace schema is documented in docs/trace-schema-v1.md.
monitor_read_events returns at most 1000 events per call. Use offset/limit pagination for browsing or monitor_search_events when looking for a specific endpoint, DOM text, or event type. Search includes inline event fields and DOM htmlRef/textRef artifacts; it does not expand network request or response body files by default. Use monitor_search_bodies only when you explicitly want to search raw request or response body files.
Development
npm install
npm run typecheck
npm run lint
npm test
Integration tests launch Chromium. If your environment does not already have Playwright browsers installed, run:
npx playwright install chromium
Scope
RawTrace MCP is a raw event recorder for automation development. It is not an AI decision-making agent, selector-healing system, CAPTCHA solver, anti-bot bypass tool, cloud browser service, or cross-browser recorder.
The public open-source surface for v1 is the rawtrace-mcp CLI, MCP tools, and documented trace schema. Internal TypeScript modules are not a stable library API and are not covered by SemVer compatibility promises yet.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。