puppeteer-mcp-claude 0.0.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -10
- package/bin/cli.js +326 -148
- package/dist/index.js +257 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
A Model Context Protocol (MCP) server that provides Claude Code with comprehensive browser automation capabilities through Puppeteer. This server allows Claude to interact with web pages, take screenshots, execute JavaScript, and perform various browser automation tasks.
|
|
4
4
|
|
|
5
|
+
## 🚀 Quick Start
|
|
6
|
+
|
|
7
|
+
**Want browser automation in Claude Desktop & Claude Code? Run this one command:**
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx puppeteer-mcp-claude install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**That's it!** The installer will automatically:
|
|
14
|
+
- Detect Claude Desktop and Claude Code on your system
|
|
15
|
+
- Configure both applications with browser automation tools
|
|
16
|
+
- Verify everything works across all detected Claude apps
|
|
17
|
+
|
|
18
|
+
Then restart your Claude apps and ask: *"Take a screenshot of google.com"* to test it out!
|
|
19
|
+
|
|
20
|
+
### 🖥️ Cross-Platform Support
|
|
21
|
+
- **macOS**: Claude Desktop + Claude Code
|
|
22
|
+
- **Linux**: Claude Desktop + Claude Code
|
|
23
|
+
- **Windows**: Claude Code only
|
|
24
|
+
|
|
5
25
|
## Features
|
|
6
26
|
|
|
7
27
|
- **Browser Management**: Launch and close Chrome/Chromium browsers
|
|
@@ -30,19 +50,33 @@ A Model Context Protocol (MCP) server that provides Claude Code with comprehensi
|
|
|
30
50
|
|
|
31
51
|
## Installation
|
|
32
52
|
|
|
33
|
-
###
|
|
53
|
+
### 🚀 Automatic Setup (Recommended)
|
|
34
54
|
|
|
35
|
-
|
|
55
|
+
**Get browser automation in all your Claude apps with just one command:**
|
|
36
56
|
|
|
37
57
|
```bash
|
|
38
58
|
npx puppeteer-mcp-claude install
|
|
39
59
|
```
|
|
40
60
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
**What happens automatically:**
|
|
62
|
+
1. ✅ Downloads the latest version from npm
|
|
63
|
+
2. ✅ **Detects Claude Desktop and Claude Code** on your system
|
|
64
|
+
3. ✅ **Configures both applications** automatically
|
|
65
|
+
4. ✅ Creates config files if needed (cross-platform paths)
|
|
66
|
+
5. ✅ Verifies everything is working correctly
|
|
67
|
+
6. ✅ Shows you exactly what to do next
|
|
68
|
+
|
|
69
|
+
**Cross-platform detection:**
|
|
70
|
+
- **macOS**: `~/Library/Application Support/Claude/` (Desktop) + `~/.claude/` (Code)
|
|
71
|
+
- **Linux**: `~/.config/Claude/` (Desktop) + `~/.claude/` (Code)
|
|
72
|
+
- **Windows**: `~/.claude/` (Code only)
|
|
73
|
+
|
|
74
|
+
**After installation:**
|
|
75
|
+
- Restart any running Claude applications
|
|
76
|
+
- Ask Claude: *"List all available tools"*
|
|
77
|
+
- You'll see 11 new puppeteer tools for browser automation!
|
|
78
|
+
|
|
79
|
+
**No manual configuration needed!** The installer handles everything across all platforms.
|
|
46
80
|
|
|
47
81
|
### Manual Installation
|
|
48
82
|
|
|
@@ -83,9 +117,9 @@ For development or contribution:
|
|
|
83
117
|
|
|
84
118
|
| Command | Description |
|
|
85
119
|
|---------|-------------|
|
|
86
|
-
| `npx puppeteer-mcp-claude install` | Install and configure for Claude Code |
|
|
87
|
-
| `npx puppeteer-mcp-claude uninstall` | Remove from Claude
|
|
88
|
-
| `npx puppeteer-mcp-claude status` | Check installation status |
|
|
120
|
+
| `npx puppeteer-mcp-claude install` | Install and configure for Claude Desktop & Code |
|
|
121
|
+
| `npx puppeteer-mcp-claude uninstall` | Remove from all Claude applications |
|
|
122
|
+
| `npx puppeteer-mcp-claude status` | Check installation status across all apps |
|
|
89
123
|
| `npx puppeteer-mcp-claude help` | Show help and available tools |
|
|
90
124
|
|
|
91
125
|
## Alternative Installation Methods
|
package/bin/cli.js
CHANGED
|
@@ -3,31 +3,78 @@
|
|
|
3
3
|
const { execSync, spawn } = require('child_process');
|
|
4
4
|
const { readFileSync, writeFileSync, existsSync, mkdirSync } = require('fs');
|
|
5
5
|
const { join } = require('path');
|
|
6
|
-
const { homedir } = require('os');
|
|
6
|
+
const { homedir, platform } = require('os');
|
|
7
7
|
const path = require('path');
|
|
8
8
|
|
|
9
9
|
class PuppeteerMCPInstaller {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.packageDir = path.dirname(__dirname);
|
|
12
|
-
this.claudeConfigPath = join(homedir(), '.claude', 'claude_desktop_config.json');
|
|
13
12
|
this.serverName = 'puppeteer-mcp-claude';
|
|
13
|
+
this.configs = this.getConfigPaths();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getConfigPaths() {
|
|
17
|
+
const home = homedir();
|
|
18
|
+
const os = platform();
|
|
19
|
+
|
|
20
|
+
const configs = [];
|
|
21
|
+
|
|
22
|
+
// Claude Desktop paths
|
|
23
|
+
if (os === 'darwin') { // macOS
|
|
24
|
+
configs.push({
|
|
25
|
+
name: 'Claude Desktop (macOS)',
|
|
26
|
+
path: join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'),
|
|
27
|
+
type: 'desktop'
|
|
28
|
+
});
|
|
29
|
+
} else if (os === 'linux') {
|
|
30
|
+
configs.push({
|
|
31
|
+
name: 'Claude Desktop (Linux)',
|
|
32
|
+
path: join(home, '.config', 'Claude', 'claude_desktop_config.json'),
|
|
33
|
+
type: 'desktop'
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Claude Code paths (cross-platform)
|
|
38
|
+
configs.push({
|
|
39
|
+
name: 'Claude Code',
|
|
40
|
+
path: join(home, '.claude', 'claude_desktop_config.json'),
|
|
41
|
+
type: 'code'
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return configs;
|
|
14
45
|
}
|
|
15
46
|
|
|
16
47
|
async install() {
|
|
17
48
|
console.log('🚀 Installing Puppeteer MCP Claude...\n');
|
|
18
49
|
|
|
19
50
|
try {
|
|
20
|
-
await this.
|
|
21
|
-
|
|
22
|
-
|
|
51
|
+
const installedConfigs = await this.detectAndInstall();
|
|
52
|
+
|
|
53
|
+
if (installedConfigs.length === 0) {
|
|
54
|
+
console.log('⚠️ No Claude applications detected.');
|
|
55
|
+
console.log(' Creating configuration for Claude Code...');
|
|
56
|
+
await this.installForConfig(this.configs.find(c => c.type === 'code'));
|
|
57
|
+
installedConfigs.push('Claude Code');
|
|
58
|
+
}
|
|
23
59
|
|
|
24
60
|
console.log('\n✅ Puppeteer MCP Claude installed successfully!');
|
|
61
|
+
console.log(`\n📱 Installed for: ${installedConfigs.join(', ')}`);
|
|
62
|
+
|
|
25
63
|
console.log('\n📋 Next steps:');
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
64
|
+
installedConfigs.forEach(app => {
|
|
65
|
+
if (app.includes('Desktop')) {
|
|
66
|
+
console.log(` • Restart Claude Desktop if it's running`);
|
|
67
|
+
}
|
|
68
|
+
if (app.includes('Code')) {
|
|
69
|
+
console.log(` • Restart Claude Code if it's running`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
console.log(' • Ask Claude: "List all available tools"');
|
|
74
|
+
console.log(' • You should see 11 puppeteer tools listed');
|
|
75
|
+
|
|
29
76
|
console.log('\n🔧 Management commands:');
|
|
30
|
-
console.log(' npx puppeteer-mcp-claude uninstall # Remove from Claude
|
|
77
|
+
console.log(' npx puppeteer-mcp-claude uninstall # Remove from all Claude apps');
|
|
31
78
|
console.log(' npx puppeteer-mcp-claude status # Check installation status');
|
|
32
79
|
console.log('\n📖 Documentation: https://github.com/jaenster/puppeteer-mcp-claude');
|
|
33
80
|
|
|
@@ -37,124 +84,95 @@ class PuppeteerMCPInstaller {
|
|
|
37
84
|
}
|
|
38
85
|
}
|
|
39
86
|
|
|
40
|
-
async
|
|
41
|
-
|
|
87
|
+
async detectAndInstall() {
|
|
88
|
+
const installedConfigs = [];
|
|
42
89
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
const configContent = readFileSync(this.claudeConfigPath, 'utf8');
|
|
50
|
-
const config = JSON.parse(configContent);
|
|
90
|
+
console.log('🔍 Detecting Claude applications...\n');
|
|
91
|
+
|
|
92
|
+
for (const config of this.configs) {
|
|
93
|
+
const hasExistingConfig = existsSync(config.path);
|
|
94
|
+
const hasClaudeApp = await this.detectClaudeApp(config);
|
|
51
95
|
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
console.log(' Restart Claude Code to complete removal');
|
|
96
|
+
if (hasExistingConfig || hasClaudeApp) {
|
|
97
|
+
console.log(`✅ Found ${config.name}`);
|
|
98
|
+
await this.installForConfig(config);
|
|
99
|
+
installedConfigs.push(config.name);
|
|
57
100
|
} else {
|
|
58
|
-
console.log(
|
|
101
|
+
console.log(`⚪ ${config.name} not detected`);
|
|
59
102
|
}
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.error('❌ Failed to remove configuration:', error.message);
|
|
62
103
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
async status() {
|
|
66
|
-
console.log('📊 Puppeteer MCP Claude Status\n');
|
|
67
104
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
console.log(' Run: npx puppeteer-mcp-claude install');
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
105
|
+
return installedConfigs;
|
|
106
|
+
}
|
|
73
107
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} else {
|
|
91
|
-
console.log('⚠️ Server executable not found - may need to rebuild');
|
|
108
|
+
async detectClaudeApp(config) {
|
|
109
|
+
if (config.type === 'desktop') {
|
|
110
|
+
// Check if Claude Desktop is installed
|
|
111
|
+
const os = platform();
|
|
112
|
+
if (os === 'darwin') {
|
|
113
|
+
return existsSync('/Applications/Claude.app') ||
|
|
114
|
+
existsSync(join(homedir(), 'Applications', 'Claude.app'));
|
|
115
|
+
} else if (os === 'linux') {
|
|
116
|
+
try {
|
|
117
|
+
execSync('which claude-desktop', { stdio: 'ignore' });
|
|
118
|
+
return true;
|
|
119
|
+
} catch {
|
|
120
|
+
// Check common installation paths
|
|
121
|
+
return existsSync('/usr/bin/claude-desktop') ||
|
|
122
|
+
existsSync('/usr/local/bin/claude-desktop') ||
|
|
123
|
+
existsSync(join(homedir(), '.local', 'bin', 'claude-desktop'));
|
|
92
124
|
}
|
|
93
|
-
} else {
|
|
94
|
-
console.log('❌ Puppeteer MCP Claude is not installed');
|
|
95
|
-
console.log(' Run: npx puppeteer-mcp-claude install');
|
|
96
125
|
}
|
|
97
|
-
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
});
|
|
126
|
+
} else if (config.type === 'code') {
|
|
127
|
+
// Check if Claude Code is installed
|
|
128
|
+
try {
|
|
129
|
+
execSync('which claude', { stdio: 'ignore' });
|
|
130
|
+
return true;
|
|
131
|
+
} catch {
|
|
132
|
+
return false;
|
|
105
133
|
}
|
|
106
|
-
|
|
107
|
-
} catch (error) {
|
|
108
|
-
console.error('❌ Failed to read configuration:', error.message);
|
|
109
134
|
}
|
|
135
|
+
return false;
|
|
110
136
|
}
|
|
111
137
|
|
|
112
|
-
async
|
|
113
|
-
|
|
138
|
+
async installForConfig(config) {
|
|
139
|
+
console.log(`📝 Configuring ${config.name}...`);
|
|
114
140
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
141
|
+
// Ensure directory exists
|
|
142
|
+
const configDir = path.dirname(config.path);
|
|
143
|
+
if (!existsSync(configDir)) {
|
|
144
|
+
console.log(`📁 Creating directory: ${configDir}`);
|
|
145
|
+
mkdirSync(configDir, { recursive: true });
|
|
118
146
|
}
|
|
119
147
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
async updateClaudeConfig() {
|
|
124
|
-
console.log('📝 Updating Claude Code configuration...');
|
|
125
|
-
|
|
126
|
-
let config = {};
|
|
148
|
+
// Read or create config
|
|
149
|
+
let claudeConfig = {};
|
|
127
150
|
let hasExistingConfig = false;
|
|
128
151
|
|
|
129
|
-
|
|
130
|
-
if (existsSync(this.claudeConfigPath)) {
|
|
152
|
+
if (existsSync(config.path)) {
|
|
131
153
|
try {
|
|
132
|
-
const configContent = readFileSync(
|
|
133
|
-
|
|
154
|
+
const configContent = readFileSync(config.path, 'utf8');
|
|
155
|
+
claudeConfig = JSON.parse(configContent);
|
|
134
156
|
hasExistingConfig = true;
|
|
135
|
-
console.log(
|
|
157
|
+
console.log(`📖 Found existing configuration`);
|
|
136
158
|
} catch (error) {
|
|
137
|
-
console.log(
|
|
138
|
-
|
|
159
|
+
console.log(`⚠️ Could not parse existing config, creating new one`);
|
|
160
|
+
claudeConfig = {};
|
|
139
161
|
}
|
|
140
162
|
}
|
|
141
163
|
|
|
142
164
|
// Initialize mcpServers if it doesn't exist
|
|
143
|
-
if (!
|
|
144
|
-
|
|
165
|
+
if (!claudeConfig.mcpServers) {
|
|
166
|
+
claudeConfig.mcpServers = {};
|
|
145
167
|
}
|
|
146
168
|
|
|
147
|
-
// Check if server already exists
|
|
148
|
-
if (
|
|
149
|
-
console.log(
|
|
150
|
-
console.log(' Updating existing configuration...');
|
|
169
|
+
// Check if our server already exists
|
|
170
|
+
if (claudeConfig.mcpServers[this.serverName]) {
|
|
171
|
+
console.log(`⚠️ Puppeteer MCP already configured, updating...`);
|
|
151
172
|
}
|
|
152
173
|
|
|
153
|
-
// Get the globally installed package location
|
|
154
|
-
const globalPackageDir = this.getGlobalPackageDir();
|
|
155
|
-
|
|
156
174
|
// Add/update our MCP server configuration
|
|
157
|
-
|
|
175
|
+
claudeConfig.mcpServers[this.serverName] = {
|
|
158
176
|
command: 'npx',
|
|
159
177
|
args: ['puppeteer-mcp-claude', 'serve'],
|
|
160
178
|
env: {
|
|
@@ -163,76 +181,130 @@ class PuppeteerMCPInstaller {
|
|
|
163
181
|
};
|
|
164
182
|
|
|
165
183
|
// Write the updated configuration
|
|
166
|
-
writeFileSync(
|
|
184
|
+
writeFileSync(config.path, JSON.stringify(claudeConfig, null, 2));
|
|
167
185
|
|
|
168
186
|
if (hasExistingConfig) {
|
|
169
|
-
console.log(
|
|
187
|
+
console.log(`✅ Configuration updated: ${config.path}`);
|
|
170
188
|
} else {
|
|
171
|
-
console.log(
|
|
189
|
+
console.log(`✅ Configuration created: ${config.path}`);
|
|
172
190
|
}
|
|
173
|
-
}
|
|
174
191
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
// Try to get the package directory from npm
|
|
178
|
-
const npmRoot = execSync('npm root -g', { encoding: 'utf8' }).trim();
|
|
179
|
-
const packagePath = join(npmRoot, 'puppeteer-mcp-claude');
|
|
180
|
-
|
|
181
|
-
if (existsSync(packagePath)) {
|
|
182
|
-
return packagePath;
|
|
183
|
-
}
|
|
184
|
-
} catch (error) {
|
|
185
|
-
// Fallback: use the current package directory
|
|
186
|
-
console.log('⚠️ Using local package directory as fallback');
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return this.packageDir;
|
|
192
|
+
// Verify the installation
|
|
193
|
+
await this.verifyInstallationForConfig(config, claudeConfig);
|
|
190
194
|
}
|
|
191
195
|
|
|
192
|
-
async
|
|
193
|
-
console.log(
|
|
196
|
+
async verifyInstallationForConfig(config, claudeConfig) {
|
|
197
|
+
console.log(`🔍 Verifying ${config.name} installation...`);
|
|
194
198
|
|
|
195
|
-
// Check if config file exists and is valid
|
|
196
|
-
if (!existsSync(this.claudeConfigPath)) {
|
|
197
|
-
throw new Error('Configuration file was not created');
|
|
198
|
-
}
|
|
199
|
-
|
|
200
199
|
try {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (!config.mcpServers?.[this.serverName]) {
|
|
205
|
-
throw new Error('Puppeteer MCP Claude not found in configuration');
|
|
200
|
+
if (!claudeConfig.mcpServers?.[this.serverName]) {
|
|
201
|
+
throw new Error(`${this.serverName} not found in configuration`);
|
|
206
202
|
}
|
|
207
203
|
|
|
208
|
-
const serverConfig =
|
|
204
|
+
const serverConfig = claudeConfig.mcpServers[this.serverName];
|
|
209
205
|
|
|
210
|
-
// Verify configuration structure
|
|
211
206
|
if (!serverConfig.command || !serverConfig.args) {
|
|
212
207
|
throw new Error('Incomplete MCP server configuration');
|
|
213
208
|
}
|
|
214
209
|
|
|
215
|
-
//
|
|
216
|
-
let serverInfo = '';
|
|
210
|
+
// For npx commands, verify structure
|
|
217
211
|
if (serverConfig.command === 'npx' && serverConfig.args[0] === 'puppeteer-mcp-claude') {
|
|
218
|
-
|
|
219
|
-
console.log('✅ NPX configuration verified');
|
|
220
|
-
serverInfo = `${serverConfig.command} ${serverConfig.args.join(' ')}`;
|
|
212
|
+
console.log(`✅ ${config.name} configuration verified`);
|
|
221
213
|
} else {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
214
|
+
throw new Error('Invalid server configuration');
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
} catch (error) {
|
|
218
|
+
throw new Error(`${config.name} verification failed: ${error.message}`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
async uninstall() {
|
|
223
|
+
console.log('🗑️ Uninstalling Puppeteer MCP Claude...\n');
|
|
224
|
+
|
|
225
|
+
let removedCount = 0;
|
|
226
|
+
|
|
227
|
+
for (const config of this.configs) {
|
|
228
|
+
if (existsSync(config.path)) {
|
|
229
|
+
try {
|
|
230
|
+
const configContent = readFileSync(config.path, 'utf8');
|
|
231
|
+
const claudeConfig = JSON.parse(configContent);
|
|
232
|
+
|
|
233
|
+
if (claudeConfig.mcpServers?.[this.serverName]) {
|
|
234
|
+
delete claudeConfig.mcpServers[this.serverName];
|
|
235
|
+
writeFileSync(config.path, JSON.stringify(claudeConfig, null, 2));
|
|
236
|
+
console.log(`✅ Removed from ${config.name}`);
|
|
237
|
+
removedCount++;
|
|
238
|
+
} else {
|
|
239
|
+
console.log(`⚪ Not configured in ${config.name}`);
|
|
240
|
+
}
|
|
241
|
+
} catch (error) {
|
|
242
|
+
console.error(`❌ Failed to remove from ${config.name}:`, error.message);
|
|
226
243
|
}
|
|
227
|
-
|
|
228
|
-
|
|
244
|
+
} else {
|
|
245
|
+
console.log(`⚪ ${config.name} config not found`);
|
|
229
246
|
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (removedCount > 0) {
|
|
250
|
+
console.log(`\n✅ Puppeteer MCP Claude removed from ${removedCount} configuration(s)`);
|
|
251
|
+
console.log(' Restart Claude applications to complete removal');
|
|
252
|
+
} else {
|
|
253
|
+
console.log('\n⚠️ Puppeteer MCP Claude was not found in any configurations');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
async status() {
|
|
258
|
+
console.log('📊 Puppeteer MCP Claude Status\n');
|
|
259
|
+
|
|
260
|
+
let foundCount = 0;
|
|
261
|
+
|
|
262
|
+
for (const config of this.configs) {
|
|
263
|
+
console.log(`📱 ${config.name}:`);
|
|
230
264
|
|
|
231
|
-
|
|
232
|
-
|
|
265
|
+
if (!existsSync(config.path)) {
|
|
266
|
+
console.log(` ❌ No configuration found`);
|
|
267
|
+
console.log(` 📁 Config path: ${config.path}`);
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
try {
|
|
272
|
+
const configContent = readFileSync(config.path, 'utf8');
|
|
273
|
+
const claudeConfig = JSON.parse(configContent);
|
|
274
|
+
|
|
275
|
+
if (claudeConfig.mcpServers?.[this.serverName]) {
|
|
276
|
+
console.log(` ✅ Puppeteer MCP Claude is installed`);
|
|
277
|
+
foundCount++;
|
|
278
|
+
|
|
279
|
+
const serverConfig = claudeConfig.mcpServers[this.serverName];
|
|
280
|
+
console.log(` 📋 Command: ${serverConfig.command} ${serverConfig.args?.join(' ') || ''}`);
|
|
281
|
+
console.log(` 🌍 Environment: ${JSON.stringify(serverConfig.env || {})}`);
|
|
282
|
+
|
|
283
|
+
// Show app detection
|
|
284
|
+
const appDetected = await this.detectClaudeApp(config);
|
|
285
|
+
console.log(` 🔍 App detected: ${appDetected ? '✅ Yes' : '❌ No'}`);
|
|
286
|
+
} else {
|
|
287
|
+
console.log(` ❌ Puppeteer MCP Claude is not installed`);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Show all MCP servers for this config
|
|
291
|
+
if (claudeConfig.mcpServers && Object.keys(claudeConfig.mcpServers).length > 0) {
|
|
292
|
+
console.log(` 📋 All MCP servers: ${Object.keys(claudeConfig.mcpServers).map(name =>
|
|
293
|
+
name === this.serverName ? `${name} ← (this package)` : name
|
|
294
|
+
).join(', ')}`);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
} catch (error) {
|
|
298
|
+
console.error(` ❌ Failed to read configuration: ${error.message}`);
|
|
299
|
+
}
|
|
233
300
|
|
|
234
|
-
|
|
235
|
-
|
|
301
|
+
console.log(); // Empty line between configs
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (foundCount === 0) {
|
|
305
|
+
console.log('💡 To install, run: npx puppeteer-mcp-claude install');
|
|
306
|
+
} else {
|
|
307
|
+
console.log(`✅ Installed in ${foundCount} of ${this.configs.length} possible locations`);
|
|
236
308
|
}
|
|
237
309
|
}
|
|
238
310
|
|
|
@@ -260,14 +332,107 @@ class PuppeteerMCPInstaller {
|
|
|
260
332
|
});
|
|
261
333
|
}
|
|
262
334
|
|
|
335
|
+
async startChrome(port = 9222, userDataDir = null) {
|
|
336
|
+
console.log(`🚀 Starting Chrome with remote debugging on port ${port}...\n`);
|
|
337
|
+
|
|
338
|
+
const os = platform();
|
|
339
|
+
let chromePath;
|
|
340
|
+
|
|
341
|
+
// Find Chrome executable
|
|
342
|
+
if (os === 'darwin') {
|
|
343
|
+
chromePath = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
|
|
344
|
+
if (!existsSync(chromePath)) {
|
|
345
|
+
chromePath = '/Applications/Chromium.app/Contents/MacOS/Chromium';
|
|
346
|
+
}
|
|
347
|
+
} else if (os === 'linux') {
|
|
348
|
+
try {
|
|
349
|
+
chromePath = execSync('which google-chrome', { encoding: 'utf8' }).trim();
|
|
350
|
+
} catch {
|
|
351
|
+
try {
|
|
352
|
+
chromePath = execSync('which chromium-browser', { encoding: 'utf8' }).trim();
|
|
353
|
+
} catch {
|
|
354
|
+
chromePath = execSync('which chromium', { encoding: 'utf8' }).trim();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
} else if (os === 'win32') {
|
|
358
|
+
const possiblePaths = [
|
|
359
|
+
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
|
|
360
|
+
'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
|
|
361
|
+
join(homedir(), 'AppData\\Local\\Google\\Chrome\\Application\\chrome.exe')
|
|
362
|
+
];
|
|
363
|
+
chromePath = possiblePaths.find(p => existsSync(p));
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (!chromePath || !existsSync(chromePath)) {
|
|
367
|
+
console.error('❌ Chrome/Chromium not found. Please install Chrome or Chromium.');
|
|
368
|
+
process.exit(1);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Set up user data directory
|
|
372
|
+
if (!userDataDir) {
|
|
373
|
+
userDataDir = join(homedir(), '.chrome-debug-data');
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (!existsSync(userDataDir)) {
|
|
377
|
+
mkdirSync(userDataDir, { recursive: true });
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// Chrome arguments
|
|
381
|
+
const chromeArgs = [
|
|
382
|
+
`--remote-debugging-port=${port}`,
|
|
383
|
+
`--user-data-dir=${userDataDir}`,
|
|
384
|
+
'--no-first-run',
|
|
385
|
+
'--no-default-browser-check',
|
|
386
|
+
'--disable-default-apps',
|
|
387
|
+
'--disable-popup-blocking',
|
|
388
|
+
'--disable-translate',
|
|
389
|
+
'--disable-background-timer-throttling',
|
|
390
|
+
'--disable-backgrounding-occluded-windows',
|
|
391
|
+
'--disable-renderer-backgrounding'
|
|
392
|
+
];
|
|
393
|
+
|
|
394
|
+
console.log(`📂 User data directory: ${userDataDir}`);
|
|
395
|
+
console.log(`🌐 Debug endpoint: http://localhost:${port}`);
|
|
396
|
+
console.log(`🔗 WebSocket endpoint: ws://localhost:${port}`);
|
|
397
|
+
console.log(`\n💡 To connect from MCP, use browserWSEndpoint: "ws://localhost:${port}"\n`);
|
|
398
|
+
|
|
399
|
+
// Launch Chrome
|
|
400
|
+
const chrome = spawn(chromePath, chromeArgs, {
|
|
401
|
+
stdio: 'ignore',
|
|
402
|
+
detached: true
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
chrome.on('error', (error) => {
|
|
406
|
+
console.error('❌ Failed to start Chrome:', error);
|
|
407
|
+
process.exit(1);
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
// Don't wait for Chrome to exit, let it run in background
|
|
411
|
+
chrome.unref();
|
|
412
|
+
|
|
413
|
+
console.log(`✅ Chrome started successfully with PID ${chrome.pid}`);
|
|
414
|
+
console.log('🚪 Chrome is running in the background. Close manually when done.');
|
|
415
|
+
|
|
416
|
+
// Give Chrome a moment to start
|
|
417
|
+
setTimeout(() => {
|
|
418
|
+
console.log('\n🔧 You can now use the MCP server with:');
|
|
419
|
+
console.log(' puppeteer_launch with browserWSEndpoint: "ws://localhost:9222"');
|
|
420
|
+
}, 2000);
|
|
421
|
+
}
|
|
422
|
+
|
|
263
423
|
showHelp() {
|
|
264
|
-
console.log('🤖 Puppeteer MCP Claude - Browser Automation for Claude Code\n');
|
|
424
|
+
console.log('🤖 Puppeteer MCP Claude - Browser Automation for Claude Desktop & Code\n');
|
|
265
425
|
console.log('Usage:');
|
|
266
|
-
console.log(' npx puppeteer-mcp-claude install # Install
|
|
267
|
-
console.log(' npx puppeteer-mcp-claude uninstall # Remove
|
|
426
|
+
console.log(' npx puppeteer-mcp-claude install # Install for Claude Desktop & Code');
|
|
427
|
+
console.log(' npx puppeteer-mcp-claude uninstall # Remove from all Claude apps');
|
|
268
428
|
console.log(' npx puppeteer-mcp-claude status # Check installation status');
|
|
269
429
|
console.log(' npx puppeteer-mcp-claude serve # Start the MCP server (used internally)');
|
|
430
|
+
console.log(' npx puppeteer-mcp-claude chrome # Start Chrome with remote debugging');
|
|
270
431
|
console.log(' npx puppeteer-mcp-claude help # Show this help message');
|
|
432
|
+
console.log('\n🖥️ Supported Platforms:');
|
|
433
|
+
console.log(' • macOS - Claude Desktop + Claude Code');
|
|
434
|
+
console.log(' • Linux - Claude Desktop + Claude Code');
|
|
435
|
+
console.log(' • Windows - Claude Code only');
|
|
271
436
|
console.log('\nAvailable Browser Tools:');
|
|
272
437
|
console.log(' • puppeteer_launch - Launch browser instance');
|
|
273
438
|
console.log(' • puppeteer_new_page - Create new browser tab');
|
|
@@ -280,6 +445,14 @@ class PuppeteerMCPInstaller {
|
|
|
280
445
|
console.log(' • puppeteer_wait_for_selector - Wait for elements');
|
|
281
446
|
console.log(' • puppeteer_close_page - Close browser tab');
|
|
282
447
|
console.log(' • puppeteer_close_browser - Close entire browser');
|
|
448
|
+
console.log(' • puppeteer_set_cookies - Manage cookies');
|
|
449
|
+
console.log(' • puppeteer_get_cookies - Read cookies');
|
|
450
|
+
console.log(' • puppeteer_delete_cookies - Delete cookies');
|
|
451
|
+
console.log(' • puppeteer_set_request_interception - Block/modify requests');
|
|
452
|
+
console.log('\n🌐 Chrome Remote Debugging:');
|
|
453
|
+
console.log(' npx puppeteer-mcp-claude chrome [port] [dataDir]');
|
|
454
|
+
console.log(' Example: npx puppeteer-mcp-claude chrome 9222');
|
|
455
|
+
console.log(' Then use browserWSEndpoint: "ws://localhost:9222" in puppeteer_launch');
|
|
283
456
|
console.log('\nDocumentation: https://github.com/jaenster/puppeteer-mcp-claude');
|
|
284
457
|
console.log('Issues: https://github.com/jaenster/puppeteer-mcp-claude/issues');
|
|
285
458
|
}
|
|
@@ -303,6 +476,11 @@ async function main() {
|
|
|
303
476
|
case 'serve':
|
|
304
477
|
await installer.serve();
|
|
305
478
|
break;
|
|
479
|
+
case 'chrome':
|
|
480
|
+
const port = process.argv[3] ? parseInt(process.argv[3]) : 9222;
|
|
481
|
+
const userDataDir = process.argv[4] || null;
|
|
482
|
+
await installer.startChrome(port, userDataDir);
|
|
483
|
+
break;
|
|
306
484
|
case 'help':
|
|
307
485
|
case '--help':
|
|
308
486
|
case '-h':
|
package/dist/index.js
CHANGED
|
@@ -42,12 +42,37 @@ class PuppeteerMCPServer {
|
|
|
42
42
|
tools: [
|
|
43
43
|
{
|
|
44
44
|
name: 'puppeteer_launch',
|
|
45
|
-
description: 'Launch a new Puppeteer browser instance',
|
|
45
|
+
description: 'Launch a new Puppeteer browser instance or connect to existing Chrome with remote debugging',
|
|
46
46
|
inputSchema: {
|
|
47
47
|
type: 'object',
|
|
48
48
|
properties: {
|
|
49
49
|
headless: { type: 'boolean', default: true },
|
|
50
50
|
args: { type: 'array', items: { type: 'string' } },
|
|
51
|
+
executablePath: { type: 'string', description: 'Path to Chrome executable' },
|
|
52
|
+
browserWSEndpoint: { type: 'string', description: 'WebSocket endpoint for existing Chrome instance (e.g., ws://localhost:9222)' },
|
|
53
|
+
userDataDir: { type: 'string', description: 'Path to user data directory' },
|
|
54
|
+
userAgent: { type: 'string', description: 'Custom user agent string' },
|
|
55
|
+
viewport: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
width: { type: 'number', default: 1366 },
|
|
59
|
+
height: { type: 'number', default: 768 },
|
|
60
|
+
deviceScaleFactor: { type: 'number', default: 1 },
|
|
61
|
+
isMobile: { type: 'boolean', default: false },
|
|
62
|
+
hasTouch: { type: 'boolean', default: false },
|
|
63
|
+
isLandscape: { type: 'boolean', default: true }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
proxy: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
server: { type: 'string' },
|
|
70
|
+
username: { type: 'string' },
|
|
71
|
+
password: { type: 'string' }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
stealth: { type: 'boolean', default: false, description: 'Enable stealth mode to avoid detection' },
|
|
75
|
+
slowMo: { type: 'number', description: 'Delay between actions in milliseconds' }
|
|
51
76
|
},
|
|
52
77
|
},
|
|
53
78
|
},
|
|
@@ -169,6 +194,90 @@ class PuppeteerMCPServer {
|
|
|
169
194
|
properties: {},
|
|
170
195
|
},
|
|
171
196
|
},
|
|
197
|
+
{
|
|
198
|
+
name: 'puppeteer_set_cookies',
|
|
199
|
+
description: 'Set cookies for a page',
|
|
200
|
+
inputSchema: {
|
|
201
|
+
type: 'object',
|
|
202
|
+
properties: {
|
|
203
|
+
pageId: { type: 'string' },
|
|
204
|
+
cookies: {
|
|
205
|
+
type: 'array',
|
|
206
|
+
items: {
|
|
207
|
+
type: 'object',
|
|
208
|
+
properties: {
|
|
209
|
+
name: { type: 'string' },
|
|
210
|
+
value: { type: 'string' },
|
|
211
|
+
domain: { type: 'string' },
|
|
212
|
+
path: { type: 'string', default: '/' },
|
|
213
|
+
expires: { type: 'number' },
|
|
214
|
+
httpOnly: { type: 'boolean', default: false },
|
|
215
|
+
secure: { type: 'boolean', default: false },
|
|
216
|
+
sameSite: { type: 'string', enum: ['Strict', 'Lax', 'None'] }
|
|
217
|
+
},
|
|
218
|
+
required: ['name', 'value']
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
required: ['pageId', 'cookies'],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'puppeteer_get_cookies',
|
|
227
|
+
description: 'Get cookies from a page',
|
|
228
|
+
inputSchema: {
|
|
229
|
+
type: 'object',
|
|
230
|
+
properties: {
|
|
231
|
+
pageId: { type: 'string' },
|
|
232
|
+
urls: { type: 'array', items: { type: 'string' } }
|
|
233
|
+
},
|
|
234
|
+
required: ['pageId'],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'puppeteer_delete_cookies',
|
|
239
|
+
description: 'Delete cookies from a page',
|
|
240
|
+
inputSchema: {
|
|
241
|
+
type: 'object',
|
|
242
|
+
properties: {
|
|
243
|
+
pageId: { type: 'string' },
|
|
244
|
+
cookies: {
|
|
245
|
+
type: 'array',
|
|
246
|
+
items: {
|
|
247
|
+
type: 'object',
|
|
248
|
+
properties: {
|
|
249
|
+
name: { type: 'string' },
|
|
250
|
+
domain: { type: 'string' },
|
|
251
|
+
path: { type: 'string' }
|
|
252
|
+
},
|
|
253
|
+
required: ['name']
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
required: ['pageId', 'cookies'],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'puppeteer_set_request_interception',
|
|
262
|
+
description: 'Enable request/response interception for a page',
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: 'object',
|
|
265
|
+
properties: {
|
|
266
|
+
pageId: { type: 'string' },
|
|
267
|
+
enable: { type: 'boolean', default: true },
|
|
268
|
+
blockResources: {
|
|
269
|
+
type: 'array',
|
|
270
|
+
items: { type: 'string', enum: ['document', 'stylesheet', 'image', 'media', 'font', 'script', 'texttrack', 'xhr', 'fetch', 'eventsource', 'websocket', 'manifest', 'other'] },
|
|
271
|
+
description: 'Resource types to block'
|
|
272
|
+
},
|
|
273
|
+
modifyHeaders: {
|
|
274
|
+
type: 'object',
|
|
275
|
+
description: 'Headers to add/modify in requests'
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
required: ['pageId'],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
172
281
|
],
|
|
173
282
|
};
|
|
174
283
|
});
|
|
@@ -198,6 +307,14 @@ class PuppeteerMCPServer {
|
|
|
198
307
|
return await this.handleClosePage(args);
|
|
199
308
|
case 'puppeteer_close_browser':
|
|
200
309
|
return await this.handleCloseBrowser(args);
|
|
310
|
+
case 'puppeteer_set_cookies':
|
|
311
|
+
return await this.handleSetCookies(args);
|
|
312
|
+
case 'puppeteer_get_cookies':
|
|
313
|
+
return await this.handleGetCookies(args);
|
|
314
|
+
case 'puppeteer_delete_cookies':
|
|
315
|
+
return await this.handleDeleteCookies(args);
|
|
316
|
+
case 'puppeteer_set_request_interception':
|
|
317
|
+
return await this.handleSetRequestInterception(args);
|
|
201
318
|
default:
|
|
202
319
|
throw new Error(`Unknown tool: ${name}`);
|
|
203
320
|
}
|
|
@@ -215,19 +332,79 @@ class PuppeteerMCPServer {
|
|
|
215
332
|
});
|
|
216
333
|
}
|
|
217
334
|
async handleLaunch(args) {
|
|
218
|
-
const { headless = true, args: browserArgs = [] } = args;
|
|
335
|
+
const { headless = true, args: browserArgs = [], executablePath, browserWSEndpoint, userDataDir, userAgent, viewport, proxy, stealth = false, slowMo } = args;
|
|
219
336
|
if (this.browser) {
|
|
220
337
|
await this.browser.close();
|
|
221
338
|
}
|
|
222
|
-
|
|
339
|
+
let launchOptions = {
|
|
223
340
|
headless,
|
|
341
|
+
slowMo,
|
|
224
342
|
args: [...browserArgs, '--no-sandbox', '--disable-setuid-sandbox'],
|
|
225
|
-
}
|
|
343
|
+
};
|
|
344
|
+
if (executablePath) {
|
|
345
|
+
launchOptions.executablePath = executablePath;
|
|
346
|
+
}
|
|
347
|
+
if (userDataDir) {
|
|
348
|
+
launchOptions.userDataDir = userDataDir;
|
|
349
|
+
}
|
|
350
|
+
if (stealth) {
|
|
351
|
+
launchOptions.args.push('--disable-blink-features=AutomationControlled', '--disable-features=VizDisplayCompositor', '--disable-web-security', '--disable-features=site-per-process', '--disable-dev-shm-usage', '--disable-background-timer-throttling', '--disable-backgrounding-occluded-windows', '--disable-renderer-backgrounding', '--disable-extensions', '--no-first-run', '--no-default-browser-check', '--disable-default-apps', '--disable-popup-blocking');
|
|
352
|
+
}
|
|
353
|
+
if (proxy?.server) {
|
|
354
|
+
launchOptions.args.push(`--proxy-server=${proxy.server}`);
|
|
355
|
+
}
|
|
356
|
+
if (browserWSEndpoint) {
|
|
357
|
+
this.browser = await puppeteer_1.default.connect({
|
|
358
|
+
browserWSEndpoint,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
this.browser = await puppeteer_1.default.launch(launchOptions);
|
|
363
|
+
}
|
|
364
|
+
if (viewport || userAgent || stealth) {
|
|
365
|
+
const pages = await this.browser.pages();
|
|
366
|
+
if (pages.length > 0) {
|
|
367
|
+
const page = pages[0];
|
|
368
|
+
if (viewport) {
|
|
369
|
+
await page.setViewport(viewport);
|
|
370
|
+
}
|
|
371
|
+
if (userAgent) {
|
|
372
|
+
await page.setUserAgent(userAgent);
|
|
373
|
+
}
|
|
374
|
+
else if (stealth) {
|
|
375
|
+
await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36');
|
|
376
|
+
}
|
|
377
|
+
if (stealth) {
|
|
378
|
+
await page.evaluateOnNewDocument(`() => {
|
|
379
|
+
Object.defineProperty(navigator, 'webdriver', {
|
|
380
|
+
get: () => undefined,
|
|
381
|
+
configurable: true
|
|
382
|
+
});
|
|
383
|
+
Object.defineProperty(navigator, 'plugins', {
|
|
384
|
+
get: () => [1, 2, 3, 4, 5],
|
|
385
|
+
configurable: true
|
|
386
|
+
});
|
|
387
|
+
Object.defineProperty(navigator, 'languages', {
|
|
388
|
+
get: () => ['en-US', 'en'],
|
|
389
|
+
configurable: true
|
|
390
|
+
});
|
|
391
|
+
window.chrome = { runtime: {} };
|
|
392
|
+
Object.defineProperty(navigator, 'permissions', {
|
|
393
|
+
get: () => ({
|
|
394
|
+
query: () => Promise.resolve({ state: 'granted' })
|
|
395
|
+
}),
|
|
396
|
+
configurable: true
|
|
397
|
+
});
|
|
398
|
+
}`);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
const connectionMethod = browserWSEndpoint ? 'Connected to existing browser' : 'Browser launched';
|
|
226
403
|
return {
|
|
227
404
|
content: [
|
|
228
405
|
{
|
|
229
406
|
type: 'text',
|
|
230
|
-
text:
|
|
407
|
+
text: `${connectionMethod} successfully`,
|
|
231
408
|
},
|
|
232
409
|
],
|
|
233
410
|
};
|
|
@@ -400,6 +577,81 @@ class PuppeteerMCPServer {
|
|
|
400
577
|
],
|
|
401
578
|
};
|
|
402
579
|
}
|
|
580
|
+
async handleSetCookies(args) {
|
|
581
|
+
const { pageId, cookies } = args;
|
|
582
|
+
const page = this.pages.get(pageId);
|
|
583
|
+
if (!page) {
|
|
584
|
+
throw new Error(`Page ${pageId} not found`);
|
|
585
|
+
}
|
|
586
|
+
await page.setCookie(...cookies);
|
|
587
|
+
return {
|
|
588
|
+
content: [
|
|
589
|
+
{
|
|
590
|
+
type: 'text',
|
|
591
|
+
text: `Set ${cookies.length} cookie(s) for page ${pageId}`,
|
|
592
|
+
},
|
|
593
|
+
],
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
async handleGetCookies(args) {
|
|
597
|
+
const { pageId, urls } = args;
|
|
598
|
+
const page = this.pages.get(pageId);
|
|
599
|
+
if (!page) {
|
|
600
|
+
throw new Error(`Page ${pageId} not found`);
|
|
601
|
+
}
|
|
602
|
+
const cookies = urls ? await page.cookies(...urls) : await page.cookies();
|
|
603
|
+
return {
|
|
604
|
+
content: [
|
|
605
|
+
{
|
|
606
|
+
type: 'text',
|
|
607
|
+
text: `Retrieved cookies: ${JSON.stringify(cookies, null, 2)}`,
|
|
608
|
+
},
|
|
609
|
+
],
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
async handleDeleteCookies(args) {
|
|
613
|
+
const { pageId, cookies } = args;
|
|
614
|
+
const page = this.pages.get(pageId);
|
|
615
|
+
if (!page) {
|
|
616
|
+
throw new Error(`Page ${pageId} not found`);
|
|
617
|
+
}
|
|
618
|
+
await page.deleteCookie(...cookies);
|
|
619
|
+
return {
|
|
620
|
+
content: [
|
|
621
|
+
{
|
|
622
|
+
type: 'text',
|
|
623
|
+
text: `Deleted ${cookies.length} cookie(s) from page ${pageId}`,
|
|
624
|
+
},
|
|
625
|
+
],
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
async handleSetRequestInterception(args) {
|
|
629
|
+
const { pageId, enable = true, blockResources = [], modifyHeaders = {} } = args;
|
|
630
|
+
const page = this.pages.get(pageId);
|
|
631
|
+
if (!page) {
|
|
632
|
+
throw new Error(`Page ${pageId} not found`);
|
|
633
|
+
}
|
|
634
|
+
await page.setRequestInterception(enable);
|
|
635
|
+
if (enable) {
|
|
636
|
+
page.on('request', (request) => {
|
|
637
|
+
const resourceType = request.resourceType();
|
|
638
|
+
if (blockResources.includes(resourceType)) {
|
|
639
|
+
request.abort();
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
const headers = { ...request.headers(), ...modifyHeaders };
|
|
643
|
+
request.continue({ headers });
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
return {
|
|
647
|
+
content: [
|
|
648
|
+
{
|
|
649
|
+
type: 'text',
|
|
650
|
+
text: `Request interception ${enable ? 'enabled' : 'disabled'} for page ${pageId}`,
|
|
651
|
+
},
|
|
652
|
+
],
|
|
653
|
+
};
|
|
654
|
+
}
|
|
403
655
|
async run() {
|
|
404
656
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
405
657
|
await this.server.connect(transport);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceR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