- new global mcp_local connector wrapping @playwright/mcp@0.0.79: index.js argv wrapper (--headless --isolated --no-sandbox) importing the package cli.js, postinstall downloads chromium-only browser, verify.js headless-launch probe, 24 tools with display names - also carries the pending docs work: changelog extracted to CHANGELOG.md, manifest guide, SKALD.md/CLAUDE.md updates
34 lines
1.5 KiB
JavaScript
34 lines
1.5 KiB
JavaScript
// Skald connector entry point.
|
|
//
|
|
// The MCP server itself is the upstream `@playwright/mcp` package, pinned in
|
|
// package.json and installed by Skald beside this file (`npm ci --omit=dev`,
|
|
// falling back to `npm install --omit=dev`).
|
|
//
|
|
// This file exists because Skald launches a `mcp_local` connector as
|
|
// `<command> <mcp_config.args[0]>`, where args[0] is rewritten to the absolute
|
|
// path of a *shipped* file — so `npx @playwright/mcp` cannot be expressed:
|
|
// args[0] would be taken as the entry file's name.
|
|
//
|
|
// The wrapper rewrites argv with the flags the server needs in a display-less
|
|
// container (headless, isolated in-memory profile, no sandbox) and then
|
|
// imports the package's CLI module, which self-executes at import time.
|
|
// cli.js is not listed in the package's "exports" map, so it is resolved
|
|
// from the exported package.json path instead of a package subpath import.
|
|
import { createRequire } from "node:module";
|
|
import { dirname, join } from "node:path";
|
|
import { pathToFileURL } from "node:url";
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const packageDir = dirname(require.resolve("@playwright/mcp/package.json"));
|
|
|
|
process.argv = [
|
|
process.argv[0],
|
|
"playwright-mcp",
|
|
"--headless", // no display in the container/host session
|
|
"--isolated", // in-memory profile: no shared cookies/login state on disk
|
|
"--no-sandbox", // Chromium sandbox cannot run inside containers
|
|
...process.argv.slice(2), // passthrough for any extra args
|
|
];
|
|
|
|
await import(pathToFileURL(join(packageDir, "cli.js")));
|