[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-microsoft--playwright-mcp":3,"tool-microsoft--playwright-mcp":64},[4,17,27,35,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,43,44,45,15,46,26,13,47],"数据工具","视频","插件","其他","音频",{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":10,"last_commit_at":54,"category_tags":55,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,46],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},2181,"OpenHands","OpenHands\u002FOpenHands","OpenHands 是一个专注于 AI 驱动开发的开源平台，旨在让智能体（Agent）像人类开发者一样理解、编写和调试代码。它解决了传统编程中重复性劳动多、环境配置复杂以及人机协作效率低等痛点，通过自动化流程显著提升开发速度。\n\n无论是希望提升编码效率的软件工程师、探索智能体技术的研究人员，还是需要快速原型验证的技术团队，都能从中受益。OpenHands 提供了灵活多样的使用方式：既可以通过命令行（CLI）或本地图形界面在个人电脑上轻松上手，体验类似 Devin 的流畅交互；也能利用其强大的 Python SDK 自定义智能体逻辑，甚至在云端大规模部署上千个智能体并行工作。\n\n其核心技术亮点在于模块化的软件智能体 SDK，这不仅构成了平台的引擎，还支持高度可组合的开发模式。此外，OpenHands 在 SWE-bench 基准测试中取得了 77.6% 的优异成绩，证明了其解决真实世界软件工程问题的能力。平台还具备完善的企业级功能，支持与 Slack、Jira 等工具集成，并提供细粒度的权限管理，适合从个人开发者到大型企业的各类用户场景。",70612,"2026-04-05T11:12:22",[26,15,13,45],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":80,"owner_twitter":81,"owner_website":82,"owner_url":83,"languages":84,"stars":105,"forks":106,"last_commit_at":107,"license":108,"difficulty_score":23,"env_os":109,"env_gpu":110,"env_ram":109,"env_deps":111,"category_tags":118,"github_topics":119,"view_count":122,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":123,"updated_at":124,"faqs":125,"releases":156},3132,"microsoft\u002Fplaywright-mcp","playwright-mcp","Playwright MCP server","Playwright MCP 是一款基于模型上下文协议（MCP）的服务器工具，旨在让大语言模型（LLM）具备直接操控浏览器的能力。它通过 Playwright 引擎，将网页内容转化为结构化的无障碍快照数据，使 AI 能够像人类一样理解并操作页面元素，而无需依赖截图或视觉识别模型。\n\n这一设计巧妙解决了传统自动化方案中常见的痛点：既避免了因处理图片带来的高昂算力成本和延迟，又消除了视觉模型可能产生的识别歧义，让 AI 的交互过程更加快速、轻量且结果确定。对于需要长期运行、状态保持或复杂推理的自主智能体任务（如自动探索测试、自我修复脚本等），Playwright MCP 提供了比命令行更丰富的上下文支持。\n\n该工具主要面向开发者、测试工程师以及构建 AI 智能体的研究人员。如果你正在使用 VS Code、Cursor、Claude Desktop 等支持 MCP 协议的编辑器或客户端，只需简单配置即可集成。其核心技术亮点在于“纯文本结构化交互”，让大模型在不消耗额外视觉 Token 的情况下，也能精准执行点击、输入、导航等浏览器操作，是打造高效网页自动化工作流的理想选择。","## Playwright MCP\n\nA Model Context Protocol (MCP) server that provides browser automation capabilities using [Playwright](https:\u002F\u002Fplaywright.dev). This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.\n\n### Playwright MCP vs Playwright CLI\n\nThis package provides MCP interface into Playwright. If you are using a **coding agent**, you might benefit from using the [CLI+SKILLS](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli) instead.\n\n- **CLI**: Modern **coding agents** increasingly favor CLI–based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance browser automation with large codebases, tests, and reasoning within limited context windows.\u003Cbr>**Learn more about [Playwright CLI with SKILLS](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli)**.\n\n- **MCP**: MCP remains relevant for specialized agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure, such as exploratory automation, self-healing tests, or long-running autonomous workflows where maintaining continuous browser context outweighs token cost concerns.\n\n### Key Features\n\n- **Fast and lightweight**. Uses Playwright's accessibility tree, not pixel-based input.\n- **LLM-friendly**. No vision models needed, operates purely on structured data.\n- **Deterministic tool application**. Avoids ambiguity common with screenshot-based approaches.\n\n### Requirements\n- Node.js 18 or newer\n- VS Code, Cursor, Windsurf, Claude Desktop, Goose or any other MCP client\n\n\u003C!--\n\u002F\u002F Generate using:\nnode utils\u002Fgenerate-links.js\n-->\n\n### Getting started\n\nFirst, install the Playwright MCP server with your client.\n\n**Standard config** works in most of the tools:\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n[\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF\" alt=\"Install in VS Code\">](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [\u003Cimg alt=\"Install in VS Code Insiders\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5\">](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)\n\n\u003Cdetails>\n\u003Csummary>Amp\u003C\u002Fsummary>\n\nAdd via the Amp VS Code extension settings screen or by updating your settings.json file:\n\n```json\n\"amp.mcpServers\": {\n  \"playwright\": {\n    \"command\": \"npx\",\n    \"args\": [\n      \"@playwright\u002Fmcp@latest\"\n    ]\n  }\n}\n```\n\n**Amp CLI Setup:**\n\nAdd via the `amp mcp add`command below\n\n```bash\namp mcp add playwright -- npx @playwright\u002Fmcp@latest\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Antigravity\u003C\u002Fsummary>\n\nAdd via the Antigravity settings or by updating your configuration file:\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Claude Code\u003C\u002Fsummary>\n\nUse the Claude Code CLI to add the Playwright MCP server:\n\n```bash\nclaude mcp add playwright npx @playwright\u002Fmcp@latest\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Claude Desktop\u003C\u002Fsummary>\n\nFollow the MCP install [guide](https:\u002F\u002Fmodelcontextprotocol.io\u002Fquickstart\u002Fuser), use the standard config above.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Cline\u003C\u002Fsummary>\n\nFollow the instruction in the section [Configuring MCP Servers](https:\u002F\u002Fdocs.cline.bot\u002Fmcp\u002Fconfiguring-mcp-servers)\n\n**Example: Local Setup**\n\nAdd the following to your [`cline_mcp_settings.json`](https:\u002F\u002Fdocs.cline.bot\u002Fmcp\u002Fconfiguring-mcp-servers#editing-mcp-settings-files) file:\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"timeout\": 30,\n      \"args\": [\n        \"-y\",\n        \"@playwright\u002Fmcp@latest\"\n      ],\n      \"disabled\": false\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Codex\u003C\u002Fsummary>\n\nUse the Codex CLI to add the Playwright MCP server:\n\n```bash\ncodex mcp add playwright npx \"@playwright\u002Fmcp@latest\"\n```\n\nAlternatively, create or edit the configuration file `~\u002F.codex\u002Fconfig.toml` and add:\n\n```toml\n[mcp_servers.playwright]\ncommand = \"npx\"\nargs = [\"@playwright\u002Fmcp@latest\"]\n```\n\nFor more information, see the [Codex MCP documentation](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex\u002Fblob\u002Fmain\u002Fcodex-rs\u002Fconfig.md#mcp_servers).\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Copilot\u003C\u002Fsummary>\n\nUse the Copilot CLI to interactively add the Playwright MCP server:\n\n```bash\n\u002Fmcp add\n```\n\nAlternatively, create or edit the configuration file `~\u002F.copilot\u002Fmcp-config.json` and add:\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"type\": \"local\",\n      \"command\": \"npx\",\n      \"tools\": [\n        \"*\"\n      ],\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\nFor more information, see the [Copilot CLI documentation](https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcopilot\u002Fconcepts\u002Fagents\u002Fabout-copilot-cli).\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Cursor\u003C\u002Fsummary>\n\n#### Click the button to install:\n\n[\u003Cimg src=\"https:\u002F\u002Fcursor.com\u002Fdeeplink\u002Fmcp-install-dark.svg\" alt=\"Install in Cursor\">](https:\u002F\u002Fcursor.com\u002Fen\u002Finstall-mcp?name=Playwright&config=eyJjb21tYW5kIjoibnB4IEBwbGF5d3JpZ2h0L21jcEBsYXRlc3QifQ%3D%3D)\n\n#### Or install manually:\n\nGo to `Cursor Settings` -> `MCP` -> `Add new MCP Server`. Name to your liking, use `command` type with the command `npx @playwright\u002Fmcp@latest`. You can also verify config or add command like arguments via clicking `Edit`.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Factory\u003C\u002Fsummary>\n\nUse the Factory CLI to add the Playwright MCP server:\n\n```bash\ndroid mcp add playwright \"npx @playwright\u002Fmcp@latest\"\n```\n\nAlternatively, type `\u002Fmcp` within Factory droid to open an interactive UI for managing MCP servers.\n\nFor more information, see the [Factory MCP documentation](https:\u002F\u002Fdocs.factory.ai\u002Fcli\u002Fconfiguration\u002Fmcp).\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Gemini CLI\u003C\u002Fsummary>\n\nFollow the MCP install [guide](https:\u002F\u002Fgithub.com\u002Fgoogle-gemini\u002Fgemini-cli\u002Fblob\u002Fmain\u002Fdocs\u002Ftools\u002Fmcp-server.md#configure-the-mcp-server-in-settingsjson), use the standard config above.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Goose\u003C\u002Fsummary>\n\n#### Click the button to install:\n\n[![Install in Goose](https:\u002F\u002Fblock.github.io\u002Fgoose\u002Fimg\u002Fextension-install-dark.svg)](https:\u002F\u002Fblock.github.io\u002Fgoose\u002Fextension?cmd=npx&arg=%40playwright%2Fmcp%40latest&id=playwright&name=Playwright&description=Interact%20with%20web%20pages%20through%20structured%20accessibility%20snapshots%20using%20Playwright)\n\n#### Or install manually:\n\nGo to `Advanced settings` -> `Extensions` -> `Add custom extension`. Name to your liking, use type `STDIO`, and set the `command` to `npx @playwright\u002Fmcp`. Click \"Add Extension\".\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Kiro\u003C\u002Fsummary>\n\n[![Add to Kiro](https:\u002F\u002Fkiro.dev\u002Fimages\u002Fadd-to-kiro.svg)](https:\u002F\u002Fkiro.dev\u002Flaunch\u002Fmcp\u002Fadd?name=playwright&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22%40playwright%2Fmcp%40latest%22%5D%7D)\n\nFollow the MCP Servers [documentation](https:\u002F\u002Fkiro.dev\u002Fdocs\u002Fmcp\u002F). For example in `.kiro\u002Fsettings\u002Fmcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>LM Studio\u003C\u002Fsummary>\n\n#### Click the button to install:\n\n[![Add MCP Server playwright to LM Studio](https:\u002F\u002Ffiles.lmstudio.ai\u002Fdeeplink\u002Fmcp-install-light.svg)](https:\u002F\u002Flmstudio.ai\u002Finstall-mcp?name=playwright&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAcGxheXdyaWdodC9tY3BAbGF0ZXN0Il19)\n\n#### Or install manually:\n\nGo to `Program` in the right sidebar -> `Install` -> `Edit mcp.json`. Use the standard config above.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>opencode\u003C\u002Fsummary>\n\nFollow the MCP Servers [documentation](https:\u002F\u002Fopencode.ai\u002Fdocs\u002Fmcp-servers\u002F). For example in `~\u002F.config\u002Fopencode\u002Fopencode.json`:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fopencode.ai\u002Fconfig.json\",\n  \"mcp\": {\n    \"playwright\": {\n      \"type\": \"local\",\n      \"command\": [\n        \"npx\",\n        \"@playwright\u002Fmcp@latest\"\n      ],\n      \"enabled\": true\n    }\n  }\n}\n\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Qodo Gen\u003C\u002Fsummary>\n\nOpen [Qodo Gen](https:\u002F\u002Fdocs.qodo.ai\u002Fqodo-documentation\u002Fqodo-gen) chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.\n\nClick \u003Ccode>Save\u003C\u002Fcode>.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>VS Code\u003C\u002Fsummary>\n\n#### Click the button to install:\n\n[\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF\" alt=\"Install in VS Code\">](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [\u003Cimg alt=\"Install in VS Code Insiders\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5\">](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)\n\n#### Or install manually:\n\nFollow the MCP install [guide](https:\u002F\u002Fcode.visualstudio.com\u002Fdocs\u002Fcopilot\u002Fchat\u002Fmcp-servers#_add-an-mcp-server), use the standard config above. You can also install the Playwright MCP server using the VS Code CLI:\n\n```bash\n# For VS Code\ncode --add-mcp '{\"name\":\"playwright\",\"command\":\"npx\",\"args\":[\"@playwright\u002Fmcp@latest\"]}'\n```\n\nAfter installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Warp\u003C\u002Fsummary>\n\nGo to `Settings` -> `AI` -> `Manage MCP Servers` -> `+ Add` to [add an MCP Server](https:\u002F\u002Fdocs.warp.dev\u002Fknowledge-and-collaboration\u002Fmcp#adding-an-mcp-server). Use the standard config above.\n\nAlternatively, use the slash command `\u002Fadd-mcp` in the Warp prompt and paste the standard config from above:\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Windsurf\u003C\u002Fsummary>\n\nFollow Windsurf MCP [documentation](https:\u002F\u002Fdocs.windsurf.com\u002Fwindsurf\u002Fcascade\u002Fmcp). Use the standard config above.\n\n\u003C\u002Fdetails>\n\n### Configuration\n\nPlaywright MCP server supports following arguments. They can be provided in the JSON configuration above, as a part of the `\"args\"` list:\n\n\u003C!--- Options generated by update-readme.js -->\n\n| Option | Description |\n|--------|-------------|\n| --allowed-hosts \u003Chosts...> | comma-separated list of hosts this server is allowed to serve from. Defaults to the host the server is bound to. Pass '*' to disable the host check.\u003Cbr>*env* `PLAYWRIGHT_MCP_ALLOWED_HOSTS` |\n| --allowed-origins \u003Corigins> | semicolon-separated list of TRUSTED origins to allow the browser to request. Default is to allow all. Important: *does not* serve as a security boundary and *does not* affect redirects.\u003Cbr>*env* `PLAYWRIGHT_MCP_ALLOWED_ORIGINS` |\n| --allow-unrestricted-file-access | allow access to files outside of the workspace roots. Also allows unrestricted access to file:\u002F\u002F URLs. By default access to file system is restricted to workspace root directories (or cwd if no roots are configured) only, and navigation to file:\u002F\u002F URLs is blocked.\u003Cbr>*env* `PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS` |\n| --blocked-origins \u003Corigins> | semicolon-separated list of origins to block the browser from requesting. Blocklist is evaluated before allowlist. If used without the allowlist, requests not matching the blocklist are still allowed. Important: *does not* serve as a security boundary and *does not* affect redirects.\u003Cbr>*env* `PLAYWRIGHT_MCP_BLOCKED_ORIGINS` |\n| --block-service-workers | block service workers\u003Cbr>*env* `PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS` |\n| --browser \u003Cbrowser> | browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.\u003Cbr>*env* `PLAYWRIGHT_MCP_BROWSER` |\n| --caps \u003Ccaps> | comma-separated list of additional capabilities to enable, possible values: vision, pdf, devtools.\u003Cbr>*env* `PLAYWRIGHT_MCP_CAPS` |\n| --cdp-endpoint \u003Cendpoint> | CDP endpoint to connect to.\u003Cbr>*env* `PLAYWRIGHT_MCP_CDP_ENDPOINT` |\n| --cdp-header \u003Cheaders...> | CDP headers to send with the connect request, multiple can be specified.\u003Cbr>*env* `PLAYWRIGHT_MCP_CDP_HEADER` |\n| --cdp-timeout \u003Ctimeout> | timeout in milliseconds for connecting to CDP endpoint, defaults to 30000ms\u003Cbr>*env* `PLAYWRIGHT_MCP_CDP_TIMEOUT` |\n| --codegen \u003Clang> | specify the language to use for code generation, possible values: \"typescript\", \"none\". Default is \"typescript\".\u003Cbr>*env* `PLAYWRIGHT_MCP_CODEGEN` |\n| --config \u003Cpath> | path to the configuration file.\u003Cbr>*env* `PLAYWRIGHT_MCP_CONFIG` |\n| --console-level \u003Clevel> | level of console messages to return: \"error\", \"warning\", \"info\", \"debug\". Each level includes the messages of more severe levels.\u003Cbr>*env* `PLAYWRIGHT_MCP_CONSOLE_LEVEL` |\n| --device \u003Cdevice> | device to emulate, for example: \"iPhone 15\"\u003Cbr>*env* `PLAYWRIGHT_MCP_DEVICE` |\n| --executable-path \u003Cpath> | path to the browser executable.\u003Cbr>*env* `PLAYWRIGHT_MCP_EXECUTABLE_PATH` |\n| --extension | Connect to a running browser instance (Edge\u002FChrome only). Requires the \"Playwright MCP Bridge\" browser extension to be installed.\u003Cbr>*env* `PLAYWRIGHT_MCP_EXTENSION` |\n| --endpoint \u003Cendpoint> | Bound browser endpoint to connect to.\u003Cbr>*env* `PLAYWRIGHT_MCP_ENDPOINT` |\n| --grant-permissions \u003Cpermissions...> | List of permissions to grant to the browser context, for example \"geolocation\", \"clipboard-read\", \"clipboard-write\".\u003Cbr>*env* `PLAYWRIGHT_MCP_GRANT_PERMISSIONS` |\n| --headless | run browser in headless mode, headed by default\u003Cbr>*env* `PLAYWRIGHT_MCP_HEADLESS` |\n| --host \u003Chost> | host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.\u003Cbr>*env* `PLAYWRIGHT_MCP_HOST` |\n| --ignore-https-errors | ignore https errors\u003Cbr>*env* `PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS` |\n| --init-page \u003Cpath...> | path to TypeScript file to evaluate on Playwright page object\u003Cbr>*env* `PLAYWRIGHT_MCP_INIT_PAGE` |\n| --init-script \u003Cpath...> | path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times.\u003Cbr>*env* `PLAYWRIGHT_MCP_INIT_SCRIPT` |\n| --isolated | keep the browser profile in memory, do not save it to disk.\u003Cbr>*env* `PLAYWRIGHT_MCP_ISOLATED` |\n| --image-responses \u003Cmode> | whether to send image responses to the client. Can be \"allow\" or \"omit\", Defaults to \"allow\".\u003Cbr>*env* `PLAYWRIGHT_MCP_IMAGE_RESPONSES` |\n| --no-sandbox | disable the sandbox for all process types that are normally sandboxed.\u003Cbr>*env* `PLAYWRIGHT_MCP_NO_SANDBOX` |\n| --output-dir \u003Cpath> | path to the directory for output files.\u003Cbr>*env* `PLAYWRIGHT_MCP_OUTPUT_DIR` |\n| --output-mode \u003Cmode> | whether to save snapshots, console messages, network logs to a file or to the standard output. Can be \"file\" or \"stdout\". Default is \"stdout\".\u003Cbr>*env* `PLAYWRIGHT_MCP_OUTPUT_MODE` |\n| --port \u003Cport> | port to listen on for SSE transport.\u003Cbr>*env* `PLAYWRIGHT_MCP_PORT` |\n| --proxy-bypass \u003Cbypass> | comma-separated domains to bypass proxy, for example \".com,chromium.org,.domain.com\"\u003Cbr>*env* `PLAYWRIGHT_MCP_PROXY_BYPASS` |\n| --proxy-server \u003Cproxy> | specify proxy server, for example \"http:\u002F\u002Fmyproxy:3128\" or \"socks5:\u002F\u002Fmyproxy:8080\"\u003Cbr>*env* `PLAYWRIGHT_MCP_PROXY_SERVER` |\n| --sandbox | enable the sandbox for all process types that are normally not sandboxed.\u003Cbr>*env* `PLAYWRIGHT_MCP_SANDBOX` |\n| --save-session | Whether to save the Playwright MCP session into the output directory.\u003Cbr>*env* `PLAYWRIGHT_MCP_SAVE_SESSION` |\n| --secrets \u003Cpath> | path to a file containing secrets in the dotenv format\u003Cbr>*env* `PLAYWRIGHT_MCP_SECRETS` |\n| --shared-browser-context | reuse the same browser context between all connected HTTP clients.\u003Cbr>*env* `PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT` |\n| --snapshot-mode \u003Cmode> | when taking snapshots for responses, specifies the mode to use. Can be \"full\" or \"none\". Default is \"full\".\u003Cbr>*env* `PLAYWRIGHT_MCP_SNAPSHOT_MODE` |\n| --storage-state \u003Cpath> | path to the storage state file for isolated sessions.\u003Cbr>*env* `PLAYWRIGHT_MCP_STORAGE_STATE` |\n| --test-id-attribute \u003Cattribute> | specify the attribute to use for test ids, defaults to \"data-testid\"\u003Cbr>*env* `PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE` |\n| --timeout-action \u003Ctimeout> | specify action timeout in milliseconds, defaults to 5000ms\u003Cbr>*env* `PLAYWRIGHT_MCP_TIMEOUT_ACTION` |\n| --timeout-navigation \u003Ctimeout> | specify navigation timeout in milliseconds, defaults to 60000ms\u003Cbr>*env* `PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION` |\n| --user-agent \u003Cua string> | specify user agent string\u003Cbr>*env* `PLAYWRIGHT_MCP_USER_AGENT` |\n| --user-data-dir \u003Cpath> | path to the user data directory. If not specified, a temporary directory will be created.\u003Cbr>*env* `PLAYWRIGHT_MCP_USER_DATA_DIR` |\n| --viewport-size \u003Csize> | specify browser viewport size in pixels, for example \"1280x720\"\u003Cbr>*env* `PLAYWRIGHT_MCP_VIEWPORT_SIZE` |\n\n\u003C!--- End of options generated section -->\n\n### User profile\n\nYou can run Playwright MCP with persistent profile like a regular browser (default), in isolated contexts for testing sessions, or connect to your existing browser using the browser extension.\n\n**Persistent profile**\n\nAll the logged in information will be stored in the persistent profile, you can delete it between sessions if you'd like to clear the offline state.\nPersistent profile is located at the following locations and you can override it with the `--user-data-dir` argument.\n\n```bash\n# Windows\n%USERPROFILE%\\AppData\\Local\\ms-playwright\\mcp-{channel}-{workspace-hash}\n\n# macOS\n- ~\u002FLibrary\u002FCaches\u002Fms-playwright\u002Fmcp-{channel}-{workspace-hash}\n\n# Linux\n- ~\u002F.cache\u002Fms-playwright\u002Fmcp-{channel}-{workspace-hash}\n```\n\n`{workspace-hash}` is derived from the MCP client's workspace root, so different projects get separate profiles automatically.\n\n**Isolated**\n\nIn the isolated mode, each session is started in the isolated profile. Every time you ask MCP to close the browser,\nthe session is closed and all the storage state for this session is lost. You can provide initial storage state\nto the browser via the config's `contextOptions` or via the `--storage-state` argument. Learn more about the storage\nstate [here](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fauth).\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\",\n        \"--isolated\",\n        \"--storage-state={path\u002Fto\u002Fstorage.json}\"\n      ]\n    }\n  }\n}\n```\n\n**Browser Extension**\n\nThe Playwright MCP Chrome Extension allows you to connect to existing browser tabs and leverage your logged-in sessions and browser state. See [packages\u002Fextension\u002FREADME.md](packages\u002Fextension\u002FREADME.md) for installation and setup instructions.\n\n### Initial state\n\nThere are multiple ways to provide the initial state to the browser context or a page.\n\nFor the storage state, you can either:\n- Start with a user data directory using the `--user-data-dir` argument. This will persist all browser data between the sessions.\n- Start with a storage state file using the `--storage-state` argument. This will load cookies and local storage from the file into an isolated browser context.\n\nFor the page state, you can use:\n\n- `--init-page` to point to a TypeScript file that will be evaluated on the Playwright page object. This allows you to run arbitrary code to set up the page.\n\n```ts\n\u002F\u002F init-page.ts\nexport default async ({ page }) => {\n  await page.context().grantPermissions(['geolocation']);\n  await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });\n  await page.setViewportSize({ width: 1280, height: 720 });\n};\n```\n\n- `--init-script` to point to a JavaScript file that will be added as an initialization script. The script will be evaluated in every page before any of the page's scripts.\nThis is useful for overriding browser APIs or setting up the environment.\n\n```js\n\u002F\u002F init-script.js\nwindow.isPlaywrightMCP = true;\n```\n\n### Configuration file\n\nThe Playwright MCP server can be configured using a JSON configuration file. You can specify the configuration file\nusing the `--config` command line option:\n\n```bash\nnpx @playwright\u002Fmcp@latest --config path\u002Fto\u002Fconfig.json\n```\n\n\u003Cdetails>\n\u003Csummary>Configuration file schema\u003C\u002Fsummary>\n\n\u003C!--- Config generated by update-readme.js -->\n\n```typescript\n{\n  \u002F**\n   * The browser to use.\n   *\u002F\n  browser?: {\n    \u002F**\n     * The type of browser to use.\n     *\u002F\n    browserName?: 'chromium' | 'firefox' | 'webkit';\n\n    \u002F**\n     * Keep the browser profile in memory, do not save it to disk.\n     *\u002F\n    isolated?: boolean;\n\n    \u002F**\n     * Path to a user data directory for browser profile persistence.\n     * Temporary directory is created by default.\n     *\u002F\n    userDataDir?: string;\n\n    \u002F**\n     * Launch options passed to\n     * @see https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-browsertype#browser-type-launch-persistent-context\n     *\n     * This is useful for settings options like `channel`, `headless`, `executablePath`, etc.\n     *\u002F\n    launchOptions?: playwright.LaunchOptions;\n\n    \u002F**\n     * Context options for the browser context.\n     *\n     * This is useful for settings options like `viewport`.\n     *\u002F\n    contextOptions?: playwright.BrowserContextOptions;\n\n    \u002F**\n     * Chrome DevTools Protocol endpoint to connect to an existing browser instance in case of Chromium family browsers.\n     *\u002F\n    cdpEndpoint?: string;\n\n    \u002F**\n     * CDP headers to send with the connect request.\n     *\u002F\n    cdpHeaders?: Record\u003Cstring, string>;\n\n    \u002F**\n     * Timeout in milliseconds for connecting to CDP endpoint. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.\n     *\u002F\n    cdpTimeout?: number;\n\n    \u002F**\n     * Remote endpoint to connect to an existing Playwright server.\n     *\u002F\n    remoteEndpoint?: string;\n\n    \u002F**\n     * Paths to TypeScript files to add as initialization scripts for Playwright page.\n     *\u002F\n    initPage?: string[];\n\n    \u002F**\n     * Paths to JavaScript files to add as initialization scripts.\n     * The scripts will be evaluated in every page before any of the page's scripts.\n     *\u002F\n    initScript?: string[];\n  },\n\n  \u002F**\n   * Connect to a running browser instance (Edge\u002FChrome only). If specified, `browser`\n   * config is ignored.\n   * Requires the \"Playwright MCP Bridge\" browser extension to be installed.\n   *\u002F\n  extension?: boolean;\n\n  server?: {\n    \u002F**\n     * The port to listen on for SSE or MCP transport.\n     *\u002F\n    port?: number;\n\n    \u002F**\n     * The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.\n     *\u002F\n    host?: string;\n\n    \u002F**\n     * The hosts this server is allowed to serve from. Defaults to the host server is bound to.\n     * This is not for CORS, but rather for the DNS rebinding protection.\n     *\u002F\n    allowedHosts?: string[];\n  },\n\n  \u002F**\n   * List of enabled tool capabilities. Possible values:\n   *   - 'core': Core browser automation features.\n   *   - 'pdf': PDF generation and manipulation.\n   *   - 'vision': Coordinate-based interactions.\n   *   - 'devtools': Developer tools features.\n   *\u002F\n  capabilities?: ToolCapability[];\n\n  \u002F**\n   * Whether to save the Playwright session into the output directory.\n   *\u002F\n  saveSession?: boolean;\n\n  \u002F**\n   * Reuse the same browser context between all connected HTTP clients.\n   *\u002F\n  sharedBrowserContext?: boolean;\n\n  \u002F**\n   * Secrets are used to replace matching plain text in the tool responses to prevent the LLM\n   * from accidentally getting sensitive data. It is a convenience and not a security feature,\n   * make sure to always examine information coming in and from the tool on the client.\n   *\u002F\n  secrets?: Record\u003Cstring, string>;\n\n  \u002F**\n   * The directory to save output files.\n   *\u002F\n  outputDir?: string;\n\n  console?: {\n    \u002F**\n     * The level of console messages to return. Each level includes the messages of more severe levels. Defaults to \"info\".\n     *\u002F\n    level?: 'error' | 'warning' | 'info' | 'debug';\n  },\n\n  network?: {\n    \u002F**\n     * List of origins to allow the browser to request. Default is to allow all. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.\n     *\n     * Supported formats:\n     * - Full origin: `https:\u002F\u002Fexample.com:8080` - matches only that origin\n     * - Wildcard port: `http:\u002F\u002Flocalhost:*` - matches any port on localhost with http protocol\n     *\u002F\n    allowedOrigins?: string[];\n\n    \u002F**\n     * List of origins to block the browser to request. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.\n     *\n     * Supported formats:\n     * - Full origin: `https:\u002F\u002Fexample.com:8080` - matches only that origin\n     * - Wildcard port: `http:\u002F\u002Flocalhost:*` - matches any port on localhost with http protocol\n     *\u002F\n    blockedOrigins?: string[];\n  };\n\n  \u002F**\n   * Specify the attribute to use for test ids, defaults to \"data-testid\".\n   *\u002F\n  testIdAttribute?: string;\n\n  timeouts?: {\n    \u002F*\n     * Configures default action timeout: https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-page#page-set-default-timeout. Defaults to 5000ms.\n     *\u002F\n    action?: number;\n\n    \u002F*\n     * Configures default navigation timeout: https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-page#page-set-default-navigation-timeout. Defaults to 60000ms.\n     *\u002F\n    navigation?: number;\n\n    \u002F**\n     * Configures default expect timeout: https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Ftest-timeouts#expect-timeout. Defaults to 5000ms.\n     *\u002F\n    expect?: number;\n  };\n\n  \u002F**\n   * Whether to send image responses to the client. Can be \"allow\", \"omit\", or \"auto\". Defaults to \"auto\", which sends images if the client can display them.\n   *\u002F\n  imageResponses?: 'allow' | 'omit';\n\n  snapshot?: {\n    \u002F**\n     * When taking snapshots for responses, specifies the mode to use.\n     *\u002F\n    mode?: 'full' | 'none';\n  };\n\n  \u002F**\n   * allowUnrestrictedFileAccess acts as a guardrail to prevent the LLM from accidentally\n   * wandering outside its intended workspace. It is a convenience defense to catch unintended\n   * file access, not a secure boundary; a deliberate attempt to reach other directories can be\n   * easily worked around, so always rely on client-level permissions for true security.\n   *\u002F\n  allowUnrestrictedFileAccess?: boolean;\n\n  \u002F**\n   * Specify the language to use for code generation.\n   *\u002F\n  codegen?: 'typescript' | 'none';\n}\n```\n\n\u003C!--- End of config generated section -->\n\n\u003C\u002Fdetails>\n\n### Standalone MCP server\n\nWhen running headed browser on system w\u002Fo display or from worker processes of the IDEs,\nrun the MCP server from environment with the DISPLAY and pass the `--port` flag to enable HTTP transport.\n\n```bash\nnpx @playwright\u002Fmcp@latest --port 8931\n```\n\nAnd then in MCP client config, set the `url` to the HTTP endpoint:\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"url\": \"http:\u002F\u002Flocalhost:8931\u002Fmcp\"\n    }\n  }\n}\n```\n\n## Security\n\nPlaywright MCP is **not** a security boundary. See [MCP Security Best Practices](https:\u002F\u002Fmodelcontextprotocol.io\u002Fdocs\u002Ftutorials\u002Fsecurity\u002Fsecurity_best_practices) for guidance on securing your deployment.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Docker\u003C\u002Fb>\u003C\u002Fsummary>\n\n**NOTE:** The Docker implementation only supports headless chromium at the moment.\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"--init\", \"--pull=always\", \"mcr.microsoft.com\u002Fplaywright\u002Fmcp\"]\n    }\n  }\n}\n```\n\nOr If you prefer to run the container as a long-lived service instead of letting the MCP client spawn it, use:\n\n```\ndocker run -d -i --rm --init --pull=always \\\n  --entrypoint node \\\n  --name playwright \\\n  -p 8931:8931 \\\n  mcr.microsoft.com\u002Fplaywright\u002Fmcp \\\n  cli.js --headless --browser chromium --no-sandbox --port 8931 --host 0.0.0.0\n```\n\nThe server will listen on host port **8931** and can be reached by any MCP client.  \n\nYou can build the Docker image yourself.\n\n```\ndocker build -t mcr.microsoft.com\u002Fplaywright\u002Fmcp .\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Programmatic usage\u003C\u002Fb>\u003C\u002Fsummary>\n\n```js\nimport http from 'http';\n\nimport { createConnection } from '@playwright\u002Fmcp';\nimport { SSEServerTransport } from '@modelcontextprotocol\u002Fsdk\u002Fserver\u002Fsse.js';\n\nhttp.createServer(async (req, res) => {\n  \u002F\u002F ...\n\n  \u002F\u002F Creates a headless Playwright MCP server with SSE transport\n  const connection = await createConnection({ browser: { launchOptions: { headless: true } } });\n  const transport = new SSEServerTransport('\u002Fmessages', res);\n  await connection.connect(transport);\n\n  \u002F\u002F ...\n});\n```\n\u003C\u002Fdetails>\n\n### Tools\n\n\u003C!--- Tools generated by update-readme.js -->\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Core automation\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_click**\n  - Title: Click\n  - Description: Perform click on a web page\n  - Parameters:\n    - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n    - `selector` (string, optional): CSS or role selector for the target element, when \"ref\" is not available\n    - `doubleClick` (boolean, optional): Whether to perform a double click instead of a single click\n    - `button` (string, optional): Button to click, defaults to left\n    - `modifiers` (array, optional): Modifier keys to press\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_close**\n  - Title: Close browser\n  - Description: Close the page\n  - Parameters: None\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_console_messages**\n  - Title: Get console messages\n  - Description: Returns all console messages\n  - Parameters:\n    - `level` (string): Level of the console messages to return. Each level includes the messages of more severe levels. Defaults to \"info\".\n    - `all` (boolean, optional): Return all console messages since the beginning of the session, not just since the last navigation. Defaults to false.\n    - `filename` (string, optional): Filename to save the console messages to. If not provided, messages are returned as text.\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_drag**\n  - Title: Drag mouse\n  - Description: Perform drag and drop between two elements\n  - Parameters:\n    - `startElement` (string): Human-readable source element description used to obtain the permission to interact with the element\n    - `startRef` (string): Exact source element reference from the page snapshot\n    - `startSelector` (string, optional): CSS or role selector for the source element, when ref is not available\n    - `endElement` (string): Human-readable target element description used to obtain the permission to interact with the element\n    - `endRef` (string): Exact target element reference from the page snapshot\n    - `endSelector` (string, optional): CSS or role selector for the target element, when ref is not available\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_evaluate**\n  - Title: Evaluate JavaScript\n  - Description: Evaluate JavaScript expression on page or element\n  - Parameters:\n    - `function` (string): () => { \u002F* code *\u002F } or (element) => { \u002F* code *\u002F } when element is provided\n    - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string, optional): Exact target element reference from the page snapshot\n    - `selector` (string, optional): CSS or role selector for the target element, when \"ref\" is not available.\n    - `filename` (string, optional): Filename to save the result to. If not provided, result is returned as text.\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_file_upload**\n  - Title: Upload files\n  - Description: Upload one or multiple files\n  - Parameters:\n    - `paths` (array, optional): The absolute paths to the files to upload. Can be single file or multiple files. If omitted, file chooser is cancelled.\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_fill_form**\n  - Title: Fill form\n  - Description: Fill multiple form fields\n  - Parameters:\n    - `fields` (array): Fields to fill in\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_handle_dialog**\n  - Title: Handle a dialog\n  - Description: Handle a dialog\n  - Parameters:\n    - `accept` (boolean): Whether to accept the dialog.\n    - `promptText` (string, optional): The text of the prompt in case of a prompt dialog.\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_hover**\n  - Title: Hover mouse\n  - Description: Hover over element on page\n  - Parameters:\n    - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n    - `selector` (string, optional): CSS or role selector for the target element, when \"ref\" is not available\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_navigate**\n  - Title: Navigate to a URL\n  - Description: Navigate to a URL\n  - Parameters:\n    - `url` (string): The URL to navigate to\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_navigate_back**\n  - Title: Go back\n  - Description: Go back to the previous page in the history\n  - Parameters: None\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_network_requests**\n  - Title: List network requests\n  - Description: Returns all network requests since loading the page\n  - Parameters:\n    - `static` (boolean): Whether to include successful static resources like images, fonts, scripts, etc. Defaults to false.\n    - `requestBody` (boolean): Whether to include request body. Defaults to false.\n    - `requestHeaders` (boolean): Whether to include request headers. Defaults to false.\n    - `filter` (string, optional): Only return requests whose URL matches this regexp (e.g. \"\u002Fapi\u002F.*user\").\n    - `filename` (string, optional): Filename to save the network requests to. If not provided, requests are returned as text.\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_press_key**\n  - Title: Press a key\n  - Description: Press a key on the keyboard\n  - Parameters:\n    - `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_resize**\n  - Title: Resize browser window\n  - Description: Resize the browser window\n  - Parameters:\n    - `width` (number): Width of the browser window\n    - `height` (number): Height of the browser window\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_run_code**\n  - Title: Run Playwright code\n  - Description: Run Playwright code snippet\n  - Parameters:\n    - `code` (string, optional): A JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: `async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }`\n    - `filename` (string, optional): Load code from the specified file. If both code and filename are provided, code will be ignored.\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_select_option**\n  - Title: Select option\n  - Description: Select an option in a dropdown\n  - Parameters:\n    - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n    - `selector` (string, optional): CSS or role selector for the target element, when \"ref\" is not available\n    - `values` (array): Array of values to select in the dropdown. This can be a single value or multiple values.\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_snapshot**\n  - Title: Page snapshot\n  - Description: Capture accessibility snapshot of the current page, this is better than screenshot\n  - Parameters:\n    - `filename` (string, optional): Save snapshot to markdown file instead of returning it in the response.\n    - `selector` (string, optional): Element selector of the root element to capture a partial snapshot instead of the whole page\n    - `depth` (number, optional): Limit the depth of the snapshot tree\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_take_screenshot**\n  - Title: Take a screenshot\n  - Description: Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.\n  - Parameters:\n    - `type` (string): Image format for the screenshot. Default is png.\n    - `filename` (string, optional): File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified. Prefer relative file names to stay within the output directory.\n    - `element` (string, optional): Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too.\n    - `ref` (string, optional): Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.\n    - `selector` (string, optional): CSS or role selector for the target element, when \"ref\" is not available.\n    - `fullPage` (boolean, optional): When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots.\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_type**\n  - Title: Type text\n  - Description: Type text into editable element\n  - Parameters:\n    - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n    - `selector` (string, optional): CSS or role selector for the target element, when \"ref\" is not available\n    - `text` (string): Text to type into the element\n    - `submit` (boolean, optional): Whether to submit entered text (press Enter after)\n    - `slowly` (boolean, optional): Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_wait_for**\n  - Title: Wait for\n  - Description: Wait for text to appear or disappear or a specified time to pass\n  - Parameters:\n    - `time` (number, optional): The time to wait in seconds\n    - `text` (string, optional): The text to wait for\n    - `textGone` (string, optional): The text to wait for to disappear\n  - Read-only: **false**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Tab management\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_tabs**\n  - Title: Manage tabs\n  - Description: List, create, close, or select a browser tab.\n  - Parameters:\n    - `action` (string): Operation to perform\n    - `index` (number, optional): Tab index, used for close\u002Fselect. If omitted for close, current tab is closed.\n    - `url` (string, optional): URL to navigate to in the new tab, used for new.\n  - Read-only: **false**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Browser installation\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Configuration (opt-in via --caps=config)\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_get_config**\n  - Title: Get config\n  - Description: Get the final resolved config after merging CLI options, environment variables and config file.\n  - Parameters: None\n  - Read-only: **true**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Network (opt-in via --caps=network)\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_network_state_set**\n  - Title: Set network state\n  - Description: Sets the browser network state to online or offline. When offline, all network requests will fail.\n  - Parameters:\n    - `state` (string): Set to \"offline\" to simulate offline mode, \"online\" to restore network connectivity\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_route**\n  - Title: Mock network requests\n  - Description: Set up a route to mock network requests matching a URL pattern\n  - Parameters:\n    - `pattern` (string): URL pattern to match (e.g., \"**\u002Fapi\u002Fusers\", \"**\u002F*.{png,jpg}\")\n    - `status` (number, optional): HTTP status code to return (default: 200)\n    - `body` (string, optional): Response body (text or JSON string)\n    - `contentType` (string, optional): Content-Type header (e.g., \"application\u002Fjson\", \"text\u002Fhtml\")\n    - `headers` (array, optional): Headers to add in \"Name: Value\" format\n    - `removeHeaders` (string, optional): Comma-separated list of header names to remove from request\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_route_list**\n  - Title: List network routes\n  - Description: List all active network routes\n  - Parameters: None\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_unroute**\n  - Title: Remove network routes\n  - Description: Remove network routes matching a pattern (or all routes if no pattern specified)\n  - Parameters:\n    - `pattern` (string, optional): URL pattern to unroute (omit to remove all routes)\n  - Read-only: **false**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Storage (opt-in via --caps=storage)\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_cookie_clear**\n  - Title: Clear cookies\n  - Description: Clear all cookies\n  - Parameters: None\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_cookie_delete**\n  - Title: Delete cookie\n  - Description: Delete a specific cookie\n  - Parameters:\n    - `name` (string): Cookie name to delete\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_cookie_get**\n  - Title: Get cookie\n  - Description: Get a specific cookie by name\n  - Parameters:\n    - `name` (string): Cookie name to get\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_cookie_list**\n  - Title: List cookies\n  - Description: List all cookies (optionally filtered by domain\u002Fpath)\n  - Parameters:\n    - `domain` (string, optional): Filter cookies by domain\n    - `path` (string, optional): Filter cookies by path\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_cookie_set**\n  - Title: Set cookie\n  - Description: Set a cookie with optional flags (domain, path, expires, httpOnly, secure, sameSite)\n  - Parameters:\n    - `name` (string): Cookie name\n    - `value` (string): Cookie value\n    - `domain` (string, optional): Cookie domain\n    - `path` (string, optional): Cookie path\n    - `expires` (number, optional): Cookie expiration as Unix timestamp\n    - `httpOnly` (boolean, optional): Whether the cookie is HTTP only\n    - `secure` (boolean, optional): Whether the cookie is secure\n    - `sameSite` (string, optional): Cookie SameSite attribute\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_localstorage_clear**\n  - Title: Clear localStorage\n  - Description: Clear all localStorage\n  - Parameters: None\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_localstorage_delete**\n  - Title: Delete localStorage item\n  - Description: Delete a localStorage item\n  - Parameters:\n    - `key` (string): Key to delete\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_localstorage_get**\n  - Title: Get localStorage item\n  - Description: Get a localStorage item by key\n  - Parameters:\n    - `key` (string): Key to get\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_localstorage_list**\n  - Title: List localStorage\n  - Description: List all localStorage key-value pairs\n  - Parameters: None\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_localstorage_set**\n  - Title: Set localStorage item\n  - Description: Set a localStorage item\n  - Parameters:\n    - `key` (string): Key to set\n    - `value` (string): Value to set\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_sessionstorage_clear**\n  - Title: Clear sessionStorage\n  - Description: Clear all sessionStorage\n  - Parameters: None\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_sessionstorage_delete**\n  - Title: Delete sessionStorage item\n  - Description: Delete a sessionStorage item\n  - Parameters:\n    - `key` (string): Key to delete\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_sessionstorage_get**\n  - Title: Get sessionStorage item\n  - Description: Get a sessionStorage item by key\n  - Parameters:\n    - `key` (string): Key to get\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_sessionstorage_list**\n  - Title: List sessionStorage\n  - Description: List all sessionStorage key-value pairs\n  - Parameters: None\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_sessionstorage_set**\n  - Title: Set sessionStorage item\n  - Description: Set a sessionStorage item\n  - Parameters:\n    - `key` (string): Key to set\n    - `value` (string): Value to set\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_set_storage_state**\n  - Title: Restore storage state\n  - Description: Restore storage state (cookies, local storage) from a file. This clears existing cookies and local storage before restoring.\n  - Parameters:\n    - `filename` (string): Path to the storage state file to restore from\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_storage_state**\n  - Title: Save storage state\n  - Description: Save storage state (cookies, local storage) to a file for later reuse\n  - Parameters:\n    - `filename` (string, optional): File name to save the storage state to. Defaults to `storage-state-{timestamp}.json` if not specified.\n  - Read-only: **true**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>DevTools (opt-in via --caps=devtools)\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_resume**\n  - Title: Resume paused script execution\n  - Description: Resume script execution after it was paused. When called with step set to true, execution will pause again before the next action.\n  - Parameters:\n    - `step` (boolean, optional): When true, execution will pause again before the next action, allowing step-by-step debugging.\n    - `location` (string, optional): Pause execution at a specific \u003Cfile>:\u003Cline>, e.g. \"example.spec.ts:42\".\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_start_tracing**\n  - Title: Start tracing\n  - Description: Start trace recording\n  - Parameters: None\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_start_video**\n  - Title: Start video\n  - Description: Start video recording\n  - Parameters:\n    - `filename` (string, optional): Filename to save the video.\n    - `size` (object, optional): Video size\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_stop_tracing**\n  - Title: Stop tracing\n  - Description: Stop trace recording\n  - Parameters: None\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_stop_video**\n  - Title: Stop video\n  - Description: Stop video recording\n  - Parameters: None\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_video_chapter**\n  - Title: Video chapter\n  - Description: Add a chapter marker to the video recording. Shows a full-screen chapter card with blurred backdrop.\n  - Parameters:\n    - `title` (string): Chapter title\n    - `description` (string, optional): Chapter description\n    - `duration` (number, optional): Duration in milliseconds to show the chapter card\n  - Read-only: **true**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Coordinate-based (opt-in via --caps=vision)\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_mouse_click_xy**\n  - Title: Click\n  - Description: Click mouse button at a given position\n  - Parameters:\n    - `x` (number): X coordinate\n    - `y` (number): Y coordinate\n    - `button` (string, optional): Button to click, defaults to left\n    - `clickCount` (number, optional): Number of clicks, defaults to 1\n    - `delay` (number, optional): Time to wait between mouse down and mouse up in milliseconds, defaults to 0\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_mouse_down**\n  - Title: Press mouse down\n  - Description: Press mouse down\n  - Parameters:\n    - `button` (string, optional): Button to press, defaults to left\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_mouse_drag_xy**\n  - Title: Drag mouse\n  - Description: Drag left mouse button to a given position\n  - Parameters:\n    - `startX` (number): Start X coordinate\n    - `startY` (number): Start Y coordinate\n    - `endX` (number): End X coordinate\n    - `endY` (number): End Y coordinate\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_mouse_move_xy**\n  - Title: Move mouse\n  - Description: Move mouse to a given position\n  - Parameters:\n    - `x` (number): X coordinate\n    - `y` (number): Y coordinate\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_mouse_up**\n  - Title: Press mouse up\n  - Description: Press mouse up\n  - Parameters:\n    - `button` (string, optional): Button to press, defaults to left\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_mouse_wheel**\n  - Title: Scroll mouse wheel\n  - Description: Scroll mouse wheel\n  - Parameters:\n    - `deltaX` (number): X delta\n    - `deltaY` (number): Y delta\n  - Read-only: **false**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>PDF generation (opt-in via --caps=pdf)\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_pdf_save**\n  - Title: Save as PDF\n  - Description: Save page as PDF\n  - Parameters:\n    - `filename` (string, optional): File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified. Prefer relative file names to stay within the output directory.\n  - Read-only: **true**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Test assertions (opt-in via --caps=testing)\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_generate_locator**\n  - Title: Create locator for element\n  - Description: Generate locator for the given element to use in tests\n  - Parameters:\n    - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n    - `selector` (string, optional): CSS or role selector for the target element, when \"ref\" is not available\n  - Read-only: **true**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_verify_element_visible**\n  - Title: Verify element visible\n  - Description: Verify element is visible on the page\n  - Parameters:\n    - `role` (string): ROLE of the element. Can be found in the snapshot like this: `- {ROLE} \"Accessible Name\":`\n    - `accessibleName` (string): ACCESSIBLE_NAME of the element. Can be found in the snapshot like this: `- role \"{ACCESSIBLE_NAME}\"`\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_verify_list_visible**\n  - Title: Verify list visible\n  - Description: Verify list is visible on the page\n  - Parameters:\n    - `element` (string): Human-readable list description\n    - `ref` (string): Exact target element reference that points to the list\n    - `selector` (string, optional): CSS or role selector for the target list, when \"ref\" is not available.\n    - `items` (array): Items to verify\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_verify_text_visible**\n  - Title: Verify text visible\n  - Description: Verify text is visible on the page. Prefer browser_verify_element_visible if possible.\n  - Parameters:\n    - `text` (string): TEXT to verify. Can be found in the snapshot like this: `- role \"Accessible Name\": {TEXT}` or like this: `- text: {TEXT}`\n  - Read-only: **false**\n\n\u003C!-- NOTE: This has been generated via update-readme.js -->\n\n- **browser_verify_value**\n  - Title: Verify value\n  - Description: Verify element value\n  - Parameters:\n    - `type` (string): Type of the element\n    - `element` (string): Human-readable element description\n    - `ref` (string): Exact target element reference from the page snapshot\n    - `selector` (string, optional): CSS or role selector for the target element, when \"ref\" is not available\n    - `value` (string): Value to verify. For checkbox, use \"true\" or \"false\".\n  - Read-only: **false**\n\n\u003C\u002Fdetails>\n\n\n\u003C!--- End of tools generated section -->\n","## Playwright MCP\n\n一个模型上下文协议（MCP）服务器，使用 [Playwright](https:\u002F\u002Fplaywright.dev) 提供浏览器自动化功能。该服务器使大型语言模型能够通过结构化的无障碍快照与网页交互，无需依赖截图或经过视觉调优的模型。\n\n### Playwright MCP 与 Playwright CLI\n\n本包为 Playwright 提供了 MCP 接口。如果你正在使用 **编码代理**，可能更适合使用 [CLI+SKILLS](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli)。\n\n- **CLI**：现代 **编码代理** 越来越倾向于将基于 CLI 的工作流以 SKILL 的形式暴露，而不是使用 MCP，因为 CLI 调用更节省 token：它们避免将庞大的工具模式和冗长的无障碍树加载到模型上下文中，允许代理通过简洁、专门构建的命令来执行操作。这使得 CLI + SKILLs 更适合高吞吐量的编码代理，这些代理需要在有限的上下文窗口内平衡浏览器自动化与大型代码库、测试以及推理需求。\u003Cbr>**了解更多关于 [Playwright CLI with SKILLS](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli)**。\n\n- **MCP**：MCP 仍然适用于那些受益于持久化状态、丰富自省能力以及对页面结构进行迭代推理的专用代理循环，例如探索性自动化、自愈测试，或者长期运行的自主工作流，在这些场景中，保持连续的浏览器上下文比 token 成本更为重要。\n\n### 核心特性\n\n- **快速且轻量**。使用 Playwright 的无障碍树，而非基于像素的输入。\n- **LLM 友好**。无需视觉模型，完全基于结构化数据运行。\n- **确定性的工具应用**。避免了基于截图方法常见的歧义。\n\n### 系统要求\n- Node.js 18 或更高版本\n- VS Code、Cursor、Windsurf、Claude Desktop、Goose 或其他任何 MCP 客户端\n\n\u003C!--\n\u002F\u002F 使用以下命令生成：\nnode utils\u002Fgenerate-links.js\n-->\n\n### 快速开始\n\n首先，使用你的客户端安装 Playwright MCP 服务器。\n\n**标准配置** 在大多数工具中都适用：\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n[\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF\" alt=\"在 VS Code 中安装\">](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [\u003Cimg alt=\"在 VS Code Insiders 中安装\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5\">](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)\n\n\u003Cdetails>\n\u003Csummary>Amp\u003C\u002Fsummary>\n\n可以通过 Amp VS Code 扩展的设置界面添加，或直接更新 `settings.json` 文件：\n\n```json\n\"amp.mcpServers\": {\n  \"playwright\": {\n    \"command\": \"npx\",\n    \"args\": [\n      \"@playwright\u002Fmcp@latest\"\n    ]\n  }\n}\n```\n\n**Amp CLI 设置：**\n\n使用下面的 `amp mcp add` 命令添加：\n\n```bash\namp mcp add playwright -- npx @playwright\u002Fmcp@latest\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Antigravity\u003C\u002Fsummary>\n\n可以通过 Antigravity 的设置界面添加，或直接编辑配置文件：\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Claude Code\u003C\u002Fsummary>\n\n使用 Claude Code CLI 添加 Playwright MCP 服务器：\n\n```bash\nclaude mcp add playwright npx @playwright\u002Fmcp@latest\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Claude Desktop\u003C\u002Fsummary>\n\n按照 MCP 安装 [指南](https:\u002F\u002Fmodelcontextprotocol.io\u002Fquickstart\u002Fuser)，使用上述标准配置。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Cline\u003C\u002Fsummary>\n\n请参考 [配置 MCP 服务器](https:\u002F\u002Fdocs.cline.bot\u002Fmcp\u002Fconfiguring-mcp-servers) 部分的说明。\n\n**示例：本地设置**\n\n将以下内容添加到你的 [`cline_mcp_settings.json`](https:\u002F\u002Fdocs.cline.bot\u002Fmcp\u002Fconfiguring-mcp-servers#editing-mcp-settings-files) 文件中：\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"timeout\": 30,\n      \"args\": [\n        \"-y\",\n        \"@playwright\u002Fmcp@latest\"\n      ],\n      \"disabled\": false\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Codex\u003C\u002Fsummary>\n\n使用 Codex CLI 添加 Playwright MCP 服务器：\n\n```bash\ncodex mcp add playwright npx \"@playwright\u002Fmcp@latest\"\n```\n\n你也可以创建或编辑配置文件 `~\u002F.codex\u002Fconfig.toml`，并添加：\n\n```toml\n[mcp_servers.playwright]\ncommand = \"npx\"\nargs = [\"@playwright\u002Fmcp@latest\"]\n```\n\n更多信息，请参阅 [Codex MCP 文档](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex\u002Fblob\u002Fmain\u002Fcodex-rs\u002Fconfig.md#mcp_servers)。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Copilot\u003C\u002Fsummary>\n\n使用 Copilot CLI 交互式地添加 Playwright MCP 服务器：\n\n```bash\n\u002Fmcp add\n```\n\n或者，创建或编辑配置文件 `~\u002F.copilot\u002Fmcp-config.json`，并添加：\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"type\": \"local\",\n      \"command\": \"npx\",\n      \"tools\": [\n        \"*\"\n      ],\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n更多信息，请参阅 [Copilot CLI 文档](https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcopilot\u002Fconcepts\u002Fagents\u002Fabout-copilot-cli)。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Cursor\u003C\u002Fsummary>\n\n#### 点击按钮即可安装：\n\n[\u003Cimg src=\"https:\u002F\u002Fcursor.com\u002Fdeeplink\u002Fmcp-install-dark.svg\" alt=\"在 Cursor 中安装\">](https:\u002F\u002Fcursor.com\u002Fen\u002Finstall-mcp?name=Playwright&config=eyJjb21tYW5kIjoibnB4IEBwbGF5d3JpZ2h0L21jcEBsYXRlc3QifQ%3D%3D)\n\n#### 或者手动安装：\n\n前往 `Cursor 设置` -> `MCP` -> `添加新的 MCP 服务器`。根据喜好命名，选择 `command` 类型，并输入命令 `npx @playwright\u002Fmcp@latest`。你还可以通过点击 `编辑` 来验证配置或添加类似命令的参数。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Factory\u003C\u002Fsummary>\n\n使用 Factory CLI 添加 Playwright MCP 服务器：\n\n```bash\ndroid mcp add playwright \"npx @playwright\u002Fmcp@latest\"\n```\n\n你也可以在 Factory droid 中输入 `\u002Fmcp`，打开用于管理 MCP 服务器的交互式界面。\n\n更多信息，请参阅 [Factory MCP 文档](https:\u002F\u002Fdocs.factory.ai\u002Fcli\u002Fconfiguration\u002Fmcp)。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Gemini CLI\u003C\u002Fsummary>\n\n按照 MCP 安装 [指南](https:\u002F\u002Fgithub.com\u002Fgoogle-gemini\u002Fgemini-cli\u002Fblob\u002Fmain\u002Fdocs\u002Ftools\u002Fmcp-server.md#configure-the-mcp-server-in-settingsjson)，使用上述标准配置。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Goose\u003C\u002Fsummary>\n\n#### 点击按钮即可安装：\n\n[![在 Goose 中安装](https:\u002F\u002Fblock.github.io\u002Fgoose\u002Fimg\u002Fextension-install-dark.svg)](https:\u002F\u002Fblock.github.io\u002Fgoose\u002Fextension?cmd=npx&arg=%40playwright%2Fmcp%40latest&id=playwright&name=Playwright&description=Interact%20with%20web%20pages%20through%20structured%20accessibility%20snapshots%20using%20Playwright)\n\n#### 或者手动安装：\n\n前往 `高级设置` -> `扩展程序` -> `添加自定义扩展程序`。根据您的喜好命名，选择类型为 `STDIO`，并将 `命令` 设置为 `npx @playwright\u002Fmcp`。点击“添加扩展程序”。\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Kiro\u003C\u002Fsummary>\n\n[![添加到 Kiro](https:\u002F\u002Fkiro.dev\u002Fimages\u002Fadd-to-kiro.svg)](https:\u002F\u002Fkiro.dev\u002Flaunch\u002Fmcp\u002Fadd?name=playwright&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22%40playwright%2Fmcp%40latest%22%5D%7D)\n\n请遵循 MCP 服务器的 [文档](https:\u002F\u002Fkiro.dev\u002Fdocs\u002Fmcp\u002F)。例如，在 `.kiro\u002Fsettings\u002Fmcp.json` 中：\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>LM Studio\u003C\u002Fsummary>\n\n#### 点击按钮即可安装：\n\n[![将 MCP 服务器 playwright 添加到 LM Studio](https:\u002F\u002Ffiles.lmstudio.ai\u002Fdeeplink\u002Fmcp-install-light.svg)](https:\u002F\u002Flmstudio.ai\u002Finstall-mcp?name=playwright&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAcGxheXdyaWdodC9tY3BAbGF0ZXN0Il19)\n\n#### 或者手动安装：\n\n前往右侧边栏的 `程序` -> `安装` -> `编辑 mcp.json`。使用上述标准配置。\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>opencode\u003C\u002Fsummary>\n\n请遵循 MCP 服务器的 [文档](https:\u002F\u002Fopencode.ai\u002Fdocs\u002Fmcp-servers\u002F)。例如，在 `~\u002F.config\u002Fopencode\u002Fopencode.json` 中：\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fopencode.ai\u002Fconfig.json\",\n  \"mcp\": {\n    \"playwright\": {\n      \"type\": \"local\",\n      \"command\": [\n        \"npx\",\n        \"@playwright\u002Fmcp@latest\"\n      ],\n      \"enabled\": true\n    }\n  }\n}\n\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Qodo Gen\u003C\u002Fsummary>\n\n在 VSCode 或 IntelliJ 中打开 [Qodo Gen](https:\u002F\u002Fdocs.qodo.ai\u002Fqodo-documentation\u002Fqodo-gen) 聊天面板 → 连接更多工具 → + 添加新的 MCP → 粘贴上述标准配置。\n\n点击 \u003Ccode>保存\u003C\u002Fcode>。\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>VS Code\u003C\u002Fsummary>\n\n#### 点击按钮即可安装：\n\n[\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF\" alt=\"在 VS Code 中安装\">](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [\u003Cimg alt=\"在 VS Code Insiders 中安装\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5\">](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)\n\n#### 或者手动安装：\n\n请按照 MCP 安装 [指南](https:\u002F\u002Fcode.visualstudio.com\u002Fdocs\u002Fcopilot\u002Fchat\u002Fmcp-servers#_add-an-mcp-server)，使用上述标准配置。您也可以通过 VS Code CLI 安装 Playwright 的 MCP 服务器：\n\n```bash\n\n\n# 对于 VS Code\ncode --add-mcp '{\"name\":\"playwright\",\"command\":\"npx\",\"args\":[\"@playwright\u002Fmcp@latest\"]}'\n```\n\n安装完成后，Playwright 的 MCP 服务器就可以在 VS Code 中与您的 GitHub Copilot 助手一起使用了。\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Warp\u003C\u002Fsummary>\n\n前往 `设置` -> `AI` -> `管理 MCP 服务器` -> `+ 添加` 来 [添加 MCP 服务器](https:\u002F\u002Fdocs.warp.dev\u002Fknowledge-and-collaboration\u002Fmcp#adding-an-mcp-server)。使用上述标准配置。\n\n或者，您也可以在 Warp 提示词中使用斜杠命令 `\u002Fadd-mcp`，并粘贴上面的标准配置：\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Windsurf\u003C\u002Fsummary>\n\n请遵循 Windsurf MCP 的 [文档](https:\u002F\u002Fdocs.windsurf.com\u002Fwindsurf\u002Fcascade\u002Fmcp)。使用上述标准配置。\n\n\u003C\u002Fdetails>\n\n### 配置\n\nPlaywright MCP 服务器支持以下参数。这些参数可以在上述 JSON 配置中作为 `\"args\"` 列表的一部分提供：\n\n\u003C!--- Options generated by update-readme.js -->\n\n| 选项 | 描述 |\n|--------|-------------|\n| --allowed-hosts \u003Chosts...> | 该服务器允许服务的主机的逗号分隔列表。默认为服务器绑定的主机。传递 `'*'` 可禁用主机检查。\u003Cbr>*env* `PLAYWRIGHT_MCP_ALLOWED_HOSTS` |\n| --allowed-origins \u003Corigins> | 浏览器允许请求的受信任来源的分号分隔列表。默认允许所有来源。重要提示：*不*作为安全边界，且*不*影响重定向。\u003Cbr>*env* `PLAYWRIGHT_MCP_ALLOWED_ORIGINS` |\n| --allow-unrestricted-file-access | 允许访问工作区根目录之外的文件。同时也允许无限制地访问 `file:\u002F\u002F` URL。默认情况下，文件系统访问仅限于工作区根目录（或如果没有配置根目录则为当前工作目录），并且会阻止导航到 `file:\u002F\u002F` URL。\u003Cbr>*env* `PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS` |\n| --blocked-origins \u003Corigins> | 浏览器被阻止请求的来源的分号分隔列表。黑名单会在白名单之前被评估。如果未使用白名单，则未匹配黑名单的请求仍将被允许。重要提示：*不*作为安全边界，且*不*影响重定向。\u003Cbr>*env* `PLAYWRIGHT_MCP_BLOCKED_ORIGINS` |\n| --block-service-workers | 阻止 Service Workers\u003Cbr>*env* `PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS` |\n| --browser \u003Cbrowser> | 要使用的浏览器或 Chrome 渠道，可能的值包括：chrome、firefox、webkit、msedge。\u003Cbr>*env* `PLAYWRIGHT_MCP_BROWSER` |\n| --caps \u003Ccaps> | 要启用的附加功能的逗号分隔列表，可能的值包括：vision、pdf、devtools。\u003Cbr>*env* `PLAYWRIGHT_MCP_CAPS` |\n| --cdp-endpoint \u003Cendpoint> | 要连接的 CDP 端点。\u003Cbr>*env* `PLAYWRIGHT_MCP_CDP_ENDPOINT` |\n| --cdp-header \u003Cheaders...> | 与连接请求一起发送的 CDP 头部，可以指定多个。\u003Cbr>*env* `PLAYWRIGHT_MCP_CDP_HEADER` |\n| --cdp-timeout \u003Ctimeout> | 连接到 CDP 端点的超时时间，单位为毫秒，默认为 30000 毫秒。\u003Cbr>*env* `PLAYWRIGHT_MCP_CDP_TIMEOUT` |\n| --codegen \u003Clang> | 指定用于代码生成的语言，可能的值包括：“typescript”、“none”。默认为“typescript”。\u003Cbr>*env* `PLAYWRIGHT_MCP_CODEGEN` |\n| --config \u003Cpath> | 配置文件的路径。\u003Cbr>*env* `PLAYWRIGHT_MCP_CONFIG` |\n| --console-level \u003Clevel> | 控制台消息的返回级别：“error”、“warning”、“info”、“debug”。每个级别都包含更严重级别的消息。\u003Cbr>*env* `PLAYWRIGHT_MCP_CONSOLE_LEVEL` |\n| --device \u003Cdevice> | 要模拟的设备，例如：“iPhone 15”。\u003Cbr>*env* `PLAYWRIGHT_MCP_DEVICE` |\n| --executable-path \u003Cpath> | 浏览器可执行文件的路径。\u003Cbr>*env* `PLAYWRIGHT_MCP_EXECUTABLE_PATH` |\n| --extension | 连接到正在运行的浏览器实例（仅限 Edge\u002FChrome）。需要安装“Playwright MCP Bridge”浏览器扩展。\u003Cbr>*env* `PLAYWRIGHT_MCP_EXTENSION` |\n| --endpoint \u003Cendpoint> | 要连接的已绑定浏览器端点。\u003Cbr>*env* `PLAYWRIGHT_MCP_ENDPOINT` |\n| --grant-permissions \u003Cpermissions...> | 要授予浏览器上下文的权限列表，例如“geolocation”、“clipboard-read”、“clipboard-write”。\u003Cbr>*env* `PLAYWRIGHT_MCP_GRANT_PERMISSIONS` |\n| --headless | 以无头模式运行浏览器，默认为有头模式。\u003Cbr>*env* `PLAYWRIGHT_MCP_HEADLESS` |\n| --host \u003Chost> | 服务器要绑定的主机。默认为 localhost。使用 0.0.0.0 可绑定到所有接口。\u003Cbr>*env* `PLAYWRIGHT_MCP_HOST` |\n| --ignore-https-errors | 忽略 HTTPS 错误。\u003Cbr>*env* `PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS` |\n| --init-page \u003Cpath...> | 在 Playwright 页面对象上求值的 TypeScript 文件路径。\u003Cbr>*env* `PLAYWRIGHT_MCP_INIT_PAGE` |\n| --init-script \u003Cpath...> | 作为初始化脚本添加的 JavaScript 文件路径。该脚本将在页面上的任何其他脚本之前在每个页面上执行。可以多次指定。\u003Cbr>*env* `PLAYWRIGHT_MCP_INIT_SCRIPT` |\n| --isolated | 将浏览器配置文件保留在内存中，不将其保存到磁盘。\u003Cbr>*env* `PLAYWRIGHT_MCP_ISOLATED` |\n| --image-responses \u003Cmode> | 是否向客户端发送图片响应。可以是“allow”或“omit”，默认为“allow”。\u003Cbr>*env* `PLAYWRIGHT_MCP_IMAGE_RESPONSES` |\n| --no-sandbox | 禁用通常会被沙盒化的所有进程类型的沙盒。\u003Cbr>*env* `PLAYWRIGHT_MCP_NO_SANDBOX` |\n| --output-dir \u003Cpath> | 输出文件的目录路径。\u003Cbr>*env* `PLAYWRIGHT_MCP_OUTPUT_DIR` |\n| --output-mode \u003Cmode> | 是否将快照、控制台消息、网络日志保存到文件或标准输出。可以是“file”或“stdout”。默认为“stdout”。\u003Cbr>*env* `PLAYWRIGHT_MCP_OUTPUT_MODE` |\n| --port \u003Cport> | 用于 SSE 传输的监听端口。\u003Cbr>*env* `PLAYWRIGHT_MCP_PORT` |\n| --proxy-bypass \u003Cbypass> | 要绕过代理的逗号分隔域名，例如“.com,chromium.org,.domain.com”。\u003Cbr>*env* `PLAYWRIGHT_MCP_PROXY_BYPASS` |\n| --proxy-server \u003Cproxy> | 指定代理服务器，例如“http:\u002F\u002Fmyproxy:3128”或“socks5:\u002F\u002Fmyproxy:8080”。\u003Cbr>*env* `PLAYWRIGHT_MCP_PROXY_SERVER` |\n| --sandbox | 为通常不会被沙盒化的所有进程类型启用沙盒。\u003Cbr>*env* `PLAYWRIGHT_MCP_SANDBOX` |\n| --save-session | 是否将 Playwright MCP 会话保存到输出目录。\u003Cbr>*env* `PLAYWRIGHT_MCP_SAVE_SESSION` |\n| --secrets \u003Cpath> | 包含 dotenv 格式秘密的文件路径。\u003Cbr>*env* `PLAYWRIGHT_MCP_SECRETS` |\n| --shared-browser-context | 在所有连接的 HTTP 客户端之间重用相同的浏览器上下文。\u003Cbr>*env* `PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT` |\n| --snapshot-mode \u003Cmode> | 在为响应拍摄快照时，指定使用的模式。可以是“full”或“none”。默认为“full”。\u003Cbr>*env* `PLAYWRIGHT_MCP_SNAPSHOT_MODE` |\n| --storage-state \u003Cpath> | 隔离会话的存储状态文件路径。\u003Cbr>*env* `PLAYWRIGHT_MCP_STORAGE_STATE` |\n| --test-id-attribute \u003Cattribute> | 指定用于测试 ID 的属性，默认为“data-testid”。\u003Cbr>*env* `PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE` |\n| --timeout-action \u003Ctimeout> | 指定操作超时时间，单位为毫秒，默认为 5000 毫秒。\u003Cbr>*env* `PLAYWRIGHT_MCP_TIMEOUT_ACTION` |\n| --timeout-navigation \u003Ctimeout> | 指定导航超时时间，单位为毫秒，默认为 60000 毫秒。\u003Cbr>*env* `PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION` |\n| --user-agent \u003Cua string> | 指定用户代理字符串。\u003Cbr>*env* `PLAYWRIGHT_MCP_USER_AGENT` |\n| --user-data-dir \u003Cpath> | 用户数据目录的路径。如果未指定，则会创建一个临时目录。\u003Cbr>*env* `PLAYWRIGHT_MCP_USER_DATA_DIR` |\n| --viewport-size \u003Csize> | 指定浏览器视口大小，单位为像素，例如“1280x720”。\u003Cbr>*env* `PLAYWRIGHT_MCP_VIEWPORT_SIZE` |\n\n\u003C!--- End of options generated section -->\n\n### 用户配置文件\n\n您可以将 Playwright MCP 以持久化配置文件模式运行，就像使用常规浏览器一样（默认模式），也可以在隔离的上下文中为测试会话运行，或者通过浏览器扩展程序连接到您现有的浏览器。\n\n**持久化配置文件**\n\n所有已登录的信息都将存储在持久化配置文件中。如果您希望清除离线状态，可以在会话之间删除该配置文件。持久化配置文件位于以下路径，您也可以使用 `--user-data-dir` 参数来覆盖它：\n\n```bash\n# Windows\n%USERPROFILE%\\AppData\\Local\\ms-playwright\\mcp-{channel}-{workspace-hash}\n\n# macOS\n- ~\u002FLibrary\u002FCaches\u002Fms-playwright\u002Fmcp-{channel}-{workspace-hash}\n\n# Linux\n- ~\u002F.cache\u002Fms-playwright\u002Fmcp-{channel}-{workspace-hash}\n```\n\n`{workspace-hash}` 是根据 MCP 客户端的工作区根目录派生的，因此不同的项目会自动获得独立的配置文件。\n\n**隔离模式**\n\n在隔离模式下，每个会话都会在独立的配置文件中启动。每次您让 MCP 关闭浏览器时，该会话就会结束，并且此会话的所有存储状态都会被清除。您可以通过配置中的 `contextOptions` 或 `--storage-state` 参数向浏览器提供初始存储状态。有关存储状态的更多信息，请参阅 [此处](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fauth)。\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\",\n        \"--isolated\",\n        \"--storage-state={path\u002Fto\u002Fstorage.json}\"\n      ]\n    }\n  }\n}\n```\n\n**浏览器扩展程序**\n\nPlaywright MCP Chrome 扩展程序允许您连接到现有的浏览器标签页，并利用您的已登录会话和浏览器状态。有关安装和设置说明，请参阅 [packages\u002Fextension\u002FREADME.md](packages\u002Fextension\u002FREADME.md)。\n\n### 初始状态\n\n有多种方式可以为浏览器上下文或页面提供初始状态。\n\n对于存储状态，您可以：\n- 使用 `--user-data-dir` 参数指定用户数据目录来启动。这将在会话之间持续保存所有浏览器数据。\n- 使用 `--storage-state` 参数指定存储状态文件来启动。这会将文件中的 Cookie 和本地存储加载到一个隔离的浏览器上下文中。\n\n对于页面状态，您可以使用：\n\n- `--init-page` 指向一个 TypeScript 文件，该文件将在 Playwright 的页面对象上执行。这使您可以运行任意代码来设置页面。\n\n```ts\n\u002F\u002F init-page.ts\nexport default async ({ page }) => {\n  await page.context().grantPermissions(['geolocation']);\n  await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });\n  await page.setViewportSize({ width: 1280, height: 720 });\n};\n```\n\n- `--init-script` 指向一个 JavaScript 文件，该文件将作为初始化脚本添加。该脚本会在页面上的任何其他脚本之前被执行。这对于覆盖浏览器 API 或设置环境非常有用。\n\n```js\n\u002F\u002F init-script.js\nwindow.isPlaywrightMCP = true;\n```\n\n### 配置文件\n\nPlaywright MCP 服务器可以通过 JSON 配置文件进行配置。你可以使用 `--config` 命令行选项指定配置文件：\n\n```bash\nnpx @playwright\u002Fmcp@latest --config path\u002Fto\u002Fconfig.json\n```\n\n\u003Cdetails>\n\u003Csummary>配置文件模式\u003C\u002Fsummary>\n\n\u003C!--- Config generated by update-readme.js -->\n\n```typescript\n{\n  \u002F**\n   * 要使用的浏览器。\n   *\u002F\n  browser?: {\n    \u002F**\n     * 要使用的浏览器类型。\n     *\u002F\n    browserName?: 'chromium' | 'firefox' | 'webkit';\n\n    \u002F**\n     * 将浏览器配置文件保留在内存中，不将其保存到磁盘。\n     *\u002F\n    isolated?: boolean;\n\n    \u002F**\n     * 浏览器配置文件持久化的用户数据目录路径。\n     * 默认会创建一个临时目录。\n     *\u002F\n    userDataDir?: string;\n\n    \u002F**\n     * 传递给以下方法的启动选项：\n     * @see https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-browsertype#browser-type-launch-persistent-context\n     *\n     * 这对于设置 `channel`、`headless`、`executablePath` 等选项非常有用。\n     *\u002F\n    launchOptions?: playwright.LaunchOptions;\n\n    \u002F**\n     * 浏览器上下文的上下文选项。\n     *\n     * 这对于设置 `viewport` 等选项很有用。\n     *\u002F\n    contextOptions?: playwright.BrowserContextOptions;\n\n    \u002F**\n     * 对于 Chromium 系列浏览器，用于连接现有浏览器实例的 Chrome DevTools 协议端点。\n     *\u002F\n    cdpEndpoint?: string;\n\n    \u002F**\n     * 与连接请求一起发送的 CDP 头部。\n     *\u002F\n    cdpHeaders?: Record\u003Cstring, string>;\n\n    \u002F**\n     * 连接到 CDP 端点的超时时间，单位为毫秒。默认值为 30000 毫秒（30 秒）。传入 0 表示禁用超时。\n     *\u002F\n    cdpTimeout?: number;\n\n    \u002F**\n     * 用于连接现有 Playwright 服务器的远程端点。\n     *\u002F\n    remoteEndpoint?: string;\n\n    \u002F**\n     * 要作为 Playwright 页面初始化脚本添加的 TypeScript 文件路径。\n     *\u002F\n    initPage?: string[];\n\n    \u002F**\n     * 要作为初始化脚本添加的 JavaScript 文件路径。\n     * 这些脚本将在页面的所有脚本之前在每个页面上执行。\n     *\u002F\n    initScript?: string[];\n  },\n\n  \u002F**\n   * 连接到正在运行的浏览器实例（仅限 Edge\u002FChrome）。如果指定了此选项，则会忽略 `browser` 配置。\n   * 需要安装“Playwright MCP Bridge”浏览器扩展程序。\n   *\u002F\n  extension?: boolean;\n\n  server?: {\n    \u002F**\n     * 用于 SSE 或 MCP 传输的监听端口。\n     *\u002F\n    port?: number;\n\n    \u002F**\n     * 服务器绑定的主机。默认值为 localhost。使用 0.0.0.0 可以绑定到所有接口。\n     *\u002F\n    host?: string;\n\n    \u002F**\n     * 此服务器允许服务的主机列表。默认值为服务器绑定的主机。\n     * 这不是用于 CORS，而是用于 DNS 重绑定保护。\n     *\u002F\n    allowedHosts?: string[];\n  },\n\n  \u002F**\n   * 已启用工具功能列表。可能的值包括：\n   *   - 'core': 核心浏览器自动化功能。\n   *   - 'pdf': PDF 生成和操作。\n   *   - 'vision': 基于坐标的交互。\n   *   - 'devtools': 开发者工具功能。\n   *\u002F\n  capabilities?: ToolCapability[];\n\n  \u002F**\n   * 是否将 Playwright 会话保存到输出目录。\n   *\u002F\n  saveSession?: boolean;\n\n  \u002F**\n   * 在所有连接的 HTTP 客户端之间共享同一个浏览器上下文。\n   *\u002F\n  sharedBrowserContext?: boolean;\n\n  \u002F**\n   * 密钥用于替换工具响应中的匹配明文，以防止 LLM 不小心获取敏感数据。这是一种便利措施，并非安全功能，请务必始终检查来自客户端的输入和工具输出的信息。\n   *\u002F\n  secrets?: Record\u003Cstring, string>;\n\n  \u002F**\n   * 用于保存输出文件的目录。\n   *\u002F\n  outputDir?: string;\n\n  console?: {\n    \u002F**\n     * 要返回的控制台消息级别。每个级别包含更严重级别的消息。默认值为 \"info\"。\n     *\u002F\n    level?: 'error' | 'warning' | 'info' | 'debug';\n  },\n\n  network?: {\n    \u002F**\n     * 允许浏览器请求的源列表。默认情况下允许所有源。同时匹配 `allowedOrigins` 和 `blockedOrigins` 的源将被阻止。\n     *\n     * 支持的格式：\n     * - 完整源：`https:\u002F\u002Fexample.com:8080` - 仅匹配该源\n     * - 通配符端口：`http:\u002F\u002Flocalhost:*` - 匹配本地主机上任何端口的 http 协议\n     *\u002F\n    allowedOrigins?: string[];\n\n    \u002F**\n     * 阻止浏览器请求的源列表。同时匹配 `allowedOrigins` 和 `blockedOrigins` 的源将被阻止。\n     *\n     * 支持的格式：\n     * - 完整源：`https:\u002F\u002Fexample.com:8080` - 仅匹配该源\n     * - 通配符端口：`http:\u002F\u002Flocalhost:*` - 匹配本地主机上任何端口的 http 协议\n     *\u002F\n    blockedOrigins?: string[];\n  };\n\n  \u002F**\n   * 指定用于测试 ID 的属性，默认为 \"data-testid\"。\n   *\u002F\n  testIdAttribute?: string;\n\n  timeouts?: {\n    \u002F*\n     * 配置默认操作超时：https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-page#page-set-default-timeout。默认值为 5000 毫秒。\n     *\u002F\n    action?: number;\n\n    \u002F*\n     * 配置默认导航超时：https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-page#page-set-default-navigation-timeout。默认值为 60000 毫秒。\n     *\u002F\n    navigation?: number;\n\n    \u002F**\n     * 配置默认 expect 超时：https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Ftest-timeouts#expect-timeout。默认值为 5000 毫秒。\n     *\u002F\n    expect?: number;\n  };\n\n  \u002F**\n   * 是否向客户端发送图片响应。可选值为 \"allow\"、\"omit\" 或 \"auto\"。默认值为 \"auto\"，即如果客户端能够显示图片则发送。\n   *\u002F\n  imageResponses?: 'allow' | 'omit';\n\n  snapshot?: {\n    \u002F**\n     * 在为响应拍摄快照时，指定要使用的模式。\n     *\u002F\n    mode?: 'full' | 'none';\n  };\n\n  \u002F**\n   * allowUnrestrictedFileAccess 作为一道护栏，防止 LLM 不小心超出其预期的工作空间。它是一种方便的防御机制，用于捕捉意外的文件访问行为，但并非安全边界；如果有意尝试访问其他目录，很容易绕过此限制，因此真正的安全性仍需依赖客户端级别的权限控制。\n   *\u002F\n  allowUnrestrictedFileAccess?: boolean;\n\n  \u002F**\n   * 指定用于代码生成的语言。\n   *\u002F\n  codegen?: 'typescript' | 'none';\n}\n```\n\n\u003C!--- End of config generated section -->\n\n\u003C\u002Fdetails>\n\n### 独立的 MCP 服务器\n\n当在没有显示器的系统上或从 IDE 的工作进程运行带界面的浏览器时，应在具有 DISPLAY 环境的环境中运行 MCP 服务器，并传递 `--port` 标志以启用 HTTP 传输。\n\n```bash\nnpx @playwright\u002Fmcp@latest --port 8931\n```\n\n然后在 MCP 客户端配置中，将 `url` 设置为 HTTP 端点：\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"url\": \"http:\u002F\u002Flocalhost:8931\u002Fmcp\"\n    }\n  }\n}\n```\n\n## 安全性\n\nPlaywright MCP **不是**安全边界。有关保护您的部署的指导，请参阅 [MCP 安全最佳实践](https:\u002F\u002Fmodelcontextprotocol.io\u002Fdocs\u002Ftutorials\u002Fsecurity\u002Fsecurity_best_practices)。\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Docker\u003C\u002Fb>\u003C\u002Fsummary>\n\n**注意：** 目前 Docker 实现仅支持无头 Chromium。\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"--init\", \"--pull=always\", \"mcr.microsoft.com\u002Fplaywright\u002Fmcp\"]\n    }\n  }\n}\n```\n\n或者，如果您希望将容器作为长期运行的服务来启动，而不是让 MCP 客户端生成它，则可以使用以下命令：\n\n```\ndocker run -d -i --rm --init --pull=always \\\n  --entrypoint node \\\n  --name playwright \\\n  -p 8931:8931 \\\n  mcr.microsoft.com\u002Fplaywright\u002Fmcp \\\n  cli.js --headless --browser chromium --no-sandbox --port 8931 --host 0.0.0.0\n```\n\n该服务器将在主机端口 **8931** 上监听，并可被任何 MCP 客户端访问。\n\n您也可以自行构建 Docker 镜像：\n\n```\ndocker build -t mcr.microsoft.com\u002Fplaywright\u002Fmcp .\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>编程式使用\u003C\u002Fb>\u003C\u002Fsummary>\n\n```js\nimport http from 'http';\n\nimport { createConnection } from '@playwright\u002Fmcp';\nimport { SSEServerTransport } from '@modelcontextprotocol\u002Fsdk\u002Fserver\u002Fsse.js';\n\nhttp.createServer(async (req, res) => {\n  \u002F\u002F ...\n\n  \u002F\u002F 创建一个带有 SSE 传输的无头 Playwright MCP 服务器\n  const connection = await createConnection({ browser: { launchOptions: { headless: true } } });\n  const transport = new SSEServerTransport('\u002Fmessages', res);\n  await connection.connect(transport);\n\n  \u002F\u002F ...\n});\n```\n\u003C\u002Fdetails>\n\n### 工具\n\n\u003C!--- Tools generated by update-readme.js -->\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>核心自动化\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_click**\n  - 标题：点击\n  - 描述：在网页上执行点击操作\n  - 参数：\n    - `element`（字符串，可选）：用于获取与元素交互权限的人类可读元素描述\n    - `ref`（字符串）：页面快照中目标元素的确切引用\n    - `selector`（字符串，可选）：当无法使用“ref”时，用于定位目标元素的 CSS 或角色选择器\n    - `doubleClick`（布尔值，可选）：是否执行双击而非单击\n    - `button`（字符串，可选）：要点击的按钮，默认为左键\n    - `modifiers`（数组，可选）：要按下的修饰键\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_close**\n  - 标题：关闭浏览器\n  - 描述：关闭页面\n  - 参数：无\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_console_messages**\n  - 标题：获取控制台消息\n  - 描述：返回所有控制台消息\n  - 参数：\n    - `level`（字符串）：要返回的控制台消息级别。每个级别包含更严重级别的消息，默认为“info”。\n    - `all`（布尔值，可选）：是否返回自会话开始以来的所有控制台消息，而不仅仅是自上次导航以来的消息，默认为假。\n    - `filename`（字符串，可选）：用于保存控制台消息的文件名。如果未提供，则以文本形式返回消息。\n  - 只读：**是**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_drag**\n  - 标题：拖动鼠标\n  - 描述：在两个元素之间执行拖放操作\n  - 参数：\n    - `startElement`（字符串）：用于获取与源元素交互权限的人类可读描述\n    - `startRef`（字符串）：页面快照中源元素的确切引用\n    - `startSelector`（字符串，可选）：当无法使用“ref”时，用于定位源元素的 CSS 或角色选择器\n    - `endElement`（字符串）：用于获取与目标元素交互权限的人类可读描述\n    - `endRef`（字符串）：页面快照中目标元素的确切引用\n    - `endSelector`（字符串，可选）：当无法使用“ref”时，用于定位目标元素的 CSS 或角色选择器\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_evaluate**\n  - 标题：评估 JavaScript\n  - 描述：在页面或元素上评估 JavaScript 表达式\n  - 参数：\n    - `function`（字符串）：() => { \u002F* 代码 *\u002F } 或 (element) => { \u002F* 代码 *\u002F }（当提供元素时）\n    - `element`（字符串，可选）：用于获取与元素交互权限的人类可读描述\n    - `ref`（字符串，可选）：页面快照中目标元素的确切引用\n    - `selector`（字符串，可选）：当无法使用“ref”时，用于定位目标元素的 CSS 或角色选择器\n    - `filename`（字符串，可选）：用于保存结果的文件名。如果未提供，结果将以文本形式返回。\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_file_upload**\n  - 标题：上传文件\n  - 描述：上传一个或多个文件\n  - 参数：\n    - `paths`（数组，可选）：要上传文件的绝对路径。可以是单个文件或多个文件。如果省略，则取消文件选择对话框。\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_fill_form**\n  - 标题：填写表单\n  - 描述：填写多个表单字段\n  - 参数：\n    - `fields`（数组）：要填充的字段\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_handle_dialog**\n  - 标题：处理对话框\n  - 描述：处理对话框\n  - 参数：\n    - `accept`（布尔值）：是否接受对话框\n    - `promptText`（字符串，可选）：如果是提示对话框，则输入提示文本\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_hover**\n  - 标题：悬停鼠标\n  - 描述：在页面上的元素上悬停\n  - 参数：\n    - `element`（字符串，可选）：用于获取与元素交互权限的人类可读描述\n    - `ref`（字符串）：页面快照中目标元素的确切引用\n    - `selector`（字符串，可选）：当无法使用“ref”时，用于定位目标元素的 CSS 或角色选择器\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_navigate**\n  - 标题：导航到 URL\n  - 描述：导航到指定的 URL\n  - 参数：\n    - `url`（字符串）：要导航到的 URL\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_navigate_back**\n  - 标题：返回\n  - 描述：返回到历史记录中的上一页\n  - 参数：无\n  - 只读：**否**\n\n\u003C!-- 注意：此部分由 update-readme.js 自动生成 -->\n\n- **browser_network_requests**\n  - 标题：列出网络请求\n  - 描述：返回自页面加载以来的所有网络请求\n  - 参数：\n    - `static`（布尔值）：是否包含成功的静态资源，如图片、字体、脚本等。默认为 false。\n    - `requestBody`（布尔值）：是否包含请求体。默认为 false。\n    - `requestHeaders`（布尔值）：是否包含请求头。默认为 false。\n    - `filter`（字符串，可选）：仅返回 URL 匹配此正则表达式的请求（例如：“\u002Fapi\u002F.*user”）。\n    - `filename`（字符串，可选）：用于保存网络请求的文件名。如果不提供，则以文本形式返回请求。\n  - 只读：**true**\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_press_key**\n  - 标题：按下按键\n  - 描述：在键盘上按下某个键\n  - 参数：\n    - `key`（字符串）：要按下的键名或要生成的字符，例如 `ArrowLeft` 或 `a`\n  - 只读：**false**\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_resize**\n  - 标题：调整浏览器窗口大小\n  - 描述：调整浏览器窗口的宽度和高度\n  - 参数：\n    - `width`（数字）：浏览器窗口的宽度\n    - `height`（数字）：浏览器窗口的高度\n  - 只读：**false**\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_run_code**\n  - 标题：运行 Playwright 代码\n  - 描述：执行一段 Playwright 代码\n  - 参数：\n    - `code`（字符串，可选）：包含 Playwright 代码的 JavaScript 函数，用于执行。该函数将被调用一次，传入一个参数 page，可用于与页面进行任何交互。例如：`async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }`\n    - `filename`（字符串，可选）：从指定文件加载代码。如果同时提供了 code 和 filename，则会忽略 code。\n  - 只读：**false**\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_select_option**\n  - 标题：选择选项\n  - 描述：在下拉菜单中选择一个选项\n  - 参数：\n    - `element`（字符串，可选）：用于获取与元素交互权限的人类可读元素描述\n    - `ref`（字符串）：来自页面快照的精确目标元素引用\n    - `selector`（字符串，可选）：当没有“ref”时，用于定位目标元素的 CSS 或角色选择器\n    - `values`（数组）：要在下拉菜单中选择的值列表。可以是单个值，也可以是多个值。\n  - 只读：**false**\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_snapshot**\n  - 标题：页面快照\n  - 描述：捕获当前页面的无障碍快照，这比截图更好\n  - 参数：\n    - `filename`（字符串，可选）：将快照保存为 Markdown 文件，而不是在响应中返回。\n    - `selector`（字符串，可选）：用于捕获部分页面快照而非整个页面的根元素选择器\n    - `depth`（数字，可选）：限制快照树的深度\n  - 只读：**true**\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_take_screenshot**\n  - 标题：截取屏幕截图\n  - 描述：截取当前页面的屏幕截图。你无法基于截图执行操作；若需执行操作，请使用 browser_snapshot。\n  - 参数：\n    - `type`（字符串）：截图的图像格式。默认为 png。\n    - `filename`（字符串，可选）：保存截图的文件名。如果不指定，默认为 `page-{timestamp}.{png|jpeg}`。建议使用相对路径，以确保文件位于输出目录内。\n    - `element`（字符串，可选）：用于获取对特定元素进行截图权限的人类可读元素描述。如果未提供，则对视口进行截图。如果提供了 element，则必须同时提供 ref。\n    - `ref`（字符串，可选）：来自页面快照的精确目标元素引用。如果未提供，则对视口进行截图。如果提供了 ref，则必须同时提供 element。\n    - `selector`（字符串，可选）：当没有“ref”时，用于定位目标元素的 CSS 或角色选择器\n    - `fullPage`（布尔值，可选）：如果为 true，则截取整个可滚动页面的截图，而不是当前可见的视口。不能与针对特定元素的截图同时使用。\n  - 只读：**true**\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_type**\n  - 标题：输入文本\n  - 描述：在可编辑元素中输入文本\n  - 参数：\n    - `element`（字符串，可选）：用于获取与元素交互权限的人类可读元素描述\n    - `ref`（字符串）：来自页面快照的精确目标元素引用\n    - `selector`（字符串，可选）：当没有“ref”时，用于定位目标元素的 CSS 或角色选择器\n    - `text`（字符串）：要输入到元素中的文本\n    - `submit`（布尔值，可选）：是否提交输入的文本（输入后按 Enter 键）\n    - `slowly`（布尔值，可选）：是否逐字符输入。这对于触发页面中的按键处理程序很有用。默认是一次性输入全部文本。\n  - 只读：**false**\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_wait_for**\n  - 标题：等待\n  - 描述：等待文本出现或消失，或者等待指定的时间过去\n  - 参数：\n    - `time`（数字，可选）：等待的时间，单位为秒\n    - `text`（字符串，可选）：要等待出现的文本\n    - `textGone`（字符串，可选）：要等待消失的文本\n  - 只读：**false**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>标签页管理\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_tabs**\n  - 标题：管理标签页\n  - 描述：列出、创建、关闭或选择浏览器标签页。\n  - 参数：\n    - `action`（字符串）：要执行的操作\n    - `index`（数字，可选）：标签页索引，用于关闭或选择。如果关闭时未指定索引，则关闭当前标签页。\n    - `url`（字符串，可选）：新标签页要导航到的 URL，用于新建标签页。\n  - 只读：**false**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>浏览器安装\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>配置（通过 --caps=config 开启）\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_get_config**\n  - 标题：获取配置\n  - 描述：获取在合并 CLI 选项、环境变量和配置文件后的最终解析配置。\n  - 参数：无\n  - 只读：**true**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>网络功能（通过 --caps=network 开启）\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注：此内容由 update-readme.js 自动生成 -->\n\n- **browser_network_state_set**\n  - 标题: 设置网络状态\n  - 描述: 将浏览器的网络状态设置为在线或离线。当处于离线状态时，所有网络请求都会失败。\n  - 参数:\n    - `state` (字符串): 设置为 \"offline\" 以模拟离线模式，设置为 \"online\" 以恢复网络连接\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_route**\n  - 标题: 模拟网络请求\n  - 描述: 设置一个路由来模拟匹配特定 URL 模式的网络请求\n  - 参数:\n    - `pattern` (字符串): 要匹配的 URL 模式（例如：`**\u002Fapi\u002Fusers`、`**\u002F*.{png,jpg}`）\n    - `status` (数字，可选): 要返回的 HTTP 状态码（默认值：200）\n    - `body` (字符串，可选): 响应体（文本或 JSON 字符串）\n    - `contentType` (字符串，可选): Content-Type 头信息（例如：`application\u002Fjson`、`text\u002Fhtml`）\n    - `headers` (数组，可选): 以 \"Name: Value\" 格式添加的头部信息\n    - `removeHeaders` (字符串，可选): 需要从请求中移除的头部名称列表，用逗号分隔\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_route_list**\n  - 标题: 列出网络路由\n  - 描述: 列出所有当前激活的网络路由\n  - 参数: 无\n  - 只读: **是**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_unroute**\n  - 标题: 移除网络路由\n  - 描述: 移除与指定模式匹配的网络路由（如果没有指定模式，则移除所有路由）\n  - 参数:\n    - `pattern` (字符串，可选): 要取消路由的 URL 模式（省略则移除所有路由）\n  - 只读: **否**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>存储功能（通过 --caps=storage 开启）\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_cookie_clear**\n  - 标题: 清除所有 Cookie\n  - 描述: 清除浏览器中的所有 Cookie\n  - 参数: 无\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_cookie_delete**\n  - 标题: 删除指定 Cookie\n  - 描述: 删除某个特定的 Cookie\n  - 参数:\n    - `name` (字符串): 要删除的 Cookie 名称\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_cookie_get**\n  - 标题: 获取指定 Cookie\n  - 描述: 根据 Cookie 名称获取特定的 Cookie\n  - 参数:\n    - `name` (字符串): 要获取的 Cookie 名称\n  - 只读: **是**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_cookie_list**\n  - 标题: 列出所有 Cookie\n  - 描述: 列出所有 Cookie（可选择按域名或路径过滤）\n  - 参数:\n    - `domain` (字符串，可选): 按域名过滤 Cookie\n    - `path` (字符串，可选): 按路径过滤 Cookie\n  - 只读: **是**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_cookie_set**\n  - 标题: 设置 Cookie\n  - 描述: 设置一个带有可选标志的 Cookie（域名、路径、过期时间、HttpOnly、Secure、SameSite）\n  - 参数:\n    - `name` (字符串): Cookie 名称\n    - `value` (字符串): Cookie 值\n    - `domain` (字符串，可选): Cookie 的域名\n    - `path` (字符串，可选): Cookie 的路径\n    - `expires` (数字，可选): Cookie 的过期时间，以 Unix 时间戳表示\n    - `httpOnly` (布尔值，可选): 是否将 Cookie 设置为 HttpOnly\n    - `secure` (布尔值，可选): 是否将 Cookie 设置为安全\n    - `sameSite` (字符串，可选): Cookie 的 SameSite 属性\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_localstorage_clear**\n  - 标题: 清空 localStorage\n  - 描述: 清空浏览器中的所有 localStorage 数据\n  - 参数: 无\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_localstorage_delete**\n  - 标题: 删除 localStorage 中的一项\n  - 描述: 删除 localStorage 中的某一项数据\n  - 参数:\n    - `key` (字符串): 要删除的键名\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_localstorage_get**\n  - 标题: 获取 localStorage 中的一项\n  - 描述: 根据键名获取 localStorage 中的一项数据\n  - 参数:\n    - `key` (字符串): 要获取的键名\n  - 只读: **是**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_localstorage_list**\n  - 标题: 列出所有 localStorage 数据\n  - 描述: 列出所有 localStorage 的键值对\n  - 参数: 无\n  - 只读: **是**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_localstorage_set**\n  - 标题: 设置 localStorage 中的一项\n  - 描述: 根据给定的键和值设置 localStorage 中的一项\n  - 参数:\n    - `key` (字符串): 要设置的键名\n    - `value` (字符串): 要设置的值\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_sessionstorage_clear**\n  - 标题: 清空 sessionStorage\n  - 描述: 清空浏览器中的所有 sessionStorage 数据\n  - 参数: 无\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_sessionstorage_delete**\n  - 标题: 删除 sessionStorage 中的一项\n  - 描述: 删除 sessionStorage 中的某一项数据\n  - 参数:\n    - `key` (字符串): 要删除的键名\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_sessionstorage_get**\n  - 标题: 获取 sessionStorage 中的一项\n  - 描述: 根据键名获取 sessionStorage 中的一项数据\n  - 参数:\n    - `key` (字符串): 要获取的键名\n  - 只读: **是**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_sessionstorage_list**\n  - 标题: 列出所有 sessionStorage 数据\n  - 描述: 列出所有 sessionStorage 的键值对\n  - 参数: 无\n  - 只读: **是**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_sessionstorage_set**\n  - 标题: 设置 sessionStorage 中的一项\n  - 描述: 根据给定的键和值设置 sessionStorage 中的一项\n  - 参数:\n    - `key` (字符串): 要设置的键名\n    - `value` (字符串): 要设置的值\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_set_storage_state**\n  - 标题: 恢复存储状态\n  - 描述: 从文件中恢复存储状态（Cookie、localStorage）。在恢复之前会清除现有的 Cookie 和 localStorage。\n  - 参数:\n    - `filename` (字符串): 要从中恢复存储状态的文件路径\n  - 只读: **否**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_storage_state**\n  - 标题: 保存存储状态\n  - 描述: 将存储状态（Cookie、localStorage）保存到文件中，以便日后使用\n  - 参数:\n    - `filename` (字符串，可选): 保存存储状态的文件名。如果未指定，则默认为 `storage-state-{timestamp}.json`\n  - 只读: **是**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>DevTools 功能（通过 --caps=devtools 开启）\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_resume**\n  - 标题: 恢复已暂停的脚本执行\n  - 描述: 在脚本被暂停后恢复执行。当 `step` 参数设置为 `true` 时，执行将在下一个操作之前再次暂停。\n  - 参数:\n    - `step` (布尔值，可选): 如果为 `true`, 执行将在下一个操作前再次暂停，以便进行逐步调试。\n    - `location` (字符串，可选): 在指定的 `\u003C文件>:\u003C行>` 处暂停执行，例如 `\"example.spec.ts:42\"`。\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_start_tracing**\n  - 标题: 开始跟踪\n  - 描述: 开始记录跟踪信息\n  - 参数: 无\n  - 只读: **true**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_start_video**\n  - 标题: 开始录制视频\n  - 描述: 开始录制视频\n  - 参数:\n    - `filename` (字符串，可选): 保存视频的文件名。\n    - `size` (对象，可选): 视频尺寸。\n  - 只读: **true**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_stop_tracing**\n  - 标题: 停止跟踪\n  - 描述: 停止记录跟踪信息\n  - 参数: 无\n  - 只读: **true**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_stop_video**\n  - 标题: 停止录制视频\n  - 描述: 停止录制视频\n  - 参数: 无\n  - 只读: **true**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_video_chapter**\n  - 标题: 视频章节\n  - 描述: 在视频录制中添加一个章节标记。显示带有模糊背景的全屏章节卡片。\n  - 参数:\n    - `title` (字符串): 章节标题\n    - `description` (字符串，可选): 章节描述\n    - `duration` (数字，可选): 显示章节卡片的持续时间（以毫秒为单位）\n  - 只读: **true**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>基于坐标的操作（通过 --caps=vision 开启）\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_mouse_click_xy**\n  - 标题: 点击\n  - 描述: 在指定位置点击鼠标按钮\n  - 参数:\n    - `x` (数字): X 坐标\n    - `y` (数字): Y 坐标\n    - `button` (字符串，可选): 要点击的按钮，默认为左键\n    - `clickCount` (数字，可选): 点击次数，默认为 1 次\n    - `delay` (数字，可选): 鼠标按下和松开之间的时间间隔（以毫秒为单位），默认为 0 毫秒\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_mouse_down**\n  - 标题: 按下鼠标\n  - 描述: 按下鼠标\n  - 参数:\n    - `button` (字符串，可选): 要按下的按钮，默认为左键\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_mouse_drag_xy**\n  - 标题: 拖动鼠标\n  - 描述: 将左键拖动到指定位置\n  - 参数:\n    - `startX` (数字): 起始 X 坐标\n    - `startY` (数字): 起始 Y 坐标\n    - `endX` (数字): 终点 X 坐标\n    - `endY` (数字): 终点 Y 坐标\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_mouse_move_xy**\n  - 标题: 移动鼠标\n  - 描述: 将鼠标移动到指定位置\n  - 参数:\n    - `x` (数字): X 坐标\n    - `y` (数字): Y 坐标\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_mouse_up**\n  - 标题: 松开鼠标\n  - 描述: 松开鼠标\n  - 参数:\n    - `button` (字符串，可选): 要松开的按钮，默认为左键\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_mouse_wheel**\n  - 标题: 滚动鼠标滚轮\n  - 描述: 滚动鼠标滚轮\n  - 参数:\n    - `deltaX` (数字): X 方向的滚动量\n    - `deltaY` (数字): Y 方向的滚动量\n  - 只读: **false**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>PDF 生成（通过 --caps=pdf 开启）\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_pdf_save**\n  - 标题: 另存为 PDF\n  - 描述: 将页面保存为 PDF\n  - 参数:\n    - `filename` (字符串，可选): 保存 PDF 的文件名。如果未指定，则默认为 `page-{timestamp}.pdf`。建议使用相对路径，以确保文件保存在输出目录内。\n  - 只读: **true**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>测试断言（通过 --caps=testing 开启）\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_generate_locator**\n  - 标题: 为元素创建定位器\n  - 描述: 为给定元素生成定位器，用于测试中\n  - 参数:\n    - `element` (字符串，可选): 人类可读的元素描述，用于获取与该元素交互的权限\n    - `ref` (字符串): 页面快照中目标元素的精确引用\n    - `selector` (字符串，可选): 目标元素的 CSS 或角色选择器，当没有 `ref` 时使用\n  - 只读: **true**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_verify_element_visible**\n  - 标题: 验证元素可见\n  - 描述: 验证元素是否在页面上可见\n  - 参数:\n    - `role` (字符串): 元素的角色。可在快照中找到类似以下内容：`- {ROLE} \"Accessible Name\":`\n    - `accessibleName` (字符串): 元素的可访问名称。可在快照中找到类似以下内容：`- role \"{ACCESSIBLE_NAME}\"`\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_verify_list_visible**\n  - 标题: 验证列表可见\n  - 描述: 验证列表是否在页面上可见\n  - 参数:\n    - `element` (字符串): 人类可读的列表描述\n    - `ref` (字符串): 指向列表的精确元素引用\n    - `selector` (字符串，可选): 目标列表的 CSS 或角色选择器，当没有 `ref` 时使用\n    - `items` (数组): 要验证的列表项\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_verify_text_visible**\n  - 标题: 验证文本可见\n  - 描述: 验证文本是否在页面上可见。如果可能，建议优先使用 `browser_verify_element_visible`。\n  - 参数:\n    - `text` (字符串): 要验证的文本。可在快照中找到类似以下内容：`- role \"Accessible Name\": {TEXT}` 或 `- text: {TEXT}`\n  - 只读: **false**\n\n\u003C!-- 注释: 此内容由 update-readme.js 自动生成 -->\n\n- **browser_verify_value**\n  - 标题: 验证元素值\n  - 描述: 验证元素的值\n  - 参数:\n    - `type` (字符串): 元素的类型\n    - `element` (字符串): 人类可读的元素描述\n    - `ref` (字符串): 页面快照中目标元素的精确引用\n    - `selector` (字符串，可选): 目标元素的 CSS 或角色选择器，当没有 `ref` 时使用\n    - `value` (字符串): 要验证的值。对于复选框，使用 `\"true\"` 或 `\"false\"`。\n  - 只读: **false**\n\n\u003C\u002Fdetails>\n\n\n\u003C!--- 工具生成部分结束 -->","# Playwright MCP 快速上手指南\n\nPlaywright MCP 是一个基于模型上下文协议（MCP）的服务器，它利用 Playwright 提供浏览器自动化能力。该工具允许大语言模型（LLM）通过结构化的无障碍快照（Accessibility Snapshots）与网页交互，无需依赖截图或视觉模型，具有轻量、确定性强且对 LLM 友好的特点。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **Node.js**: 版本 18 或更高。\n*   **MCP 客户端**: 已安装支持 MCP 协议的 AI 编程助手或终端工具，例如：\n    *   VS Code (需安装 Copilot 聊天功能)\n    *   Cursor\n    *   Windsurf\n    *   Claude Desktop\n    *   Goose\n    *   或其他兼容的 MCP 客户端。\n\n## 安装步骤\n\n您可以根据使用的客户端选择以下任一方式进行安装。核心命令均为通过 `npx` 运行 `@playwright\u002Fmcp@latest`。\n\n### 方式一：一键安装（推荐）\n\n如果您使用以下支持深链接安装的客户端，可直接点击按钮自动配置：\n\n*   **VS Code \u002F VS Code Insiders**: [点击安装](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%3A%5B%2522%2540playwright%252Fmcp%2540latest%2522%5D%257D)\n*   **Cursor**: [点击安装](https:\u002F\u002Fcursor.com\u002Fen\u002Finstall-mcp?name=Playwright&config=eyJjb21tYW5kIjoibnB4IEBwbGF5d3JpZ2h0L21jcEBsYXRlc3QifQ%3D%3D)\n*   **Goose**: [点击安装](https:\u002F\u002Fblock.github.io\u002Fgoose\u002Fextension?cmd=npx&arg=%40playwright%2Fmcp%40latest&id=playwright&name=Playwright&description=Interact%20with%20web%20pages%20through%20structured%20accessibility%20snapshots%20using%20Playwright)\n*   **LM Studio**: [点击安装](https:\u002F\u002Flmstudio.ai\u002Finstall-mcp?name=playwright&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAcGxheXdyaWdodC9tY3BAbGF0ZXN0Il19)\n*   **Kiro**: [点击安装](https:\u002F\u002Fkiro.dev\u002Flaunch\u002Fmcp\u002Fadd?name=playwright&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22%40playwright%2Fmcp%40latest%22%5D%7D)\n\n### 方式二：命令行安装\n\n对于支持 CLI 配置的工具，可直接运行以下命令添加服务：\n\n*   **Claude Code**:\n    ```bash\n    claude mcp add playwright npx @playwright\u002Fmcp@latest\n    ```\n*   **Codex**:\n    ```bash\n    codex mcp add playwright npx \"@playwright\u002Fmcp@latest\"\n    ```\n*   **Factory (Droid)**:\n    ```bash\n    droid mcp add playwright \"npx @playwright\u002Fmcp@latest\"\n    ```\n*   **VS Code (CLI 方式)**:\n    ```bash\n    code --add-mcp '{\"name\":\"playwright\",\"command\":\"npx\",\"args\":[\"@playwright\u002Fmcp@latest\"]}'\n    ```\n*   **Amp**:\n    ```bash\n    amp mcp add playwright -- npx @playwright\u002Fmcp@latest\n    ```\n\n### 方式三：手动配置文件安装\n\n如果您的客户端需要手动编辑 JSON 配置文件（如 `settings.json`, `mcp.json` 等），请添加以下标准配置块：\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n> **注意**：部分客户端（如 Cline, Copilot, Opencode）可能需要额外指定 `\"type\": \"stdio\"` 或 `\"type\": \"local\"`，请参考各自文档微调，但核心 `command` 和 `args` 保持不变。\n\n## 基本使用\n\n安装完成后，重启您的 AI 客户端或重新加载窗口以使配置生效。Playwright MCP 将自动作为工具提供给 AI 代理。\n\n### 使用示例\n\n您可以直接在聊天窗口中用自然语言指示 AI 操作浏览器。由于 Playwright MCP 基于结构化数据而非图像，描述应尽量侧重于页面元素的行为和结构。\n\n**场景 1：访问网页并提取信息**\n> “请打开 https:\u002F\u002Fexample.com，读取页面的主标题，并告诉我页面上有哪些主要的导航链接。”\n\n**场景 2：执行交互操作**\n> “访问 https:\u002F\u002Fhttpbin.org\u002Fforms\u002Fpost，在表单中找到 'custname' 输入框，填入 'John Doe'，然后点击提交按钮，告诉我提交后的响应内容。”\n\n**场景 3：调试与探索**\n> “帮我分析一下当前页面的无障碍树结构，找出所有可点击的按钮元素。”\n\n### 进阶配置（可选）\n\n如果需要限制服务器访问的主机或允许非工作区文件访问，可以在配置文件的 `args` 列表中添加参数：\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright\u002Fmcp@latest\",\n        \"--allowed-hosts\", \"*\",\n        \"--allow-unrestricted-file-access\"\n      ]\n    }\n  }\n}\n```\n\n*   `--allowed-hosts`: 设置允许服务的主机列表，默认为绑定主机，设为 `*` 可禁用检查。\n*   `--allow-unrestricted-file-access`: 允许访问工作区根目录以外的文件及 `file:\u002F\u002F` URL。","某电商平台的测试工程师需要让 AI 助手自动执行复杂的“用户注册并验证优惠券领取”流程，且需在不同分辨率下反复运行以排查偶发性故障。\n\n### 没有 playwright-mcp 时\n- **依赖视觉模型成本高**：必须调用昂贵的多模态大模型分析截图，不仅响应慢，还极易因页面广告或加载动画等视觉噪点导致判断失误。\n- **上下文窗口迅速耗尽**：每次交互都需传输高清图片，巨大的 Token 消耗使得长流程任务（如跨多页操作）难以在有限的上下文窗口内完成。\n- **操作缺乏确定性**：基于图像识别的点击坐标存在偏差，AI 经常点错按钮或无法精准定位动态生成的表单元素，导致脚本频繁中断。\n- **调试与自愈困难**：当流程失败时，AI 只能看到静态图片，无法深入理解页面 DOM 结构的变化，难以自主分析原因并修复测试逻辑。\n\n### 使用 playwright-mcp 后\n- **纯结构化数据驱动**：playwright-mcp 直接提供页面的无障碍树（Accessibility Tree），AI 仅需处理轻量级文本数据即可精准识别元素，彻底告别对视觉模型的依赖。\n- **Token 效率显著提升**：摒弃了冗余的图片传输，仅交换关键结构信息，使得 AI 能在同一会话中流畅执行长达数十步的复杂业务闭环。\n- **操作精准且可复现**：基于语义化的元素定位替代了模糊的坐标点击，确保无论页面如何微调布局，AI 都能稳定锁定目标控件，消除执行歧义。\n- **具备深度自愈能力**：遇到报错时，AI 可通过 playwright-mcp 实时 introspect（内省）页面状态变化，自主推导失败原因并动态调整后续操作步骤。\n\nplaywright-mcp 通过将浏览器自动化转化为高效的结构性对话，让 AI 代理具备了低成本、高可靠且能自我修复的长期网页任务执行能力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_playwright-mcp_44b1ba07.png","microsoft","Microsoft","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmicrosoft_4900709c.png","Open source projects and samples from Microsoft",null,"opensource@microsoft.com","OpenAtMicrosoft","https:\u002F\u002Fopensource.microsoft.com","https:\u002F\u002Fgithub.com\u002Fmicrosoft",[85,89,93,97,101],{"name":86,"color":87,"percentage":88},"TypeScript","#3178c6",56.1,{"name":90,"color":91,"percentage":92},"CSS","#663399",32.8,{"name":94,"color":95,"percentage":96},"JavaScript","#f1e05a",8.4,{"name":98,"color":99,"percentage":100},"Dockerfile","#384d54",1.7,{"name":102,"color":103,"percentage":104},"HTML","#e34c26",0.9,30243,2446,"2026-04-04T04:36:48","Apache-2.0","未说明","不需要 GPU",{"notes":112,"python":113,"dependencies":114},"该工具基于 Node.js 运行，无需 Python 环境或 GPU 支持。需要安装 Node.js 18 或更高版本。需配合支持 MCP 协议的客户端使用（如 VS Code, Cursor, Claude Desktop, Windsurf, Goose 等）。默认情况下文件系统访问受限，仅允许访问工作区根目录，如需访问外部文件需添加特定启动参数。","不需要 Python",[115,116,117],"Node.js 18+","npx","@playwright\u002Fmcp@latest",[15,45],[120,121],"mcp","playwright",4,"2026-03-27T02:49:30.150509","2026-04-06T05:27:14.260242",[126,131,136,141,146,151],{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},14437,"使用 browser_take_screenshot 工具时遇到 API 400 错误（图片媒体类型不匹配），导致对话永久中断，如何解决？","该问题通常是由于客户端（如 Claude Code）在发送图片给 LLM 之前进行了转换并错误标记了图片格式导致的。解决方案包括：\n1. 升级客户端版本：该问题在 Claude Code 2.0.55 及更高版本中已不再出现。\n2. 确认服务端版本：确保 Playwright MCP 服务器运行的是最新稳定版。\n3. 如果问题依旧，尝试清除对话上下文（如使用 \u002Fclear 命令）作为临时变通方案，但会丢失当前会话历史。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fissues\u002F1211",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},14438,"启动 Playwright MCP 时提示\"Browser is already in use\"（浏览器已被占用）错误，如何配置以支持多实例并行运行？","需要在启动配置中添加 `--isolated` 参数来允许运行多个浏览器实例。具体配置方法取决于你使用的 IDE 或 MCP 配置文件（如 mcp.json）。\n示例配置（在 mcp.json 中）：\n```json\n\"github.com\u002Fexecuteautomation\u002Fmcp-playwright\": {\n  \"command\": \"npx\",\n  \"args\": [\"-y\", \"@executeautomation\u002Fplaywright-mcp-server\", \"--isolated\"],\n  \"disabled\": false,\n  \"autoApprove\": []\n}\n```\n将 `--isolated` 添加到原始 Playwright MCP 的参数配置中即可解决浏览器实例冲突问题。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fissues\u002F769",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},14439,"Playwright MCP 是否支持类似 Playwright Codegen 的功能，以便记录操作并生成测试代码？","目前官方 Playwright MCP 尚未内置完整的 Codegen UI 功能，但社区有强烈需求。现有的 `browser_generate_playwright_test` 工具生成的代码可能不够精确，会跳过部分选择器。\n变通方案与建议：\n1. 使用独立的 Playwright Codegen 工具录制操作，然后手动整合到 MCP 工作流中。\n2. 结合 GitHub Copilot 等 AI 助手，通过观察 Codegen UI 的操作来辅助生成测试代码。\n3. 可以配置 VS Code 的 `settings.json`，让 Copilot 在生成代码时遵循项目特定的指令文件（instructions），以提高生成代码的可用性。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fissues\u002F519",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},14440,"在使用 snapshot 工具时，为什么某些可见元素（如 visibility: hidden > visible 结构）没有被包含在快照中？","这是一个已知的上游 Playwright Bug，特定 DOM 结构（父元素隐藏但子元素显示）在某些版本中未被正确捕获到快照中。\n解决方案：\n1. 等待更新：维护者已确认上游 Playwright 修复了此问题，需要等待 Playwright MCP 拉取该更新。\n2. 临时方案：尝试升级 Playwright MCP 到最新版本，或者检查是否有可用的 nightly 构建版本包含了该修复。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fissues\u002F535",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},14441,"运行自动生成的 seed.spec.ts 测试文件时，报错\"Playwright Test did not expect test.describe() to be called here\"，如何解决？","该错误通常是因为测试文件结构不符合 Playwright Test 的预期，或者是 VS Code 插件与 Playwright 版本兼容性问题。\n建议步骤：\n1. 检查文件结构：确保 `test.describe` 和 `test` 的导入和使用方式正确。有时移除外层的 `describe` 块或调整缩进可解决问题。\n2. 验证环境：确保安装的 `@playwright\u002Ftest` 版本与 VS Code 插件版本兼容。\n3. 目录结构：确认项目根目录下是否存在正确的配置文件（如 playwright.config.ts），并且测试文件位于配置的测试目录中（有时缺少 specs 文件夹会导致路径解析错误）。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fissues\u002F1141",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},14442,"在 Power Apps 或 Dynamics 365 页面上使用 Snapshot 工具时，为什么只能捕获到 IFrames 而看不到具体内容？","Power Apps 和 Dynamics 365 大量使用复杂的 Shadow DOM 和嵌套 IFrames，这可能导致标准的 Snapshot 工具无法正确穿透并捕获内部内容。\n建议方案：\n1. 显式切换 Frame：在使用快照前，先使用 `browser_click` 或其他导航工具显式进入目标 iframe 上下文。\n2. 等待加载：确保在捕获快照前有充足的等待时间（如 3-5 秒），让动态内容完全渲染。\n3. 替代方案：如果快照始终不可用，考虑直接使用 `browser_take_screenshot` 获取整页截图作为视觉参考，而不是依赖 DOM 快照。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fissues\u002F447",[157,162,167,172,177,182,187,192,197,202,207,212,217,222,227,232,237,242,247,252],{"id":158,"version":159,"summary_zh":160,"released_at":161},81316,"v0.0.70","- 1.59 分支点的维护版本","2026-04-01T00:17:07",{"id":163,"version":164,"summary_zh":165,"released_at":166},81317,"v0.0.69","## 新增功能\n\n### 新工具\n\n- **`browser_network_state_set`** — 切换网络离线模式，用于测试连接性场景 ([#39459](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39459))\n- **`browser_video_chapter`** — 在视频录制中添加章节标记，显示带有模糊背景的全屏章节卡片 ([#39891](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39891))\n\n### 工具改进\n\n- **`browser_mouse_click_xy`** — 新增 `button`、`clickCount` 和 `delay` 选项，以实现更精确的鼠标交互控制 ([#39368](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39368), [#39465](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39465))\n- **`browser_network_requests`** — 增加了过滤支持，并在响应中可选包含 `headers` 和 `body` 字段 ([#39672](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39672))\n- **非引用选择器** — 工具现在除了接受 aria-ref 句柄外，也支持直接使用 CSS 或文本选择器 ([#39581](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39581))\n\n### 其他变更\n\n- 为软件包添加了 `mcpName` 字段，用于 MCP 注册表的所有权验证 ([#1432](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fpull\u002F1432))\n- Chrome 扩展：将公钥注入发布压缩包中，以保留 Web Store 扩展 ID ([#1462](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fpull\u002F1462))\n\n## 错误修复\n\n- 修复了验证工具在 iframe 内无法正常工作的问题 ([#39374](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39374))\n- 修复了基于文件系统的锁文件未被 Chromium 系列浏览器尊重的问题 ([#39377](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39377))\n- 修复了在设置 `--snapshot-mode=none` 时控制台输出仍会被打印的问题 ([#39378](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39378))\n- 修复了由于 contextmenu 和 mouseup 事件顺序导致的右键行为不确定问题 ([#39416](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39416))\n- 修复了当头部字段值中包含冒号时的解析错误 ([#39401](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39401))\n- 修复了持久化上下文错误地使用会话隔离的问题 ([#39601](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39601))\n- 修复了导航协议白名单被替换为黑名单以提高覆盖率的问题 ([#39600](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39600))\n- 修复了 MCP 工具响应中出现格式不正确的 Unicode 字符的问题 ([#39625](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39625))\n- 修复了 `toWellFormed()` 与 Node.js 18 不兼容的问题 ([#39674](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39674))\n- 修复了来自环境变量的空 `cdpHeaders` 覆盖配置文件中设置的问题 ([#39866](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39866))\n- 修复了 `browser_set_storage_state` 工具中文件路径验证的错误 ([#39881](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39881))\n- 修复了浏览器扩展中“Chrome for Testing”可执行文件路径解析的问题 ([#39936](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F39936))\n- 修复了扩展程序的非活动计时器未对等待中的标签页启动的问题 ([#1443](https:\u002F\u002Fgithub.c","2026-03-30T23:56:25",{"id":168,"version":169,"summary_zh":170,"released_at":171},81318,"v0.0.68","### 快速跟进的 bug 修复\n\n- 撤销 `--no-sandbox` 重命名为 `--no-chromium-sandbox` 的更改。  \n  CLI 标志名称已恢复为 `--no-sandbox`。","2026-02-14T23:17:47",{"id":173,"version":174,"summary_zh":175,"released_at":176},81319,"v0.0.67","### 扩展程序\n\n- **我们的 Google Chrome 扩展程序现已上架 Chrome 网上应用店**：  \n  [Playwright MCP Bridge](https:\u002F\u002Fchromewebstore.google.com\u002Fdetail\u002Fplaywright-mcp-bridge\u002Fmmlmfjhmonkocbjadbfplnigmagldckm)\n\n### 错误修复\n\n- 将 `--[no-]sandbox` 重命名为 `--[no-]chromium-sandbox`，以提高清晰度并避免与其他浏览器的混淆。","2026-02-14T02:36:51",{"id":178,"version":179,"summary_zh":180,"released_at":181},81320,"v0.0.64","### 🕶️ 默认无痕模式\n\n浏览器配置文件现在默认存储在内存中——每次会话都会从干净的状态开始，不会留下任何残留状态。\n\n使用 `--persistent` 可以启用持久化配置文件，或者使用 `--profile=\u003Cpath>` 指定自定义的配置文件目录：\n\n```sh\n> playwright-cli open example.com                       # 无痕模式，全新环境\n> playwright-cli open example.com --persistent          # 持久化配置文件\n> playwright-cli open example.com --profile=.\u002Fmy-data   # 自定义配置文件目录\n```\n\n---\n\n### 🔀 简化的会话管理\n\n`--session` 标志已被更短的 `-s=` 替代。会话生命周期也得到了简化——不再有“已停止”状态；会话要么正在运行，要么已经结束。\n\n```sh\n> playwright-cli -s=myapp open example.com\n> playwright-cli -s=myapp click e5\n> playwright-cli -s=myapp close\n> playwright-cli -s=myapp delete-data\n```\n\n新的会话管理命令取代了旧的 `session-*` 系列命令：\n\n```sh\n> playwright-cli list        # 列出所有会话\n> playwright-cli close-all   # 关闭所有浏览器\n> playwright-cli kill-all    # 强制终止所有浏览器进程\n```\n\n---\n\n### 🏗️ 工作区范围的守护进程\n\n每个工作区现在都有自己的守护进程，从而避免不同项目之间的干扰，并支持直接启动守护进程，以实现更快、更可靠的运行。","2026-02-06T01:15:13",{"id":183,"version":184,"summary_zh":185,"released_at":186},81321,"v0.0.63","### 🗄️ 浏览器存储与认证状态控制\n\n对浏览器存储进行全面的检查和操作，支持可复现的认证流程、调试以及带状态的自动化。\n\n```sh\n> playwright-cli state-save auth.json\n> playwright-cli state-load auth.json\n```\n\n检查和管理 Cookie：\n\n```sh\n> playwright-cli cookie-list\n> playwright-cli cookie-get session_id\n> playwright-cli cookie-set session_id abc123 --domain=example.com\n> playwright-cli cookie-delete session_id\n> playwright-cli cookie-clear\n```\n\n直接使用 Web Storage API：\n\n```sh\n# LocalStorage\n> playwright-cli localstorage-list\n> playwright-cli localstorage-get theme\n> playwright-cli localstorage-set theme dark\n> playwright-cli localstorage-clear\n\n# SessionStorage\n> playwright-cli sessionstorage-list\n> playwright-cli sessionstorage-set wizardStep 3\n> playwright-cli sessionstorage-clear\n```\n\n非常适合以下场景：\n\n* 保持登录会话\n* 调试认证和功能标志\n* 在多次运行之间共享可复现的浏览器状态\n\n---\n### 🌐 强大的网络与 API 请求模拟\n\n直接通过 CLI 拦截、模拟、修改或阻止网络请求——无需测试框架。\n\n#### 基于 CLI 的简单请求模拟\n\n根据 URL 模式模拟响应，自定义状态码、响应体、头部或请求变更。\n\n```sh\n# 使用自定义状态码进行模拟\n> playwright-cli route \"**\u002F*.jpg\" --status=404\n\n# 使用 JSON 响应体进行模拟\n> playwright-cli route \"**\u002Fapi\u002Fusers\" \\\n    --body='[{\"id\":1,\"name\":\"Alice\"}]' \\\n    --content-type=application\u002Fjson\n\n# 使用自定义头部进行模拟\n> playwright-cli route \"**\u002Fapi\u002Fdata\" \\\n    --body='{\"ok\":true}' \\\n    --header=\"X-Custom: value\"\n\n# 剥离传出请求中的敏感头部\n> playwright-cli route \"**\u002F*\" --remove-header=cookie,authorization\n```\n\n管理当前生效的路由：\n\n```sh\n> playwright-cli route-list\n> playwright-cli unroute \"**\u002F*.jpg\"\n> playwright-cli unroute\n```\n\n适用场景：\n\n* 在没有后端的情况下进行前端开发\n* 离线和错误状态测试\n* 提高快照稳定性与渲染确定性\n\n#### 灵活的 URL 模式匹配\n\n路由支持通配符风格的模式，实现精准匹配：\n\n```sh\n**\u002Fapi\u002Fusers           完全路径匹配\n**\u002Fapi\u002F*\u002Fdetails       路径中的通配符\n**\u002F*.{png,jpg,jpeg}    文件扩展名匹配\n**\u002Fsearch?q=*          查询参数匹配\n```\n\n---\n\n### 🧠 使用 `run-code` 进行高级请求处理\n\n对于条件逻辑、请求检查、响应修改或时间控制，可以使用 `run-code` 直接调用 Playwright 的底层路由功能。\n\n#### 根据请求数据返回不同响应\n\n```sh\n> playwright-cli run-code \"async page => {\n  await page.route('**\u002Fapi\u002Flogin', route => {\n    const body = route.request().postDataJSON();\n    if (body.username === 'admin') {\n      route.fulfill({ body: JSON.stringify({ token: 'mock-token' }) });\n    } else {\n      route.fulfill({ status: 401, body: JSON.stringify({ error: '无效' }) });\n   ","2026-02-04T00:02:29",{"id":188,"version":189,"summary_zh":190,"released_at":191},81322,"v0.0.62","Playwright CLI 的基础设施已经就位，我们现在可以着手开发各项功能和技能了！\n\n### ⚡ 超快速的 Playwright CLI 可执行文件（http:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli）\n\n```sh\n> playwright-cli open example.com\n> time playwright-cli snapshot\n0.03s user 0.01s system cpu 0.055 total\n```\n\n### 🎥 按需视频录制\n\n```sh\n> playwright-cli video-start\n> playwright-cli open playwright.dev\n> playwright-cli video-stop\n### 结果\n- [视频](.playwright-cli\u002Fvideo-2026-01-31T00-49-47-976Z.webm)\n```\n\n此外，在 Playwright MCP 中也可通过 `--caps=devtools` 标志实现此功能。\n\n### 🔧 持久化会话配置\n\n```sh\n> playwright-cli config --headed --config=config.json\n> playwright-cli open playwright.dev\n```\n\n还有无数[配置选项](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fblob\u002Fmain\u002Fpackages\u002Fplaywright-mcp\u002Fconfig.d.ts)可供选择。\n\n### ☁️ 隔离的（临时的）浏览器上下文、非 Chromium 浏览器快捷方式\n\n```sh\n> playwright-cli install --browser=firefox\n> playwright-cli config --isolated --browser=firefox --headed\n> playwright-cli open playwright.dev \n```\n\n### 🔌 Playwright Chrome 扩展 + Playwright CLI = ❤️\n\n- 安装 Playwright 浏览器[扩展](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002FREADME.md)\n```sh\n> playwright-cli --session=real-browser snapshot --extension\n```\n分享标签页，尽情享受吧！","2026-01-31T01:37:28",{"id":193,"version":194,"summary_zh":195,"released_at":196},81323,"v0.0.61","- 内部：发布“mcp”二进制文件，并将其作用域限定为 NPX 环境中的 Playwright。","2026-01-26T22:55:25",{"id":198,"version":199,"summary_zh":200,"released_at":201},81324,"v0.0.60","### 错误修复\n- 修复 Windows 命令行界面","2026-01-26T18:35:29",{"id":203,"version":204,"summary_zh":205,"released_at":206},81325,"v0.0.59","# 全功能 Playwright CLI 配置：\n- 支持 `playwright-cli.json` 配置文件\n- 支持环境配置\n- 支持非 Chrome 浏览器\n- 更多信息请参阅 [https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli)\n\n## 📣 Playwright CLI\n\n我们正在为 Playwright 添加一种新的、更节省 Token 的 CLI 操作模式，相关技能位于 [playwright-cli](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli)。这为我们带来了期待已久的官方 SKILL 专注型 CLI 模式，使其更加适合编码代理使用。\n\n> 这是首个包含基础命令集的快照（其数量已超过原始 MCP！），但我们预计它会迅速扩展。与 Token 使用不同的是，由于不再强制将快照输入 LLM，我们预计 Token 使用量将会下降！\n\n## 安装\n\n```bash\nnpm install -g @playwright\u002Fmcp@latest\nplaywright-cli --help\n```\n\n## 示例\n\n您的代理可能会运行这些命令，但这并不意味着您不能亲自试用：\n\n```bash\nplaywright-cli open https:\u002F\u002Fdemo.playwright.dev\u002Ftodomvc\u002F --headed\nplaywright-cli type \"Buy groceries\"\nplaywright-cli press Enter\nplaywright-cli type \"Water flowers\"\nplaywright-cli press Enter\nplaywright-cli check e21\nplaywright-cli check e35\nplaywright-cli press screenshot\n```\n\n### 无技能操作\n\n只需让您的代理指向 CLI，它就会自动执行。它会自行从 `playwright-cli --help` 中读取可用技能：\n\n```bash\n在 https:\u002F\u002Fdemo.playwright.dev\u002Ftodomvc 上使用 playwright-cli 测试“添加待办事项”流程。\n请查看 playwright-cli --help 以获取可用命令。\n```\n\n### 安装技能\n\nClaude Code、GitHub Copilot 等工具可以让您将 Playwright 技能安装到代理循环中。\n\n#### 插件方式（推荐）\n```bash\n\u002Fplugin marketplace add microsoft\u002Fplaywright-cli\n\u002Fplugin install playwright-cli\n```\n\n#### 手动方式\n```bash\nmkdir -p .claude\u002Fskills\u002Fplaywright-cli\ncurl -o .claude\u002Fskills\u002Fplaywright-cli\u002FSKILL.md \\\n  https:\u002F\u002Fraw.githubusercontent.com\u002Fmicrosoft\u002Fplaywright-cli\u002Fmain\u002Fskills\u002Fplaywright-cli\u002FSKILL.md\n```\n\n## 带界面操作\n\nPlaywright CLI 默认以无头模式运行。如果您希望看到浏览器界面，请在 `open` 命令中添加 `--headed` 参数：\n\n```bash\nplaywright-cli open https:\u002F\u002Fplaywright.dev --headed\n```\n\n## 会话\n\nPlaywright CLI 默认使用专用的持久化配置文件。这意味着您的 Cookie 和其他存储状态将在多次调用之间保持不变。您可以使用会话为不同的项目启动不同的浏览器实例。\n\n以下命令将启动两个具有独立配置文件的浏览器。通过在调用中添加 `--session` 参数，您可以指定与哪个浏览器进行交互：\n\n```bash\nplaywright-cli open https:\u002F\u002Fplaywright.dev\nplaywright-cli --session=example open https:\u002F\u002Fexample.com\nplaywright-cli session-list\n```\n\n您也可以通过设置 `PLAYWRIGHT_CLI_SESSION` 环境变量来运行您的编码代理：\n\n```bash\nPLAYWRIGHT_CLI_SESSION=todo-app claude .\n```\n\n或者指示它在每次调用前自动添加 `--ses","2026-01-25T19:24:04",{"id":208,"version":209,"summary_zh":210,"released_at":211},81326,"v0.0.58","## 📣 Playwright CLI\r\n\r\nWe are adding a new token-efficient CLI mode of operation to Playwright with the skills located at [playwright-cli](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli). This brings the long-awaited official SKILL-focused CLI mode to our story and makes it more coding agent-friendly.\r\n\r\n> It is the first snapshot with the essential command set (which is already larger than the original MCP!), but we expect it to grow rapidly. Unlike the token use, that one we expect to go down since snapshots are no longer forced into the LLM!\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install -g @playwright\u002Fmcp@latest\r\nplaywright-cli --help\r\n```\r\n\r\n## Demo\r\n\r\nYour agent will be running those, but it does not mean you can't play with it:\r\n\r\n```\r\nplaywright-cli open https:\u002F\u002Fdemo.playwright.dev\u002Ftodomvc\u002F --headed\r\nplaywright-cli type \"Buy groceries\"\r\nplaywright-cli press Enter\r\nplaywright-cli type \"Water flowers\"\r\nplaywright-cli press Enter\r\nplaywright-cli check e21\r\nplaywright-cli check e35\r\nplaywright-cli press screenshot\r\n```\r\n\r\n### Skills-less operation\r\n\r\nPoint your agent at the CLI and let it cook. It'll read the skill off `playwright-cli --help` on its own:\r\n\r\n```\r\nTest the \"add todo\" flow on https:\u002F\u002Fdemo.playwright.dev\u002Ftodomvc using playwright-cli.\r\nCheck playwright-cli --help for available commands.\r\n```\r\n\r\n### Installing skills\r\n\r\nClaude Code, GitHub copilot and others will let you install the Playwright skills into the agentic loop.\r\n\r\n#### plugin (recommended)\r\n```bash\r\n\u002Fplugin marketplace add microsoft\u002Fplaywright-cli\r\n\u002Fplugin install playwright-cli\r\n```\r\n\r\n#### manual\r\n\r\n```bash\r\nmkdir -p .claude\u002Fskills\u002Fplaywright-cli\r\ncurl -o .claude\u002Fskills\u002Fplaywright-cli\u002FSKILL.md \\\r\n  https:\u002F\u002Fraw.githubusercontent.com\u002Fmicrosoft\u002Fplaywright-cli\u002Fmain\u002Fskills\u002Fplaywright-cli\u002FSKILL.md\r\n```\r\n\r\n## Headed operation\r\n\r\nPlaywright CLI is headless by default. If you'd like to see the browser, pass `--headed` to `open`:\r\n\r\n```bash\r\nplaywright-cli open https:\u002F\u002Fplaywright.dev --headed\r\n```\r\n\r\n## Sessions\r\n\r\nPlaywright CLI will use a dedicated persistent profile by default. It means that\r\nyour cookies and other storage state will be preserved between the calls. You can use different\r\ninstances of the browser for different projects with sessions.\r\n\r\nFollowing will result in two browsers with separate profiles being available. Pass `--session` to\r\nthe invocation to talk to a specific browser.\r\n\r\n```bash\r\nplaywright-cli open https:\u002F\u002Fplaywright.dev\r\nplaywright-cli --session=example open https:\u002F\u002Fexample.com\r\nplaywright-cli session-list\r\n```\r\n\r\nYou can run your coding agent with the `PLAYWRIGHT_CLI_SESSION` environment variable:\r\n\r\n```bash\r\nPLAYWRIGHT_CLI_SESSION=todo-app claude .\r\n```\r\n\r\nOr instruct it to prepend `--session` to the calls.\r\n\r\nManage your sessions as follows:\r\n\r\n```bash\r\nplaywright-cli session-list             # list all sessions\r\nplaywright-cli session-stop [name]      # stop session\r\nplaywright-cli session-stop-all         # stop all sessions\r\nplaywright-cli session-delete [name]    # delete session data along with the profiles\r\n```\r\n\r\n\r\n## Commands\r\n\r\n### Core\r\n\r\n```bash\r\nplaywright-cli open \u003Curl>               # open url\r\nplaywright-cli close                    # close the page\r\nplaywright-cli type \u003Ctext>              # type text into editable element\r\nplaywright-cli click \u003Cref> [button]     # perform click on a web page\r\nplaywright-cli dblclick \u003Cref> [button]  # perform double click on a web page\r\nplaywright-cli fill \u003Cref> \u003Ctext>        # fill text into editable element\r\nplaywright-cli drag \u003CstartRef> \u003CendRef> # perform drag and drop between two elements\r\nplaywright-cli hover \u003Cref>              # hover over element on page\r\nplaywright-cli select \u003Cref> \u003Cval>       # select an option in a dropdown\r\nplaywright-cli upload \u003Cfile>            # upload one or multiple files\r\nplaywright-cli check \u003Cref>              # check a checkbox or radio button\r\nplaywright-cli uncheck \u003Cref>            # uncheck a checkbox or radio button\r\nplaywright-cli snapshot                 # capture page snapshot to obtain element ref\r\nplaywright-cli eval \u003Cfunc> [ref]        # evaluate javascript expression on page or element\r\nplaywright-cli dialog-accept [prompt]   # accept a dialog\r\nplaywright-cli dialog-dismiss           # dismiss a dialog\r\nplaywright-cli resize \u003Cw> \u003Ch>           # resize the browser window\r\n```\r\n\r\n### Navigation\r\n\r\n```bash\r\nplaywright-cli go-back                  # go back to the previous page\r\nplaywright-cli go-forward               # go forward to the next page\r\nplaywright-cli reload                   # reload the current page\r\n```\r\n\r\n### Keyboard\r\n\r\n```bash\r\nplaywright-cli press \u003Ckey>              # press a key on the keyboard, `a`, `arrowleft`\r\nplaywright-cli keydown \u003Ckey>            # press a key down on the keyboard\r\nplaywright-cli keyup \u003Ckey>              # press a key up on the keyboard\r\n```\r\n\r\n### Mouse\r\n\r\n```bash\r\nplaywright-cli mousemove \u003Cx> \u003Cy>        # move mouse to a given position\r\nplaywright-cli mousedown [button]      ","2026-01-24T01:19:21",{"id":213,"version":214,"summary_zh":215,"released_at":216},81327,"v0.0.57","## Prep for v0.0.58","2026-01-24T00:10:39",{"id":218,"version":219,"summary_zh":220,"released_at":221},81328,"v0.0.56","### Features\r\n- Added `cdpTimeout` configuration option for CDP connections, allowing control over connection timeouts (default: 30s, `0` disables timeout).\r\n\r\n### Fixes\r\n- Improved error handling when browser launch fails:\r\n  - Clearer messaging when the browser profile is already in use (including Windows-specific exit cases).\r\n  - Better diagnostics for missing system dependencies, with a suggestion to run `playwright install-deps`.\r\n\r\n","2026-01-16T18:50:04",{"id":223,"version":224,"summary_zh":225,"released_at":226},81329,"v0.0.55","### 🔐 Security & Safety\r\n- MCP now enforces **protocol and filesystem access restrictions by default**:\r\n  - Browser navigation and API requests are limited to `http:`, `https:`, `about:`, and `data:` URLs; `file:\u002F\u002F` is blocked.\r\n  - File uploads (`setInputFiles`, file choosers, MCP file tools) are restricted to **workspace root directories** (or `cwd` if no roots are configured).\r\n- Added `--allow-unrestricted-file-access` (and `allowUnrestrictedFileAccess` config) to explicitly opt out, allowing:\r\n  - Access to files outside workspace roots.\r\n  - Navigation and requests to `file:\u002F\u002F` URLs.\r\n\r\n### 📁 Artifacts & Output\r\n- MCP-recorded videos are now saved under `outputDir\u002Fvideos`\r\n","2026-01-09T22:18:22",{"id":228,"version":229,"summary_zh":230,"released_at":231},81330,"v0.0.54","## Bug Fixes\r\n\r\n- MCP extension now only connects to MCP server running on the same machine (https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F38626)\r\n","2025-12-29T19:03:26",{"id":233,"version":234,"summary_zh":235,"released_at":236},81331,"v0.0.53","## Bug Fixes\r\n\r\n- Fixed persistence of `saveVideo` in configs (https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F38621)\r\n- Fixed issue with empty snapshots sometimes written into .md files  (https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F38583)\r\n- Removed 50 MB upload limit when uploading files in the Playwright extension (https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fpull\u002F38614)-\r\n","2025-12-20T02:32:48",{"id":238,"version":239,"summary_zh":240,"released_at":241},81332,"v0.0.52","### Highlights\r\n\r\n- **browser_run_code** now takes a function and supports `return` statements.\r\n- **browser_snapshot** now accepts an optional `filename` parameter. When provided, the snapshot is saved to disk and a link appears in the Files section. This avoids inlining large snapshots and keeps MCP payloads smaller.","2025-12-11T19:01:51",{"id":243,"version":244,"summary_zh":245,"released_at":246},81333,"v0.0.51","### New config options\r\n\r\n- `--console-level=\u003C'error' | 'warning' | 'info' | 'debug'>` configure the console severity level that is included in the replies. Defaults to 'info'.\r\n- `--snapshot=\u003C'incremental' | 'full' | 'none'>` configure snapshot output mode. Defaults to 'incremental'.\r\n\r\n### New params\r\n- **browser_console_messages** now accepts  `{ level: 'error' | 'warning' | 'info' | 'debug' }` to include messages up to the given severity level.\r\n- **browser_network_requests** no longer returns successfully downloaded static resources by default, pass `{ includeStatic: boolean }` to include them.","2025-12-08T16:13:53",{"id":248,"version":249,"summary_zh":250,"released_at":251},81334,"v0.0.50","### Maintenance release","2025-12-05T21:25:08",{"id":253,"version":254,"summary_zh":250,"released_at":255},81335,"v0.0.49","2025-11-30T19:29:23"]