--- title: Laya Browser Agent MCP emoji: 🌐 colorFrom: blue colorTo: indigo sdk: gradio sdk_version: 6.29.0 app_file: app.py python_version: "3.12" short_description: Laya browser agent decision MCP server on ZeroGPU startup_duration_timeout: 30m --- # 🌐 Laya Browser Agent MCP Server A Hugging Face Gradio Space exposing a high-speed, non-autoregressive **Laya** browser decision agent as an **MCP (Model Context Protocol)** server with **ZeroGPU** acceleration and a persistent **Storage Bucket** volume (`/data`). This Space allows any MCP client (such as Claude Desktop, Cursor, Cline, or custom agent scripts) to control a headless Playwright browser using both direct action primitives (`open_url`, `observe`, `click`, `type_text`, `select_option`, `scroll`, `screenshot`) and autonomous Laya decision steps (`laya_step`, `laya_run`). --- ## ⚡ Architecture & Features - **System-1 Non-Autoregressive Decision Engine**: Powered by [`ichenney/laya-browser-v32b`](https://huggingface.co/ichenney/laya-browser-v32b) (322M parameters, fine-tuned from `cklxx/laya-browser`), capable of single-pass multi-choice scoring across DOM elements and high-accuracy `DONE`/`BLOCKED` judgments. - **ZeroGPU Acceleration with Seamless CPU Fallback**: Model inference runs on dynamic NVIDIA RTX 6000 Ada / Blackwell GPUs using `@spaces.GPU(duration=15)`. If GPU quota is temporarily unavailable or exhausted, inference falls back to CPU automatically without breaking the agent loop. - **Persistent Storage Bucket (`/data`)**: Playwright authentication and browser session state (`/data/state.json`) persist across Space restarts on a private Hugging Face Storage Bucket (`LazyHuman/laya-browser-data`). - **Gradio Native MCP Server**: Built-in Gradio 6 MCP server (`demo.launch(mcp_server=True)`), exposing tools over SSE and JSON-RPC. --- ## 🛠️ MCP Tools | Tool | Parameters | Description | |---|---|---| | `open_url` | `url: str` | Navigates the browser to the requested URL and returns the page title and final URL. | | `observe` | None | Returns page title, current URL, truncated visible text (~3000 chars), and a numbered list of visible interactive controls. | | `click` | `index: int` | Clicks the interactive control corresponding to `index` (using the same shared enumeration as `observe`). | | `type_text` | `index: int`, `text: str` | Fills or types text into the input or editable control at `index`. | | `select_option` | `index: int`, `value: str` | Selects a dropdown `