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

Commit f07353f

Browse files
authored
chore: report current cli args (#1133)
This CL records the args in the daemon and reports them back to the client via the status call.
1 parent ae311fc commit f07353f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/bin/chrome-devtools.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@ y.command('status', 'Checks if chrome-devtools-mcp is running', async () => {
114114
socketPath: string;
115115
startDate: string;
116116
version: string;
117+
args: string[];
117118
};
118119
console.log(
119120
`pid=${data.pid} socket=${data.socketPath} start-date=${data.startDate} version=${data.version}`,
120121
);
122+
console.log(`args=${JSON.stringify(data.args)}`);
121123
} else {
122124
console.error('Error:', response.error);
123125
process.exit(1);

src/daemon/daemon.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ logger(`Writing ${process.pid.toString()} to ${pidFilePath}`);
4444
const socketPath = getSocketPath();
4545

4646
const startDate = new Date();
47+
const mcpServerArgs = process.argv.slice(2);
4748

4849
let mcpClient: Client | null = null;
4950
let mcpTransport: StdioClientTransport | null = null;
@@ -52,11 +53,10 @@ let server: Server | null = null;
5253
async function setupMCPClient() {
5354
console.log('Setting up MCP client connection...');
5455

55-
const args = process.argv.slice(2);
5656
// Create stdio transport for chrome-devtools-mcp
5757
mcpTransport = new StdioClientTransport({
5858
command: process.execPath,
59-
args: [INDEX_SCRIPT_PATH, ...args],
59+
args: [INDEX_SCRIPT_PATH, ...mcpServerArgs],
6060
env: process.env as Record<string, string>,
6161
});
6262
mcpClient = new Client(
@@ -118,6 +118,7 @@ async function handleRequest(msg: DaemonMessage) {
118118
socketPath,
119119
startDate: startDate.toISOString(),
120120
version: VERSION,
121+
args: mcpServerArgs,
121122
}),
122123
};
123124
}

0 commit comments

Comments
 (0)