puppeteer-mcp-claude 0.0.1 ā 0.1.0
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 +224 -148
- 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
|
|
|
@@ -261,13 +333,17 @@ class PuppeteerMCPInstaller {
|
|
|
261
333
|
}
|
|
262
334
|
|
|
263
335
|
showHelp() {
|
|
264
|
-
console.log('š¤ Puppeteer MCP Claude - Browser Automation for Claude Code\n');
|
|
336
|
+
console.log('š¤ Puppeteer MCP Claude - Browser Automation for Claude Desktop & Code\n');
|
|
265
337
|
console.log('Usage:');
|
|
266
|
-
console.log(' npx puppeteer-mcp-claude install # Install
|
|
267
|
-
console.log(' npx puppeteer-mcp-claude uninstall # Remove
|
|
338
|
+
console.log(' npx puppeteer-mcp-claude install # Install for Claude Desktop & Code');
|
|
339
|
+
console.log(' npx puppeteer-mcp-claude uninstall # Remove from all Claude apps');
|
|
268
340
|
console.log(' npx puppeteer-mcp-claude status # Check installation status');
|
|
269
341
|
console.log(' npx puppeteer-mcp-claude serve # Start the MCP server (used internally)');
|
|
270
342
|
console.log(' npx puppeteer-mcp-claude help # Show this help message');
|
|
343
|
+
console.log('\nš„ļø Supported Platforms:');
|
|
344
|
+
console.log(' ⢠macOS - Claude Desktop + Claude Code');
|
|
345
|
+
console.log(' ⢠Linux - Claude Desktop + Claude Code');
|
|
346
|
+
console.log(' ⢠Windows - Claude Code only');
|
|
271
347
|
console.log('\nAvailable Browser Tools:');
|
|
272
348
|
console.log(' ⢠puppeteer_launch - Launch browser instance');
|
|
273
349
|
console.log(' ⢠puppeteer_new_page - Create new browser tab');
|