File: README.md
Page Agent
The GUI Agent Living in Your Webpage. One script gives any web page its own AI agent.
๐ English | ไธญๆ
๐ Demo | ๐ Docs | ๐ข HN Discussion | ๐ Follow on X
โจ Features
- ๐ฏ Easy integration
- No need for
browser extension/python/headless browser. - Just in-page javascript. Everything happens in your web page.
- No need for
- ๐ Text-based DOM manipulation
- No screenshots. No multi-modal LLMs or special permissions needed.
- ๐ง Bring your own LLMs
- Works with most mainstream models, including locally deployed ones. See supported models.
- ๐ Optional chrome extension for multi-page tasks.
- And an MCP Server (Beta) to control it from outside
๐ก Use Cases
- SaaS AI Copilot โ Ship an AI copilot in your product in lines of code. No backend rewrite.
- Smart Form Filling โ Turn 20-click workflows into one sentence. Perfect for ERP, CRM, and admin systems.
- Accessibility โ Make any web app accessible through natural language. Voice commands, screen readers, zero barrier.
- Multi-page Agent โ Extend your own web agent's reach across browser tabs via the Chrome extension.
- MCP - Allow your agent clients to control your browser.
๐ Quick Start
One-line integration
Fastest way to try PageAgent with our free Demo LLM:
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/iife/page-agent.demo.js"
crossorigin="anonymous"
></script>โ ๏ธ For technical evaluation only. This demo CDN uses our free testing LLM API. By using it, you agree to its terms.
Add
?autoInit=falseto load the script without creating the demo agent automatically. You can then instantiate it withnew window.PageAgent(...)and your own LLMs.
NPM Installation
npm install page-agentimport { PageAgent } from 'page-agent'
const agent = new PageAgent({
model: 'qwen3.5-plus',
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'YOUR_API_KEY',
language: 'en-US',
})
await agent.execute('Click the login button')For more programmatic usage, see ๐ Documentations.
๐ค Contributing
We welcome contributions from the community! See CONTRIBUTING.md for guidelines and docs/developer-guide.md for local development workflows.
Built something cool with PageAgent? Share it in Show and Tell. ๐
Please read the maintainer's note on principles and current state.
Contributions generated entirely by bots or AI without substantial human involvement will not be accepted.
โ๏ธ License
๐ Acknowledgments
This project builds upon the excellent work of browser-use.
PageAgent is designed for client-side web enhancement, not server-side automation.
DOM processing components and prompt are derived from browser-use:
Browser Use <https://github.com/browser-use/browser-use>
Copyright (c) 2024 Gregor Zunic
Licensed under the MIT License
We gratefully acknowledge the browser-use project and its contributors for their
excellent work on web automation and DOM interaction patterns that helped make
this project possible.โญ Star this repo if you find PageAgent helpful!
File: docs/CODE_OF_CONDUCT.md
Alibaba Open Source Code of Conduct
Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
Our Standards
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or
advances - Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission - Other conduct which could reasonably be considered inappropriate in a
professional setting
Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
Chinese Version
ใ้ฟ้ๅทดๅทดๅผๆบ่กไธบๅๅใ
ๆไปฌ็ไฟ่ฏ
ไธบไบไฟ่ฟไธไธชๅผๆพ้ๆไธๅๅฅฝ็็ฏๅข๏ผๆไปฌไฝไธบ่ดก็ฎ่ ๅ็ปดๆค่ ไฟ่ฏ๏ผๆ ่ฎบๅนด้พใ็งๆใๆฐๆใๆงๅซ่ฎคๅๅ่กจ่พพ๏ผๆนๅผ๏ผใไฝๅใ่บซไฝๅฅๅ จไธๅฆใ็ป้ชๆฐดๅนณใๅฝ็ฑใไธชไบบ่กจ็ฐใๅฎๆๆๆงๅซๅๅ๏ผๅไธ่ ๅจๆไปฌ้กน็ฎๅ็คพๅบไธญ้ฝๅ ไบ้ชๆฐใ
ๆไปฌ็ๆ ๅ
ๆๅฉไบๅ้ ๆญฃ้ข็ฏๅข็่กไธบๅ ๆฌไฝไธ้ไบ๏ผ
- ไฝฟ็จๅๅฅฝๅๅ ๅฎนๆง่ฏญ่จ
- ๅฐ้ไธๅ็่ง็นๅ็ปๅ
- ่ๅฟๅฐๆฅๅๅปบ่ฎพๆงๆน่ฏ
- ๅ ณๆณจๅฏน็คพๅบๆๆๅฉ็ไบๆ
- ๅๅๅฏนๅพ ๅ ถไป็คพๅบๆๅ
่บซไธบๅไธ่ ไธ่ฝๆฅๅ็่กไธบๅ ๆฌไฝไธ้ไบ๏ผ
- ไฝฟ็จไธๆงๆๅ ณ็่จ่ฏญๆๆฏๅพๅ๏ผไปฅๅไธๅๆฌข่ฟ็ๆง้ชๆฐ
- ๆฃไนฑ/็ ฝๅจ/้ ่ฐฃ็่กไธบๆ่ฟ่กไพฎ่พฑ/่ดฌๆ็่ฏ่ฎบ๏ผไบบ่บซๆปๅปๅๆฟๆฒปๆปๅป
- ๅ ฌๅผๆ็งไธ็้ชๆฐ
- ๆช็ป่ฎธๅฏๅฐๅๅธไปไบบ็ไธชไบบ่ตๆ๏ผไพๅฆไฝๅๆๆฏ็ตๅญๅฐๅ
- ๅ ถไปๅฏไปฅ่ขซๅ็ๅฐ่ฎคๅฎไธบไธๆฐๅฝๆ่ ่ฟๅ่ไธๆๅฎ็่กไธบ
ๆไปฌ็่ดฃไปป
้กน็ฎ็ปดๆค่ ๆ่ดฃไปปไธบใๅฏๆฅๅ็่กไธบใๆ ๅๅๅบ่ฏ ้๏ผไปฅๅๅฏนๅทฒๅ็็ไธ่ขซๆฅๅ็่กไธบ้ๅๆฐๅฝไธๅ ฌๅนณ็็บ ๆญฃๆชๆฝใ
้กน็ฎ็ปดๆค่ ๆๆๅฉๅ่ดฃไปปๅปๅ ้คใ็ผ่พใๆ็ปไธๆฌ่กไธบๆ ๅๆๆ่ฟ่็่ฏ่ฎบ (comments)ใๆไบค (commits)ใไปฃ็ ใwiki ็ผ่พใ้ฎ้ข (issues) ๅๅ ถไป่ดก็ฎ๏ผไปฅๅ้กน็ฎ็ปดๆค่ ๅฏๆๆถๆๆฐธไน ๆง็็ฆๆญขไปปไฝไปไปฌ่ฎคไธบๆไธ้ๅฝใๅจ่ใๅ็ฏใๆๅฎณ่กไธบ็่ดก็ฎ่ ใ
ไฝฟ็จ่ๅด
ๅฝไธไธชไบบไปฃ่กจ่ฏฅ้กน็ฎๆๆฏๅ ถ็คพๅบๆถ๏ผๆฌ่กไธบๆ ๅ้็จไบๅ ถ้กน็ฎๅนณๅฐๅๅ ฌๅ ฑๅนณๅฐใ
ไปฃ่กจ้กน็ฎๆๆฏ็คพๅบ็ๆ ๅต๏ผไธพไพๆฅ่ฏดๅ ๆฌไฝฟ็จๅฎๆน้กน็ฎ็็ตๅญ้ฎไปถๅฐๅใ้่ฟๅฎๆน็็คพๅบๅชไฝ่ดฆๅทๅๅธๆ็บฟไธๆ็บฟไธไบไปถไธญๆ ไปปๆๅฎไปฃ่กจใ
่ฏฅ้กน็ฎ็ๅ็ฐๆนๅผๅฏ็ฑๅ ถ้กน็ฎ็ปดๆค่ ่ฟ่ก่ฟไธๆญฅ็ๅฎไนๅ่งฃ้ใ
ๅผบๅถๆง่ก
ๅฏไปฅ้่ฟ [email protected] ๆฅ่็ณป้กน็ฎๅข้ๆฅไธพๆฅๆปฅ็จใ้ชๆฐๆๅ ถไปไธ่ขซๆฅๅ็่กไธบใ
ไปปไฝ็ปดๆคๅข้่ฎคไธบๆๅฟ ่ฆไธ้ๅ็ๆๆๆ่ฏ้ฝๅฐ่ฟ่กๅฎกๆฅๅ่ฐๆฅ๏ผๅนถๅๅบ็ธๅฏนๅบ็ๅๅบใ้กน็ฎๅฐ็ปๆๅฏนไบไปถๅๆฅ่ ๆไฟๅฏ็ไนๅกใๅ ทไฝๆง่ก็ๆน้่ฟไธๆญฅ็ป่ๅฏ่ฝไผๅ็ฌๅ ฌๅธใ
ๆฒกๆๅๅฎๅฐ้ตๅฎๆๆฏๆง่กๆฌ่กไธบๆ ๅ็้กน็ฎ็ปดๆคไบบๅ๏ผๅฏ่ฝไผๅ ้กน็ฎ้ขๅฏผไบบๆๆฏๅ ถไปๆๅ็ๅณๅฎ๏ผๆๆถๆๆฏๆฐธไน ๅฐๅๆถๅ ถๅไธ่ตๆ ผใ
ๆฅๆบ
ๆฌ่กไธบๆ ๅๆน็ผ่ช่ดก็ฎ่
ๅ
ฌ็บฆ๏ผ็ๆฌ 1.4
ๅฏๅจๆญคๆฅ็https://www.contributor-covenant.org/zh-cn/version/1/4/code-of-conduct.html
File: docs/developer-guide.md
Developer Guide
This file is for local development workflows.
For contribution rules and expectations, see ../CONTRIBUTING.md.
๐ Quick Start
Development Setup
Prerequisites
macOS/Linux/WSLnode.js ^22.13 || >=24withnpm >= 11- An editor that supports
ts/eslint/prettier - Make sure
eslint,prettierandcommitlintwork well. Un-linted code won't pass the CI.
Setup
bashnpm i # Or `npm ci` if you don't want to change the lockfile npm start # Start website dev server npm run build # Build everything
๐ฆ Project Structure
This is a monorepo with npm workspaces.
Published packages:
- Page Agent (
packages/page-agent/) - Main entry with built-in UI Panel (npm:page-agent) - MCP (
packages/mcp/) - MCP server for browser control via Page Agent extension (npm:@page-agent/mcp) - Core (
packages/core/) - Core agent logic without UI (npm:@page-agent/core) - LLMs (
packages/llms/) - LLM client with reflection-before-action mental model - Page Controller (
packages/page-controller/) - DOM operations and visual feedback, independent of LLM - UI (
packages/ui/) - Panel and i18n, decoupled from PageAgent
Applications:
- Extension (
packages/extension/) - Browser extension (WXT + React) - Website (
packages/website/) - React docs, landing page, and dev playground (private)
Source-first monorepo with
npm workspaces + ts references + vite alias. Librarypackage.jsonexports point tosrc/*.tsduring development, and point todist/*.jswhen published.workspacesin rootpackage.jsonmust be in topological order.
๐ค AGENTS.md Alias
If your AI assistant does not support AGENTS.md. Add an alias for it.
๐ง Development Workflows
Test With Your Own LLM API
Create a
.envfile in the repo root with your LLM API configenvLLM_MODEL_NAME=gpt-5.2 LLM_API_KEY=your-api-key LLM_BASE_URL=https://api.your-llm-provider.com/v1Ollama example (tested on 0.15 + qwen3:14b, RTX3090 24GB):
envLLM_BASE_URL="http://localhost:11434/v1" LLM_API_KEY="NA" LLM_MODEL_NAME="qwen3:14b"@see https://alibaba.github.io/page-agent/docs/features/models#ollama for configuration
Restart the dev server to load new env vars
If not provided, the demo will use the free testing proxy by default. By using it, you agree to its terms.
Extension Development
npm run dev:ext
npm run build:ext- Update
packages/extension/docs/extension_api.mdfor API integration details
Testing on Other Websites
Start and serve a local
iifescriptbashnpm run dev:demo # Serving IIFE with auto rebuild at http://localhost:5174/page-agent.demo.jsAdd a new bookmark
javascriptjavascript:(function(){var s=document.createElement('script');s.src=`http://localhost:5174/page-agent.demo.js?lang=en-US&t=${Math.random()}`;s.onload=()=>console.log(%27PageAgent ready!%27);document.head.appendChild(s);})();Click the bookmark on any page to load Page-Agent
Warning: AK in your local
.envwill be inlined in the iife script. Be very careful when you distribute the script.
Adding Documentation
Ask an AI to help you add documentation to the website/ package. Follow the existing style.
Our AGENTS.md file and guardrails are designed for this purpose. But please be careful and review anything AI generated.
File: docs/README-zh.md
Page Agent
็บฏ JS ๅฎ็ฐ็ GUI agentใไฝฟ็จ่ช็ถ่ฏญ่จๆไฝไฝ ็ Web ๅบ็จใๆ ้กปๅ็ซฏใๅฎขๆท็ซฏใๆต่งๅจๆไปถใ
๐ English | ไธญๆ
๐ Demo | ๐ Docs | ๐ข HN Discussion | ๐ Follow on X
โจ Features
- ๐ฏ ่ฝปๆพ้ๆ
- ๆ ้
ๆต่งๅจๆไปถ/Python/ๆ ๅคดๆต่งๅจ๏ผ็บฏ้กต้ขๅ JavaScript
- ๆ ้
- ๐ ๅบไบๆๆฌ็ DOM ๆไฝ
- ๆ ้ๆชๅพ๏ผๆ ้ๅคๆจกๆๆจกๅๆ็นๆฎๆ้
- ๐ง ่ชๅค LLM
- ๆฏๆๅคๆฐไธปๆตๆจกๅ๏ผๅ ๆฌๆฌๅฐ้จ็ฝฒๆจกๅใๅ่งๆฏๆ็ๆจกๅใ
- ๐ ๅฏ้็ Chrome ๆฉๅฑ๏ผๆฏๆ่ทจ้กต้ขไปปๅก
๐ก ๅบ็จๅบๆฏ
- SaaS AI Copilot โ ๅ ่กไปฃ็ ไธบไฝ ็ไบงๅๅ ไธ AI ๅฏ้ฉพ้ฉถ๏ผๆ ้้ๅๅ็ซฏใ
- ๆบ่ฝ่กจๅๅกซๅ โ ๆ 20 ๆฌก็นๅปๅๆไธๅฅ่ฏใERPใCRMใ็ฎก็ๅๅฐ็ๆไฝณๆๆกฃใ
- ๆ ้็ขๅขๅผบ โ ็จ่ช็ถ่ฏญ่จ่ฎฉไปปไฝ็ฝ้กตๆ ้็ขใ่ฏญ้ณๆไปคใๅฑๅน้ ่ฏปๅจ๏ผ้ถ้จๆงใ
- ่ทจ้กต้ข Agent โ ้่ฟๅฏ้็ Chrome ๆฉๅฑ๏ผ่ฎฉไฝ ่ชๅทฑ็ Web Agent ่ทจๆ ็ญพ้กตๅทฅไฝใ
- ้่ฟ MCP ไธบ็ฐๆ Agent ๅ ๅ ฅๆต่งๅจๆงๅถ่ฝๅใ
๐ ๅฟซ้ๅผๅง
ไธ่กไปฃ็ ้ๆ
้่ฟๆไปฌๅ ่ดน็ Demo LLM ๅฟซ้ไฝ้ช PageAgent๏ผ
<script
src="https://registry.npmmirror.com/page-agent/1.12.2/files/dist/iife/page-agent.demo.js"
crossorigin="anonymous"
></script>โ ๏ธ ไป ็จไบๆๆฏ่ฏไผฐใ ่ฏฅ Demo CDN ไฝฟ็จไบๅ ่ดน็ๆต่ฏ LLM API๏ผไฝฟ็จๅณ่กจ็คบๆจๅๆๅ ถๆกๆฌพใ
ๅจ URL ๅๆทปๅ
?autoInit=falseๅฏๅชๅ ่ฝฝ่ๆฌ๏ผไธ่ชๅจๅๅปบ Demo Agent๏ผไนๅๅฏ้่ฟnew window.PageAgent(...)ๆๅจๅๅงๅ๏ผๅนถไฝฟ็จ่ชๅฎไน LLMใ
NPM ๅฎ่ฃ
npm install page-agentimport { PageAgent } from 'page-agent'
const agent = new PageAgent({
model: 'qwen3.5-plus',
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'YOUR_API_KEY',
language: 'zh-CN',
})
await agent.execute('็นๅป็ปๅฝๆ้ฎ')ๆดๅค็ผ็จ็จๆณ๏ผ่ฏทๅ้ ๐ ๆๆกฃใ
๐ค ่ดก็ฎ
ๆฌข่ฟ็คพๅบ่ดก็ฎ๏ผ่ฏทๅ้ CONTRIBUTING.md ไบ่งฃๅฎ่ฃ ไธ่ดก็ฎๆๅใ
ๆไบค issue ๆ PR ไนๅ๏ผ่ฏทๅ ้ ่ฏปไฝ่ ๅฃฐๆๅ่กไธบๅๅใ
ๆไปฌไธๆฅๅๆช็ปๅฎ่ดจๆงไบบ็ฑปๅไธใๅฎๅ จ็ฑ Bot ๆ Agent ่ชๅจ็ๆ็ไปฃ็ ใ
็จ PageAgent ๅไบๆ่ถฃ็ไธ่ฅฟ๏ผๆฌข่ฟๅฐ Show and Tell ๅไบซใ๐
๐ ๅฃฐๆไธ่ด่ฐข
ๆฌ้กน็ฎๅบไบ browser-use ็ไผ็งๅทฅไฝๆๅปบใ
PageAgent ไธไธบๅฎขๆท็ซฏ็ฝ้กตๅขๅผบ่ฎพ่ฎก๏ผไธๆฏๆๅก็ซฏ่ชๅจๅๅทฅๅ
ทใ
DOM processing components and prompt are derived from browser-use:
Browser Use <https://github.com/browser-use/browser-use>
Copyright (c) 2024 Gregor Zunic
Licensed under the MIT License
We gratefully acknowledge the browser-use project and its contributors for their
excellent work on web automation and DOM interaction patterns that helped make
this project possible.โ๏ธ ่ฎธๅฏ่ฏ
โญ ๅฆๆ่งๅพ PageAgent ๆ็จๆๆ่ถฃ๏ผ่ฏท็ป้กน็ฎ็นไธชๆ๏ผ
File: docs/SECURITY.md
Security Policy
Supported Versions
We provide security fixes on a best-effort basis for:
| Version | Supported |
|---|---|
main |
Yes |
Latest npm release of page-agent and workspace packages |
Yes |
| Older releases | No |
Please upgrade to the latest release before reporting an issue against an older build.
Reporting a Vulnerability
Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.
Use GitHub's private vulnerability reporting flow:
- Open https://github.com/alibaba/page-agent/security/policy
- Click
Report a vulnerability
If private reporting is unavailable, open a minimal public issue only to request a private contact channel. Do not include exploit details.
What to Include
- Affected package or feature
- Exact version, commit, or build
- Browser, OS, and runtime environment
- Reproduction steps or a proof of concept
- Expected impact
Scope
We prioritize reports that show a real security boundary failure, such as:
- Unauthorized access to data, tokens, or extension capabilities
- Bypassing explicit safety constraints
- Sensitive data exposure caused by default behavior
The following usually do not qualify by themselves:
- Unsafe custom integrations that ignore documented safeguards
- Intentionally embedding secrets into client-side builds
- Reports against unsupported older versions
Disclosure
Please avoid public disclosure until maintainers have had a reasonable chance to investigate and ship a fix.
File: docs/terms-and-privacy.md
Terms of Use & Privacy
Last updated: March 2026
"We" in this document refers to the maintainers of the open-source Page Agent project (https://github.com/alibaba/page-agent). "The software" refers to Page Agent (the JavaScript library) and Page Agent Ext (the browser extension). This document covers the software itself and the testing API we provide โ not any third-party product or service built with it.
1. Open Source Software Privacy
The software is a client-side only tool with a "Bring Your Own Key" (BYOK) architecture. The software itself does not include any backend service. The software does not collect or transmit any user data on its own, and we do not have access to your browsing activity, page content, or task instructions through the software.
All data transmission occurs only between your browser and the LLM provider you configure. You are in full control of which provider receives your data.
The project is open source under the MIT License and can be audited at: https://github.com/alibaba/page-agent
2. Testing API and Demo Disclaimer & Terms of Use
To facilitate easy testing and technical evaluation, we provide a free testing LLM API. This API is used in the project homepage's live demo, the pre-built demo CDN bundles, and the browser extension's default configuration. Users may also use it independently for their own technical evaluation of the software.
This free testing API is provided strictly for technical evaluation and R&D purposes only. It must not be used in any production environment. By using this API, you agree to the following terms:
Permitted Use Only: This API must be used solely for technical evaluation of the software. Any other use โ including integration into other products or services, unlawful activities, violation of the underlying LLM provider's usage policies, or automated scraping at scale โ is strictly prohibited.
No Sensitive Data: You are strictly prohibited from inputting any Personal Identifiable Information (PII), confidential business data, financial/medical records, or using this agent on web pages containing such sensitive information.
Data Processing: We do not store or log your prompts, webpage data (HTML), or any submitted content, nor do we use such data for model training. All data is processed in-transit and immediately discarded. We perform in-memory request validation to prevent abuse of the testing API, and temporarily process IP addresses for rate-limiting purposes. No data from these processes is retained. Data is processed through Alibaba Cloud infrastructure, which is subject to its own privacy policy.
Independent Infrastructure: The software is completely frontend-based with a "Bring Your Own Key" (BYOK) architecture and no built-in backend. To facilitate easy testing, the maintainers have purchased public cloud services from Alibaba Cloud China (aliyun.com Function Compute and BaiLian Qwen models). This project is not a product of, nor endorsed by, Alibaba Cloud.
No Guaranteed Availability: This testing API may be rate-limited, degraded, or discontinued at any time without prior notice.
"AS IS" & Limitation of Liability: This service is provided strictly on an "AS IS" and "AS AVAILABLE" basis, without any warranties. The maintainers bear no liability for any data loss, service interruption, or legal consequences arising from your use of this service.
Recommendation for Real Usage: For secure and continuous usage, we strongly advise using the BYOK mode with your own legally compliant commercial LLM API keys, or connecting to local, offline models (e.g., Ollama).
Note: This free testing LLM API processes data via servers located in Mainland China. If you are located in a region with strict data localization laws (such as the EU/EEA), please do not use this API.
Age Requirement: The software and testing API are not intended for use by individuals under the age of 13 (or the minimum age of digital consent in your jurisdiction).
3. Browser Extension (Page Agent Ext)
Data Processing
The extension performs DOM analysis and automation actions locally in your browser. Your browsing history, passwords, and form data are not accessed or collected by the extension developer.
Data is transmitted to external servers only when you initiate an automation task. When this occurs:
- Your task instructions (natural language commands)
- Simplified page structure (cleaned HTML) of all pages under the extension's control
are sent to the LLM API endpoint configured in your settings.
Note: The HTML cleaning process simplifies page structure for AI readability but does not guarantee removal of sensitive information (e.g., visible text, form values, or personal data on the page). Please be mindful of the page content when initiating tasks.
If you configure a third-party LLM provider (e.g., OpenAI, Anthropic, or others), data is sent directly to that provider. Their privacy policies apply.
If you use the testing API, the terms in Section 2 apply. By using the extension with the default testing API, you agree to those terms.
Data Storage
- Local storage only: Your configuration (API endpoint, API key, model selection) is stored in your browser via
chrome.storage.local(or equivalent browser storage APIs) - No cloud sync: Configuration is not synced to any external server
- No analytics: The extension does not include any analytics or tracking code
Your Control
- The extension is open source and can be audited by anyone
- You choose which LLM provider to use
- You may configure your own API endpoint at any time
- You can clear all stored data by removing the extension
Changes
We may update these terms at our discretion.
Contact
https://github.com/alibaba/page-agent/issues
File: packages/mcp/README.md
@page-agent/mcp
MCP server that lets AI agent clients (Claude Desktop, Copilot, etc.) control your browser through the Page Agent extension.
Prerequisites
- Node.js >= 20
- Page Agent Extension installed in Chrome
- An LLM API key (OpenAI-compatible)
Installation
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"page-agent": {
"command": "npx",
"args": ["-y", "@page-agent/mcp"],
"env": {
"LLM_BASE_URL": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"LLM_API_KEY": "sk-xxx",
"LLM_MODEL_NAME": "qwen3.5-plus"
}
}
}
}Cursor / Copilot
Same format โ add the config to the MCP settings of your client.
MCP Tools
| Tool | Input | Description |
|---|---|---|
execute_task |
{ task: string } |
Execute a browser task in natural language. Blocking. |
get_status |
โ | Returns { connected, busy } |
stop_task |
โ | Stop the currently running task. |
Environment Variables
| Variable | Default | Description |
|---|---|---|
LLM_BASE_URL |
โ | LLM API base URL |
LLM_API_KEY |
โ | LLM API key |
LLM_MODEL_NAME |
โ | Model name |
PORT |
38401 |
HTTP + WebSocket port |
How It Works
โโโโโโโโโโโโโโโโ stdio โโโโโโโโโโโโโโโโโโโโ WebSocket โโโโโโโโโโโโโโโโ
โ Claude / โโโโโโโโโโโบโ @page-agent/mcp โโโโโโโโโโโโโโโบโ Hub tab โ
โ Copilot โ (MCP) โ (Node.js) โ (localhost) โ (extension) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโโ
โ โ
โ HTTP โ useAgent
โผ โผ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Launcher page โ โ MultiPage โ
โ (localhost:PORT) โ โ Agent โ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ- Agent client starts the MCP server via stdio (
npx @page-agent/mcp). - Server starts HTTP + WS on
localhost:PORT, opens the launcher page in browser. - Launcher page triggers the extension to open a hub tab (
hub.html?ws=PORT). - Hub connects to the WS server. MCP tools now proxy tasks to the hub.
The hub tab speaks a generic WebSocket protocol (defined in hub-ws.ts in the extension package) and has no knowledge of MCP. See the hub's protocol docs for message format details.
Architecture
Pure JS ESM, no build step. Source files are the published artifacts.
src/
โโโ index.js # CLI entry: MCP server (stdio) + opens launcher
โโโ hub-bridge.js # HTTP server + WebSocket bridge to hub tab
โโโ launcher.html # Bootstrap page: detects extension, triggers hub openDev
npm run dev:ext
npx @modelcontextprotocol/inspector node packages/mcp/src/index.jsFile: packages/extension/docs/extension_api.md
Page Agent Extension API
Integrate the Page Agent extension into your web app and trigger multi-page browser tasks from page JavaScript.
Installation
1. Install the browser extension
Primary channel:
- Chrome Web Store: https://chromewebstore.google.com/detail/page-agent-ext/akldabonmimlicnjlflnapfeklbfemhj
Latest updates are often published earlier on:
- GitHub Releases: https://github.com/alibaba/page-agent/releases
2. Install type definitions (recommended)
npm install @page-agent/core --save-dev3. Authorization (Token)
The token allows your page JS to call the extension API (window.PAGE_AGENT_EXT) and execute multi-page tasks.
Why token-based access is required:
- The extension has broad browser permissions (page access, navigation, multi-tab control).
- If abused, it can harm user privacy and security.
- Users must explicitly provide the token only to applications they trust.
Setup:
- Open the extension side panel and copy your auth token.
- Set the token in your page:
localStorage.setItem('PageAgentExtUserAuthToken', 'your-token')Quick Start
import type { AgentActivity, AgentStatus, ExecutionResult, HistoricalEvent } from '@page-agent/core'
// Wait for extension injection (up to 1 second)
async function waitForExtension(timeout = 1000): Promise {
const start = Date.now()
while (Date.now() - start < timeout) {
if (window.PAGE_AGENT_EXT) return true
await new Promise((r) => setTimeout(r, 100))
}
return false
}
// Usage
if (await waitForExtension()) {
const result = await window.PAGE_AGENT_EXT!.execute('Click the login button', {
baseURL: 'https://api.openai.com/v1',
apiKey: 'your-api-key',
model: 'gpt-5.2',
onStatusChange: (status) => console.log('Status:', status),
onActivity: (activity) => console.log('Activity:', activity),
})
console.log('Result:', result)
}Global API
After token match, the extension injects APIs into window.
`window.PAGE_AGENT_EXT_VERSION`
Extension version string (for capability checks before using the main API).
`window.PAGE_AGENT_EXT`
Main namespace object.
`PAGE_AGENT_EXT.execute(task, config)`
Execute one agent task.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
task |
string |
Yes | Task description |
config |
ExecuteConfig |
Yes | LLM settings, options, and callbacks |
Returns: Promise<ExecutionResult>
`PAGE_AGENT_EXT.stop()`
Stop the current task.
Limitations
- Normal browser windows only. This extension relies on tab group API which does not work for pop-up window or PWA App window.
Types
Install @page-agent/core for complete types:
import type { AgentActivity, AgentStatus, ExecutionResult, HistoricalEvent } from '@page-agent/core'
export interface ExecuteConfig {
baseURL: string
model: string
apiKey?: string
// Global system-level instructions for the agent.
// Equivalent to AgentConfig.instructions.system.
systemInstruction?: string
// Include the initial tab where page JS starts. Default: true.
includeInitialTab?: boolean
// Control all unpinned tabs in the window instead of only the tab group.
// When enabled, agent sees and can switch to every non-pinned tab.
// Default: false. Experimental.
experimentalIncludeAllTabs?: boolean
onStatusChange?: (status: AgentStatus) => void
onActivity?: (activity: AgentActivity) => void
onHistoryUpdate?: (history: HistoricalEvent[]) => void
}
export type Execute = (task: string, config: ExecuteConfig) => Promise<ExecutionResult>AgentStatus
type AgentStatus = 'idle' | 'running' | 'completed' | 'error' | 'stopped'AgentActivity
type AgentActivity =
| { type: 'thinking' }
| { type: 'executing'; tool: string; input: unknown }
| { type: 'executed'; tool: string; input: unknown; output: string; duration: number }
| { type: 'retrying'; attempt: number; maxAttempts: number }
| { type: 'error'; message: string }HistoricalEvent
type HistoricalEvent =
| { type: 'step'; stepIndex: number; reflection: AgentReflection; action: Action }
| { type: 'observation'; content: string }
| { type: 'user_takeover' }
| { type: 'retry'; message: string; attempt: number; maxAttempts: number }
| { type: 'error'; message: string; rawResponse?: unknown }ExecutionResult
interface ExecutionResult {
success: boolean
data: string
history: HistoricalEvent[]
}Usage Examples
Basic Execution
const result = await window.PAGE_AGENT_EXT!.execute(
'Fill in the email field with [email protected] and click Submit',
{
baseURL: 'https://api.openai.com/v1',
apiKey: process.env.OPENAI_API_KEY!,
model: 'gpt-5.2',
includeInitialTab: false, // Optional: exclude current tab
onStatusChange: (status) => console.log(status),
onActivity: (activity) => console.log(activity),
}
)Stop the Current Task
window.PAGE_AGENT_EXT!.stop()Window Type Declaration
If you are not importing @page-agent/core, add:
import type { AgentActivity, AgentStatus, ExecutionResult, HistoricalEvent } from '@page-agent/core'
interface ExecuteConfig {
baseURL: string
model: string
apiKey?: string
systemInstruction?: string
includeInitialTab?: boolean
experimentalIncludeAllTabs?: boolean
onStatusChange?: (status: AgentStatus) => void
onActivity?: (activity: AgentActivity) => void
onHistoryUpdate?: (history: HistoricalEvent[]) => void
}
declare global {
interface Window {
PAGE_AGENT_EXT_VERSION?: string
PAGE_AGENT_EXT?: {
version: string
execute: Execute
stop: () => void
}
}
}