这是一个使用Puppeteer提供浏览器自动化功能的Model Context Protocol服务器,并具有可配置选项。此服务器使LLMs能够在真实的浏览器环境中与网页进行交互、截取屏幕截图并执行JavaScript,同时可以通过环境变量自定义Puppeteer启动选项。
puppeteer_navigate
url(字符串)puppeteer_screenshot
name(字符串,必需):屏幕截图的名称selector(字符串,可选):要截屏的元素的CSS选择器width(数字,可选,默认值:800):屏幕截图宽度height(数字,可选,默认值:600):屏幕截图高度puppeteer_click
selector(字符串):要点击的元素的CSS选择器puppeteer_hover
selector(字符串):要悬停的元素的CSS选择器puppeteer_fill
selector(字符串):输入字段的CSS选择器value(字符串):要填写的值puppeteer_select
selector(字符串):要选择的元素的CSS选择器value(字符串):要选择的值puppeteer_evaluate
script(字符串):要执行的JavaScript代码该服务器提供了两种类型的资源访问:
控制台日志(console://logs)
屏幕截图(screenshot://<name>)
您可以通过在PUPPETEER_ARGS环境变量中提供JSON字符串来配置Puppeteer启动选项。这允许您在不修改服务器代码的情况下自定义浏览器行为。
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "github:afshawnlotfi/mcp-configurable-puppeteer"],
"env": {
"PUPPETEER_ARGS": "{\"browser\": \"firefox\"}"
}
}
}
}
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "github:afshawnlotfi/mcp-configurable-puppeteer"],
"env": {
"PUPPETEER_ARGS": "{\"defaultViewport\": {\"width\": 1280, \"height\": 800}}"
}
}
}
}
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "github:afshawnlotfi/mcp-configurable-puppeteer"]
}
}
}
您还可以指定分支、标签或提交:
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "github:afshawnlotfi/mcp-configurable-puppeteer#main"]
}
}
}
此MCP服务器采用MIT许可证。这意味着您可以自由地使用、修改和分发软件,但需遵守MIT许可证中的条款和条件。更多详情,请参见项目仓库中的LICENSE文件。