web-agent-protocol

OTA-Tech-AIMIT长期未更新

在浏览器里录制并回放用户操作,让 AI Agent 能稳定复现网页交互流程,并原生支持 MCP 协议接入。

🌐Web Agent Protocol (WAP) - Record and replay user interactions in the browser with MCP support

wap-replay-tool-1.0.0发布于 2025-06-01 19:16 UTC507star91fork同步于 2026-11-07 07:31 UTC

怎么上手

由 README 提炼,执行前请确认
conda create -n WAP python=3.11
conda activate WAP
pip install -r requirements.txt
硬件要求按 README 说明

README 未说明硬件要求,也未提及显存或 GPU 型号;回放依赖浏览器与模型 API,需配置 OPENAI_API_KEY 或 DEEPSEEK_API_KEY。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

记录并回放浏览器操作,把用户交互转成可复用的 MCP 服务器

在浏览器里录制并回放用户操作,让 AI Agent 能稳定复现网页交互流程,并原生支持 MCP 协议接入。

核心能力

  • 用 OTA-WAP Chrome 扩展采集用户交互事件流
  • 将原始事件转成精确回放或智能回放动作列表
  • 把录制的动作转换成 MCP 服务器供任意 agent 复用
  • 按 WAP-Replay 协议回放动作列表还原浏览器操作
  • 提供开箱即用的桌面版回放工具

容易踩的坑

需在仓库根目录创建 .env 并填入 OPENAI_API_KEY 或 DEEPSEEK_API_KEY 才能生成回放列表;采集服务器默认监听 http://localhost:4934/action-data,扩展设置里的 Host 和 Port 必须与之匹配;生成器要求会话中恰好有一条 task-start 和一条 task-finish 记录,否则报 no task-start file;命令需在项目根目录运行或设置 PYTHONPATH,否则报 ModuleNotFoundError。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

