ubuntu安装playwright 浏览器
(TraeAI-7) ~/dev [1] $ cd '/home/lyh/dev' ; cd /tmp && npx playwright install chromium Need to inst...
trae 的 mcp 配置
ubuntu 系统:\home\lyh.trae-cn-server\data\Machine\mcp.json
改用官方的 @playwright/mcp 包,它支持 --executable-path 参数
{
"Playwright": {
"command": "npx",
"args": [
"-y",
"@playwright/mcp@latest",
"--browser",
"chromium",
"--headless",
"--executable-path",
"/home/lyh/.cache/ms-playwright/chromium-1217/chrome-linux64/chrome"
],
"env": {
"PLAYWRIGHT_BROWSERS_PATH": "/home/lyh/.cache/ms-playwright"
}
}
}
windows 系统
C:\Users\lyh\AppData\Roaming\Trae CN\User\macp.json
{
"mcpServers": {
"Playwright": {
"command": "npx",
"args": [
"-y",
"@playwright/mcp@latest",
"--browser", "chromium",
"--executable-path", "C:\\Users\\lyh\\AppData\\Local\\ms-playwright\\chromium-1217\\chrome-win64\\chrome.exe"
],
"env": {},
"fromGalleryId": "executeautomation.mcp-playwright"
}
}
}
(TraeAI-7) ~/dev [1] $ cd ‘/home/lyh/dev’ ; cd /tmp && npx playwright install chromium Need to install the following packages: playwright@1.59.1 Ok to proceed? (y) y ╔═══════════════════════════════════════════════════════════════════════════════╗ ║ WARNING: It looks like you are running ‘npx playwright install’ without first ║ ║ installing your project’s dependencies. ║ ║ ║ ║ To avoid unexpected behavior, please install your dependencies first, and ║ ║ then run Playwright’s install command: ║ ║ ║ ║ npm install ║ ║ npx playwright install ║ ║ ║ ║ If your project does not yet depend on Playwright, first install the ║ ║ applicable npm package (most commonly @playwright/test), and ║ ║ then run Playwright’s install command to download the browsers: ║ ║ ║ ║ npm install @playwright/test ║ ║ npx playwright install ║ ║ ║ ╚═══════════════════════════════════════════════════════════════════════════════╝ Downloading Chrome for Testing 147.0.7727.15 (playwright chromium v1217) from https://cdn.playwright.dev/builds/cft/147.0.7727.15/linux64/chrome-linux64.zip 170.4 MiB [====================] 100% 0.0s Chrome for Testing 147.0.7727.15 (playwright chromium v1217) downloaded to /home/lyh/.cache/ms-playwright/chromium-1217 Downloading FFmpeg (playwright ffmpeg v1011) from https://playwright.download.prss.microsoft.com/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip 2.3 MiB [====================] 100% 0.0s FFmpeg (playwright ffmpeg v1011) downloaded to /home/lyh/.cache/ms-playwright/ffmpeg-1011 Downloading Chrome Headless Shell 147.0.7727.15 (playwright chromium-headless-shell v1217) from https://cdn.playwright.dev/builds/cft/147.0.7727.15/linux64/chrome-headless-shell-linux64.zip 112 MiB [======== ] 40% 37.3sDownloading Chrome Headless Shell 147.0.7727.15 (playwright chromium-headless-shell v1217) from https://cdn.playwright.d112 MiB [====================] 100% 0.0s Chrome Headless Shell 147.0.7727.15 (playwright chromium-headless-shell v1217) downloaded to /home/lyh/.cache/ms-playwright/chromium_headless_shell-1217