diff --git a/README.md b/README.md index 58ccbe17d..cec038815 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,20 @@ allowing them to inspect, debug, and modify any data in the browser or DevTools. Avoid sharing sensitive or personal information that you don't want to share with MCP clients. +## **Usage statistics** + +Google collects usage statistics (such as tool invocation success rates, latency, and environment information) to improve the reliability and performance of Chrome DevTools MCP. + +Data collection is **enabled by default**. You can opt-out by passing the `--no-usage-statistics` flag when starting the server: + +```json +"args": ["-y", "chrome-devtools-mcp@latest", "--no-usage-statistics"] +``` + +Google handles this data in accordance with the [Google Privacy Policy](https://policies.google.com/privacy). + +Google's collection of usage statistics for Chrome DevTools MCP is independent from the Chrome browser's usage statistics. Opting out of Chrome metrics does not automatically opt you out of this tool, and vice-versa. + ## Requirements - [Node.js](https://nodejs.org/) v20.19 or a newer [latest maintenance LTS](https://github.com/nodejs/Release#release-schedule) version. @@ -450,6 +464,11 @@ The Chrome DevTools MCP server supports the following configuration option: - **Type:** boolean - **Default:** `true` +- **`--usageStatistics`/ `--usage-statistics`** + Set to false to opt-out of usage statistics collection. Google collects usage data to improve the tool, handled under the Google Privacy Policy (https://policies.google.com/privacy). This is independent from Chrome browser metrics. + - **Type:** boolean + - **Default:** `true` + Pass them via the `args` property in the JSON configuration. For example: diff --git a/src/cli.ts b/src/cli.ts index ff43e9667..aa9fbe097 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -206,9 +206,7 @@ export const cliOptions = { }, usageStatistics: { type: 'boolean', - // Marked as `false` until the feature is ready to be enabled by default. - default: false, - hidden: true, + default: true, describe: 'Set to false to opt-out of usage statistics collection. Google collects usage data to improve the tool, handled under the Google Privacy Policy (https://policies.google.com/privacy). This is independent from Chrome browser metrics.', }, @@ -295,6 +293,10 @@ export function parseArguments(version: string, argv = process.argv) { '$0 --auto-connect --channel=canary', 'Connect to a canary Chrome instance (Chrome 144+) running instead of launching a new instance', ], + [ + '$0 --no-usage-statistics', + 'Do not send usage statistics https://github.com/ChromeDevTools/chrome-devtools-mcp#usage-statistics.', + ], ]); return yargsInstance diff --git a/tests/cli.test.ts b/tests/cli.test.ts index add84e328..57b1dbb1f 100644 --- a/tests/cli.test.ts +++ b/tests/cli.test.ts @@ -21,8 +21,8 @@ describe('cli args parsing', () => { categoryNetwork: true, 'auto-connect': undefined, autoConnect: undefined, - 'usage-statistics': false, - usageStatistics: false, + 'usage-statistics': true, + usageStatistics: true, }; it('parses with default args', async () => { @@ -252,9 +252,9 @@ describe('cli args parsing', () => { }); it('parses usage statistics flag', async () => { - // Test default (should be false) + // Test default (should be true). const defaultArgs = parseArguments('1.0.0', ['node', 'main.js']); - assert.strictEqual(defaultArgs.usageStatistics, false); + assert.strictEqual(defaultArgs.usageStatistics, true); // Test enabling it const enabledArgs = parseArguments('1.0.0', [