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,47 @@
#!/usr/bin/env node
/**
* MCP Server: chrome-devtools
* Server Version: 0.10.2
* Generated: 2025-11-23
* Tool: list_network_requests
*
* List all requests for the currently selected page since the last navigation.
*/
import { program } from 'commander';
import { callTool } from './mcp_client.js';
program
.name('list_network_requests')
.description('List all requests for the currently selected page since the last navigation.')
.option('--pageSize <value>', 'Maximum number of requests to return. When omitted, returns all requests.', (val) => parseInt(val, 10))
.option('--pageIdx <value>', 'Page number to return (0-based). When omitted, returns the first page.', (val) => parseInt(val, 10))
.option('--resourceTypes <items...>', 'Filter requests to only return requests of the specified resource types. When omitted or empty, returns all requests.')
.option('--includePreservedRequests', 'Set to true to return the preserved requests over the last 3 navigations.')
.parse();
const options = program.opts();
// Build arguments object
const args = {};
if (options.pageSize !== undefined) {
args['pageSize'] = options.pageSize;
}
if (options.pageIdx !== undefined) {
args['pageIdx'] = options.pageIdx;
}
if (options.resourceTypes !== undefined) {
args['resourceTypes'] = options.resourceTypes;
}
if (options.includePreservedRequests) {
args['includePreservedRequests'] = true;
}
// Call the tool
try {
const result = await callTool('chrome-devtools', 'list_network_requests', args);
console.log(result);
} catch (error) {
console.error('Error:', error.message);
process.exit(1);
}