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

Commit 8263f84

Browse files
committed
feat: enable Chrome DevTools CLI
1 parent 7c9ff36 commit 8263f84

File tree

6 files changed

+146
-8
lines changed

6 files changed

+146
-8
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"version": "0.18.1",
44
"description": "MCP server for Chrome DevTools",
55
"type": "module",
6-
"bin": "./build/src/index.js",
6+
"bin": {
7+
"chrome-devtools-mcp": "./build/src/index.js",
8+
"chrome-devtools": "./build/src/bin/chrome-devtools.js"
9+
},
710
"main": "./build/src/server.js",
811
"scripts": {
912
"cli:generate": "node --experimental-strip-types scripts/generate-cli.ts",

src/bin/chrome-devtools.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
import process from 'node:process';
1010

11-
import yargs, {type Options, type PositionalOptions} from 'yargs';
12-
import {hideBin} from 'yargs/helpers';
11+
import type {Options, PositionalOptions} from 'yargs';
1312

1413
import {parseArguments} from '../cli.js';
1514
import {
@@ -20,7 +19,7 @@ import {
2019
} from '../daemon/client.js';
2120
import {isDaemonRunning} from '../daemon/utils.js';
2221
import {logDisclaimers} from '../server.js';
23-
import type {CallToolResult} from '../third_party/index.js';
22+
import {hideBin, yargs, type CallToolResult} from '../third_party/index.js';
2423
import {VERSION} from '../version.js';
2524

2625
import {commands} from './cliDefinitions.js';

src/daemon/daemon.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import {createServer, type Server} from 'node:net';
1111
import path from 'node:path';
1212
import process from 'node:process';
1313

14-
import {Client} from '@modelcontextprotocol/sdk/client/index.js';
15-
import {StdioClientTransport} from '@modelcontextprotocol/sdk/client/stdio.js';
16-
1714
import {logger} from '../logger.js';
18-
import {PipeTransport} from '../third_party/index.js';
15+
import {
16+
Client,
17+
PipeTransport,
18+
StdioClientTransport,
19+
} from '../third_party/index.js';
1920
import {VERSION} from '../version.js';
2021

2122
import type {DaemonMessage} from './types.js';

src/third_party/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export {default as debug} from 'debug';
2020
export type {Debugger} from 'debug';
2121
export {McpServer} from '@modelcontextprotocol/sdk/server/mcp.js';
2222
export {StdioServerTransport} from '@modelcontextprotocol/sdk/server/stdio.js';
23+
export {StdioClientTransport} from '@modelcontextprotocol/sdk/client/stdio.js';
24+
export {Client} from '@modelcontextprotocol/sdk/client/index.js';
2325
export {
2426
type CallToolResult,
2527
SetLevelRequestSchema,

tests/third_party_notices.test.js.snapshot

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,138 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
633633
SOFTWARE.
634634

635635

636+
-------------------- DEPENDENCY DIVIDER --------------------
637+
638+
Name: cross-spawn
639+
URL: https://github.com/moxystudio/node-cross-spawn
640+
Version: <VERSION>
641+
License: MIT
642+
643+
The MIT License (MIT)
644+
645+
Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
646+
647+
Permission is hereby granted, free of charge, to any person obtaining a copy
648+
of this software and associated documentation files (the "Software"), to deal
649+
in the Software without restriction, including without limitation the rights
650+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
651+
copies of the Software, and to permit persons to whom the Software is
652+
furnished to do so, subject to the following conditions:
653+
654+
The above copyright notice and this permission notice shall be included in
655+
all copies or substantial portions of the Software.
656+
657+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
658+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
659+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
660+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
661+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
662+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
663+
THE SOFTWARE.
664+
665+
666+
-------------------- DEPENDENCY DIVIDER --------------------
667+
668+
Name: isexe
669+
URL: https://github.com/isaacs/isexe#readme
670+
Version: <VERSION>
671+
License: ISC
672+
673+
The ISC License
674+
675+
Copyright (c) Isaac Z. Schlueter and Contributors
676+
677+
Permission to use, copy, modify, and/or distribute this software for any
678+
purpose with or without fee is hereby granted, provided that the above
679+
copyright notice and this permission notice appear in all copies.
680+
681+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
682+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
683+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
684+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
685+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
686+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
687+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
688+
689+
690+
-------------------- DEPENDENCY DIVIDER --------------------
691+
692+
Name: which
693+
URL: git://github.com/isaacs/node-which.git
694+
Version: <VERSION>
695+
License: ISC
696+
697+
The ISC License
698+
699+
Copyright (c) Isaac Z. Schlueter and Contributors
700+
701+
Permission to use, copy, modify, and/or distribute this software for any
702+
purpose with or without fee is hereby granted, provided that the above
703+
copyright notice and this permission notice appear in all copies.
704+
705+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
706+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
707+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
708+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
709+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
710+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
711+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
712+
713+
714+
-------------------- DEPENDENCY DIVIDER --------------------
715+
716+
Name: path-key
717+
URL: sindresorhus/path-key
718+
Version: <VERSION>
719+
License: MIT
720+
721+
MIT License
722+
723+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
724+
725+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
726+
727+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
728+
729+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
730+
731+
732+
-------------------- DEPENDENCY DIVIDER --------------------
733+
734+
Name: shebang-regex
735+
URL: sindresorhus/shebang-regex
736+
Version: <VERSION>
737+
License: MIT
738+
739+
MIT License
740+
741+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
742+
743+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
744+
745+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
746+
747+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
748+
749+
750+
-------------------- DEPENDENCY DIVIDER --------------------
751+
752+
Name: shebang-command
753+
URL: kevva/shebang-command
754+
Version: <VERSION>
755+
License: MIT
756+
757+
MIT License
758+
759+
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
760+
761+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
762+
763+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
764+
765+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
766+
767+
636768
-------------------- DEPENDENCY DIVIDER --------------------
637769

638770
Name: puppeteer-core

0 commit comments

Comments
 (0)