1 个版本wap-replay-tool-1.0.0
  1. wap-replay-tool-1.0.0WAP Replay Tool Desktop 1.0.0最新正式版2025-06-01 · 2025-06-01 19:16 UTC

    Your all-in-one desktop app for running OTA Web-Agent-Protocol (WAP) smart and exact replays.

    This version includes:

    • JSON loader & validator
      • auto check exact_replay / smart_replay
    • Inline editor
      • Exact-replay actions – edit selector, timeout, etc. with type-safe saving
      • Smart-replay sub-goals – edit index & text just as easily
    • Start / Cancel replay
    • Runs replay task in the background
    • Cancellation token stops long runs cleanly
    • Settings modal
    • View / add / edit / delete stored API keys

    📦 Install

    1. Download wap-replay-tool-1.0.0-setup.exe from Assets below
    2. Run the installer (no admin rights required)
    3. Launch WAP Replay Tool

    🔧 Runtime Requirements

    • Windows 10/11 32/64-bit
    • valid WAP replay lists
    • API key(s) for your chosen provider

    🚀 Getting Started

    1. Load a replay list JSON
    2. Review / edit actions or sub-goals
    3. Choose your model provider in Settings and ensure keys exist
    4. Click ▶ Start Replay
    5. Monitor status; press ✖ Cancel Replay anytime

    Roadmap

    • We will add the action collecting service and replay list generation in the future release.
    • Currently we only provide the installer of Windows, and we will soon support the Desktop app for MacOS.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Web Agent Protocol

    Overview

    The Web Agent Protocol (WAP) is a standardized framework designed to enable seamless interaction between users, web agents, and browsers by recording and replaying browser actions. It separates the concerns of action recording and execution, allowing for efficient automation and reusability. The Python SDK for WAP implements the full specification, making it easy to:

    1. Collect user‑interaction data with the OTA‑WAP Chrome extension.
    2. Convert the raw event stream into either exact‑replay or smart‑replay action lists.
    3. Convert recorded actions into MCP servers for reuse by any agent or user
    4. Replay those lists using the WAP-Replay protocol to ensure accurate browser operations.

    WAP FULL DEMO

    Watch the video

    Without WAP

    image

    WAP Record

    image

    WAP Replay

    image

    Example using WAP

    image

    Setup

    Install the dependencies with the following command:

    Create a conda env

    conda create -n WAP python=3.11
    

    Activate the conda env

    conda activate WAP
    

    Install the dependencies

    pip install -r requirements.txt
    

    Setup your repo source path:

    set PYTHONPATH=C:/path/to/webagentprotocol # for Windows
    export PYTHONPATH=/path/to/webagentprotocol # for Linux
    

    Create .env file under the repo root directory with your own API keys:

    OPENAI_API_KEY=sk-proj-...
    DEEPSEEK_API_KEY=sk-...
    

    Record

    WAP record extension

    Please refer to OTA‑WAP Chrome Extension to setup action capturer in your Chrome browser.

    Start data‑collection server

    Run the following command to start the server to collect data from the extension:

    python action_collect_server.py
    

    Once the server is up, you can start to record from the page using WAP Chrome extension.

    The server listens on http://localhost:4934/action-data by default, please make sure the Host and Port in the extension settings match this server config. Each session will be saved to:

    data/YYYYMMDD/taskid/summary_event_<timestamp>.json
    

    An example of the formatted data which you will received in the WAP backend server is like:

    {
      "taskId": "MkCAhQsHgXn7YgaK",
      "type": "click",
      "actionTimestamp": 1746325231479,
      "eventTarget": {
        "type": "click",
        "target": "<a ota-use-interactive-target=\"1\" data-ordinal=\"3\" href=\"https://www.allrecipes.com/recipe/68925/cheesy-baked-salmon/\" data-tax-levels=\"\" data-doc-id=\"6592066\" class=\"comp mntl-card-list-card--extendable mntl-universal-card mntl-document-card mntl-card card card--no-image\" id=\"mntl-card-list-card--extendable_3-0\">\n<div class=\"loc card__top\"><div class=\"card__media mntl-image card__media universal-image__container\">...",
        "targetId": "mntl-card-list-card--extendable_3-0",
        "targetClass": "comp mntl-card-list-card--extendable mntl-universal-card mntl-document-card mntl-card card card--no-image"
      },
      "allEvents": {},
      "pageHTMLContent": "<header data-tracking-container=\"true\" data-collapsible=\"true\" class=\"comp header mntl-header mntl-header--magazine mntl-header--open-search-bar mntl-header--myr\" id=\"header_1-0\"><a data-tracking-container=\"true\" id=\"mntl-skip-to-content_1-0\" class=\"mntl-skip-to-content mntl-text-link\" rel=\"nocaes\" href=\"#main\"></a><div class=\"mntl-header__menu-top\">..."
    }
    

    Generate replay lists

    ModeCommand
    Exact replay – exactly reproduce every actionpython wap_replay/generate_exact_replay_list.py --data_dir_path data/<date>/<task_id> --output_dir_path data_processed/exact_replay
    Smart replay – condensed goal‑oriented stepspython wap_replay/generate_smart_replay_list.py --data_dir_path data/<date>/<task_id> --output_dir_path data_processed/smart_replay

    Replace <task_id> with the folder produced by the extension (e.g. em3h6UBDZykz0gnH).

    Output structure:

    data_processed/smart_replay/
     ├─ subgoals_<task_id>/                     # intermediate prompts & replies
     └─ wap_smart_replay_list_<task_id>.json   # final smart replay list for the agent
    
    data_processed/exact_replay/
     └─ wap_smart_replay_list_<task_id>.json   # final exact replay list for the agent
    

    Replay

    python run_replay.py --model-provider openai --wap_replay_list data_processed/exact_replay/wap_exact_replay_list_<task_id>.json --max-concurrent 1
    

    For smart-replay, replace the path with a smart‑replay JSON to test this mode.

    Convert to MCP Server

    python wap_replay\generate_mcp_server.py --task_id <task_id>
    

    converted MCP servers will be located under mcp_servers folder

    Replay with MCP

    You would need 2 terminals to replay with MCP. In the first termnial

    python wap_service.py
    

    In the second termnial

    python mcp_client.py
    

    Then enter your prompt in the second terminal

    example: find a top rated keyboard on amazon.ca using smart replay
    

    Replay with our Desktop App

    We provide out-of-box desktop app for running replay lists. It is easy to install and you don't need any extra steps for setup and deployments. Visit WAP Replay Tool releases for more details.

    Troubleshooting

    ModuleNotFoundError – run commands from the project root or export PYTHONPATH=. (set PYTHONPATH=. for Windows).

    “no task‑start file” – ensure the extension recorded a full session; the generators require exactly one task-start and one task-finish record.

    Acknowledgement

    Browser-Use: https://github.com/browser-use/browser-use

    MCP: https://github.com/modelcontextprotocol/python-sdk

    DOM Extension: https://github.com/kdzwinel/DOMListenerExtension