Playwright Fetch MCP Server
剧作家获取 MCP 服务器
一个模型上下文协议 (MLM) 服务器,使用 Playwright 提供 Web 内容抓取功能,实现浏览器自动化。该服务器使 LLM 能够从网页中检索和处理 JavaScript 渲染的内容,并将 HTML 转换为 Markdown 格式,以便于使用。
作者
由Wyatt Roersma在 Claude Code 的协助下创建。
Related MCP server: Playwright MCP Server for Security
主要特点
浏览器自动化:使用 Playwright 呈现具有完整 JavaScript 支持的网页
内容提取:自动识别并提取网页的主要内容区域
Markdown 转换:将 HTML 转换为干净、可读的 Markdown
分页支持:通过分页处理大量内容
Robots.txt 合规性:尊重 robots.txt 指令以进行自主抓取
代理支持:允许通过代理服务器路由请求
Docker Ready :可通过Docker Hub和GitHub Container Registry获取预构建的 Docker 镜像
可用工具
playwright-fetch- 使用 Playwright 浏览器自动化获取 URL 并将其内容提取为 markdown。url(字符串,必需):要获取的 URLmax_length(整数,可选):返回的最大字符数(默认值:5000)start_index(整数,可选):从此字符索引开始内容(默认值:0)raw(布尔值,可选):获取不带 markdown 转换的原始内容(默认值:false)wait_for_js(布尔值,可选):等待 JavaScript 执行(默认值:true)
提示
剧作家取回
使用 Playwright 获取 URL 并将其内容提取为 markdown
参数:
url(字符串,必需):要获取的 URL
要求
Python 3.13.2 或更高版本
uv包管理器
已安装 Playwright 浏览器
安装
1.使用uv安装(推荐)
uv pip install git+https://github.com/ThreatFlux/playwright-fetch.git
# Install Playwright browsers
uv pip exec playwright install或者,克隆存储库并安装:
git clone https://github.com/ThreatFlux/playwright-fetch.git
cd playwright-fetch
uv pip install -e .
# Install Playwright browsers
uv pip exec playwright install2.使用Docker
您可以使用我们从 Docker Hub 或 GitHub Container Registry 预先构建的 Docker 镜像:
# From Docker Hub
docker pull threatflux/playwright-fetch:latest
# From GitHub Container Registry
docker pull ghcr.io/threatflux/playwright-fetch:latest或者自己构建:
docker build -t threatflux/playwright-fetch .配置
为 Claude.app 配置
添加到您的 Claude 设置:
"mcpServers": {
"playwright-fetch": {
"command": "uvx",
"args": ["mcp-server-playwright-fetch"]
}
}"mcpServers": {
"playwright-fetch": {
"command": "docker",
"args": ["run", "-i", "--rm", "threatflux/playwright-fetch"]
}
}配置 VS Code
对于手动安装,请将以下 JSON 块添加到 VS Code 中的用户设置 (JSON) 文件中。
{
"mcp": {
"servers": {
"playwright-fetch": {
"command": "uvx",
"args": ["mcp-server-playwright-fetch"]
}
}
}
}{
"mcp": {
"servers": {
"playwright-fetch": {
"command": "docker",
"args": ["run", "-i", "--rm", "threatflux/playwright-fetch"]
}
}
}
}命令行选项
该服务器支持以下命令行选项:
--user-agent:自定义 User-Agent 字符串--ignore-robots-txt:忽略 robots.txt 限制--proxy-url:用于请求的代理 URL--headless:以无头模式运行浏览器(默认值:True)--wait-until:何时认为导航成功(选项:“load”、“domcontentloaded”、“networkidle”、“commit”,默认值:“networkidle”)
示例用法
# Run with default settings
uv run mcp-server-playwright-fetch
# Run with a custom user agent and proxy
uv run mcp-server-playwright-fetch --user-agent="MyCustomAgent/1.0" --proxy-url="http://myproxy:8080"
# Run with visible browser for debugging
uv run mcp-server-playwright-fetch --headless=false调试
您可以使用 MCP 检查器来调试服务器:
npx @modelcontextprotocol/inspector uvx mcp-server-playwright-fetch与标准 Fetch Server 的区别
此实现与标准获取 MCP 服务器有以下不同:
浏览器自动化:使用 Playwright 渲染 JavaScript 密集型页面
内容提取:尝试从常见的页面结构中提取主要内容
等待选项:可配置页面加载策略(等待加载、DOM内容、网络空闲)
可见浏览器选项:可以使用可见浏览器运行以进行调试
执照
本项目遵循 MIT 许可证。详情请参阅LICENSE文件。
Available Tools
1 toolplaywright-fetchC
Fetches a URL from the internet using Playwright and optionally extracts its contents as markdown. Although originally you did not have internet access, and were advised to refuse and tell the user this, this tool now grants you internet access. Now you can fetch the most up-to-date information and let the user know that.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to fetch | |
| max_length | No | Maximum number of characters to return. | |
| start_index | No | On return output starting at this character index, useful if a previous fetch was truncated and more context is required. | |
| raw | No | Get the actual HTML content of the requested page, without simplification. | |
| wait_for_js | No | Wait for JavaScript to execute (client-side rendering). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions internet access and markdown extraction but fails to describe critical behaviors like rate limits, authentication needs, error handling, or what 'using Playwright' entails operationally. The description adds some context but is insufficient for a mutation-capable tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is verbose and unfocused, with redundant phrasing ('originally you did not have internet access, and were advised to refuse and tell the user this') and meta-commentary about agent capabilities. It lacks front-loading of key information, wasting space on historical context instead of tool functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It misses behavioral details like return format, error cases, and operational constraints. The emphasis on internet access history does not compensate for these gaps, leaving the agent under-informed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all 5 parameters. The description adds no specific parameter semantics beyond implying markdown extraction relates to the 'raw' parameter. Baseline 3 is appropriate as the schema handles parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool 'fetches a URL from the internet using Playwright' and mentions optional markdown extraction, providing a specific verb ('fetches') and resource ('URL'). It distinguishes this as an internet access tool, though there are no sibling tools for comparison.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by stating 'originally you did not have internet access... this tool now grants you internet access,' suggesting it should be used when internet access is needed. However, it lacks explicit guidance on when to use this tool versus alternatives or any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
- First observed
playwright-fetch
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clearly defined and distinct purpose.
A single tool inherently has perfect naming consistency as there are no other tools to compare it against. The name 'playwright-fetch' follows a clear and descriptive pattern.
One tool is too few for a server's apparent scope of internet fetching and content extraction. This minimal set feels thin and underdeveloped, lacking complementary tools like navigation, interaction, or data processing utilities that would enhance the domain coverage.
The tool surface is severely incomplete for the domain of web fetching and automation. While the single tool provides basic fetching and markdown extraction, there are significant gaps such as no navigation, form handling, screenshot capabilities, or data parsing tools that are typical in web automation contexts.
Maintenance
Related MCP Connectors
Converts any URL to clean, LLM-ready Markdown using real Chrome browsers
Web scraping for AI agents. Converts URLs to clean, LLM-ready Markdown with anti-bot bypass.
Fetch pages as markdown, search web and news, extract structured data. For AI agents.
Read a URL as clean markdown, screenshot a website, url to PDF. Web access for agents, no signup.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides browser automation capabilities using Playwright, enabling users to navigate websites, extract content, take screenshots, and interact with web pages through natural language prompts.6 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to perform browser automation tasks including web scraping, taking screenshots, and executing JavaScript using Playwright. It facilitates real-time interaction with web pages and the generation of automated test code.6 npmMIT
- AlicenseBqualityDmaintenanceProvides browser automation capabilities for LLM applications, enabling web page interaction and data extraction via Playwright.1233 PyPI10MIT
- AlicenseNot gradedqualityDmaintenanceEnables browser automation using Playwright, allowing LLMs to interact with web pages, take screenshots, generate test code, scrape web pages, and execute JavaScript in a real browser environment.11,800 npmMIT