Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 09:03:44 +08:00
commit 51eac46940
41 changed files with 5371 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env node
/**
* MCP Server: chrome-devtools
* Server Version: 0.10.2
* Generated: 2025-11-23
* Tool: handle_dialog
*
* If a browser dialog was opened, use this command to handle it
*/
import { program } from 'commander';
import { callTool } from './mcp_client.js';
program
.name('handle_dialog')
.description('If a browser dialog was opened, use this command to handle it')
.option('--action <value>', 'Whether to dismiss or accept the dialog (required). Choices: "accept", "dismiss"')
.option('--promptText <value>', 'Optional prompt text to enter into the dialog.')
.parse();
const options = program.opts();
// Validate required options
if (!options.action) {
console.error('Error: --action is required');
process.exit(1);
}
// Build arguments object
const args = {};
if (options.action !== undefined) {
args['action'] = options.action;
}
if (options.promptText !== undefined) {
args['promptText'] = options.promptText;
}
// Call the tool
try {
const result = await callTool('chrome-devtools', 'handle_dialog', args);
console.log(result);
} catch (error) {
console.error('Error:', error.message);
process.exit(1);
}