豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 8c2a7fc

Browse files
authored
fix: mark categoryExtensions flag mutually exclusive with autoConnect (#1202)
Fixes #1072
1 parent 6279177 commit 8c2a7fc

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/bin/chrome-devtools-mcp-cli-options.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const cliOptions = {
1212
type: 'boolean',
1313
description:
1414
'If specified, automatically connects to a browser (Chrome 144+) running locally from the user data directory identified by the channel param (default channel is stable). Requires the remoted debugging server to be started in the Chrome instance via chrome://inspect/#remote-debugging.',
15-
conflicts: ['isolated', 'executablePath'],
15+
conflicts: ['isolated', 'executablePath', 'categoryExtensions'],
1616
default: false,
1717
coerce: (value: boolean | undefined) => {
1818
if (!value) {
@@ -26,7 +26,7 @@ export const cliOptions = {
2626
description:
2727
'Connect to a running, debuggable Chrome instance (e.g. `http://127.0.0.1:9222`). For more details see: https://github.com/ChromeDevTools/chrome-devtools-mcp#connecting-to-a-running-chrome-instance.',
2828
alias: 'u',
29-
conflicts: 'wsEndpoint',
29+
conflicts: ['wsEndpoint', 'categoryExtensions'],
3030
coerce: (url: string | undefined) => {
3131
if (!url) {
3232
return;
@@ -44,7 +44,7 @@ export const cliOptions = {
4444
description:
4545
'WebSocket endpoint to connect to a running Chrome instance (e.g., ws://127.0.0.1:9222/devtools/browser/<id>). Alternative to --browserUrl.',
4646
alias: 'w',
47-
conflicts: 'browserUrl',
47+
conflicts: ['browserUrl', 'categoryExtensions'],
4848
coerce: (url: string | undefined) => {
4949
if (!url) {
5050
return;
@@ -211,9 +211,10 @@ export const cliOptions = {
211211
},
212212
categoryExtensions: {
213213
type: 'boolean',
214-
default: false,
215214
hidden: true,
216-
describe: 'Set to false to exclude tools related to extensions.',
215+
conflicts: ['browserUrl', 'autoConnect', 'wsEndpoint'],
216+
describe:
217+
'Set to true to include tools related to extensions. Note: This feature is only supported with a pipe connection. autoConnect is not supported.',
217218
},
218219
performanceCrux: {
219220
type: 'boolean',

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export async function createMcpServer(
129129
}
130130
if (
131131
tool.annotations.category === ToolCategory.EXTENSIONS &&
132-
serverArgs.categoryExtensions === false
132+
!serverArgs.categoryExtensions
133133
) {
134134
return;
135135
}

tests/cli.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ describe('cli args parsing', () => {
1515
categoryEmulation: true,
1616
'category-performance': true,
1717
categoryPerformance: true,
18-
'category-extensions': false,
19-
categoryExtensions: false,
2018
'category-network': true,
2119
categoryNetwork: true,
2220
'auto-connect': undefined,

0 commit comments

Comments
 (0)