diff --git a/README.md b/README.md index 433dcc418..469ef252c 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,10 @@ The Chrome DevTools MCP server supports the following configuration option: Proxy server configuration for Chrome passed as --proxy-server when launching the browser. See https://www.chromium.org/developers/design-documents/network-settings/ for details. - **Type:** string +- **`--acceptInsecureCerts`** + If enabled, ignores errors relative to self-signed and expired certificates. Use with caution. + - **Type:** boolean + Pass them via the `args` property in the JSON configuration. For example: diff --git a/src/browser.ts b/src/browser.ts index baa47e908..1cbaa6daf 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -57,6 +57,7 @@ export async function ensureBrowserConnected(browserURL: string) { } interface McpLaunchOptions { + acceptInsecureCerts?: boolean; executablePath?: string; customDevTools?: string; channel?: Channel; @@ -116,6 +117,7 @@ export async function launch(options: McpLaunchOptions): Promise { pipe: true, headless, args, + acceptInsecureCerts: options.acceptInsecureCerts, }); if (options.logFile) { // FIXME: we are probably subscribing too late to catch startup logs. We diff --git a/src/cli.ts b/src/cli.ts index 5d0ad78c8..880c396fb 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -76,6 +76,10 @@ export const cliOptions = { type: 'string' as const, description: `Proxy server configuration for Chrome passed as --proxy-server when launching the browser. See https://www.chromium.org/developers/design-documents/network-settings/ for details.`, }, + acceptInsecureCerts: { + type: 'boolean' as const, + description: `If enabled, ignores errors relative to self-signed and expired certificates. Use with caution.`, + }, }; export function parseArguments(version: string, argv = process.argv) { diff --git a/src/main.ts b/src/main.ts index efc2008dc..2663d3c13 100644 --- a/src/main.ts +++ b/src/main.ts @@ -84,6 +84,7 @@ async function getContext(): Promise { logFile, viewport: args.viewport, args: extraArgs, + acceptInsecureCerts: args.acceptInsecureCerts, }); if (context?.browser !== browser) {