chrome-devtools-mcp-for-extension 0.17.0 → 0.18.1

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 CHANGED
@@ -4,64 +4,54 @@
4
4
 
5
5
  **AI-powered Chrome extension development with automated testing, debugging, and Web Store submission**
6
6
 
7
- System extensions auto-load, development extensions easy to configure.
8
-
9
- **Built for:** Claude Code, Cursor, VS Code Copilot, Cline, and other MCP-compatible AI tools
7
+ Built for: Claude Code, Cursor, VS Code Copilot, Cline, and other MCP-compatible AI tools
10
8
 
11
9
  ---
12
10
 
13
- ## 🎯 Why This Tool?
14
-
15
- ### The Problem
16
- - **Puppeteer/Playwright**: Disable extensions by default, require complex configuration
17
- - **Traditional Testing**: Hours of setup, maintaining separate test profiles
18
- - **Extension Development**: Can't test in real user environments
11
+ ## 📦 For Users: Quick Start
19
12
 
20
- ### The Solution
21
- - ✅ **System extensions auto-load**: Your installed Chrome extensions work automatically
22
- - ✅ **Easy dev extension setup**: Simple `--loadExtensionsDir` configuration for development
23
- - ✅ **Real environment**: Tests with your actual extensions and settings
24
- - ✅ **Independent instance**: Runs alongside your regular Chrome without conflicts
13
+ ### Installation
25
14
 
26
- ---
15
+ **Option 1: Direct execution (recommended)**
16
+ ```bash
17
+ npx chrome-devtools-mcp-for-extension@latest
18
+ ```
27
19
 
28
- ## 🚀 Quick Start
20
+ **Option 2: Global installation**
21
+ ```bash
22
+ npm install -g chrome-devtools-mcp-for-extension
23
+ chrome-devtools-mcp-for-extension
24
+ ```
29
25
 
30
- ### 1. Add Configuration
26
+ ### MCP Configuration
31
27
 
32
- Add the following to `~/.claude.json`:
28
+ Add to your MCP client configuration file:
33
29
 
30
+ **For Claude Code** (`~/.claude.json`):
34
31
  ```json
35
32
  {
36
33
  "mcpServers": {
37
34
  "chrome-devtools-extension": {
38
- "type": "stdio",
39
35
  "command": "npx",
40
- "args": ["chrome-devtools-mcp-for-extension@latest"],
41
- "env": {}
36
+ "args": ["chrome-devtools-mcp-for-extension@latest"]
42
37
  }
43
38
  }
44
39
  }
45
40
  ```
46
41
 
47
- > **Note**: For other MCP clients (Cursor, VS Code Copilot, Cline), add to your client's global configuration file.
42
+ **For other MCP clients** (Cursor, VS Code Copilot, Cline):
43
+ - Refer to your client's MCP configuration documentation
44
+ - Use the same `command` and `args` as above
48
45
 
49
- ### 2. Restart Your AI Client
46
+ ### Test It
50
47
 
51
- ### 3. Test It
48
+ 1. Restart your AI client
49
+ 2. Ask: `"List all my Chrome extensions"`
50
+ 3. ✅ You should see your installed Chrome extensions
52
51
 
53
- Ask your AI:
54
- ```
55
- "List all my Chrome extensions"
56
- ```
52
+ ### Load Development Extensions (Optional)
57
53
 
58
- You should see your installed Chrome extensions
59
-
60
- ---
61
-
62
- ## 🔧 Load Development Extensions (Optional)
63
-
64
- To test your own extensions under development, add `--loadExtensionsDir`:
54
+ To test your own extensions under development:
65
55
 
66
56
  ```json
67
57
  {
@@ -77,581 +67,327 @@ To test your own extensions under development, add `--loadExtensionsDir`:
77
67
  }
78
68
  ```
79
69
 
80
- **Directory structure example:**
70
+ **Directory structure:**
81
71
  ```
82
72
  /path/to/your/extensions/
83
- ├── my-extension-1/
73
+ ├── extension-1/
84
74
  │ └── manifest.json
85
- ├── my-extension-2/
75
+ ├── extension-2/
86
76
  │ └── manifest.json
87
77
  ```
88
78
 
89
- **More options**: See [MCP Configuration Guide](docs/mcp-configuration-guide.md)
90
-
91
79
  ---
92
80
 
93
- ## Core Capabilities
81
+ ## 👨‍💻 For Developers: Contributing
94
82
 
95
- - 🧩 **Extension Development**: Load, debug, and reload Chrome extensions during development
96
- - 🏪 **Automated Web Store Submission**: Complete publishing workflow with form filling and screenshots
97
- - 🔧 **Browser Testing**: Test extensions across real websites with full Chrome functionality
98
- - 🐛 **Advanced Debugging**: Service worker inspection, console monitoring, error detection
99
- - 📸 **Screenshot Generation**: Auto-create store listing images in all required formats
83
+ ### Local Development Setup
100
84
 
101
- ---
102
-
103
- ## 📚 Common Workflows
104
-
105
- ### Create & Test Extension
106
- ```
107
- 1. "Create a Chrome extension that blocks ads on YouTube"
108
- 2. "List extensions to verify it loaded"
109
- 3. "Test the extension on youtube.com"
110
- 4. "Show any errors from the extension"
111
- ```
112
-
113
- ### Debug Extension Issues
114
- ```
115
- 1. "List extensions and show any errors"
116
- 2. "Inspect service worker for my-ad-blocker"
117
- 3. "Show console messages from the extension"
118
- 4. "Reload the extension with latest changes"
119
- ```
120
-
121
- ### Publish to Web Store
122
- ```
123
- 1. "Generate screenshots for my extension"
124
- 2. "Validate my manifest for Web Store compliance"
125
- 3. "Submit my extension to Chrome Web Store"
126
- ```
127
-
128
- ### Performance Testing
129
- ```
130
- 1. "Start performance trace on current page"
131
- 2. "Test the extension's impact on page load"
132
- 3. "Show performance insights"
133
- ```
134
-
135
- ---
136
-
137
- ## 🔍 Check Installed Version
138
-
139
- To verify which version is being used by your AI client:
140
-
141
- ```
142
- "What version of chrome-devtools-mcp-for-extension are you using?"
143
- ```
144
-
145
- The AI will call the tool with `--version` flag to check.
146
-
147
- **Troubleshooting cache issues:**
148
- - If you're not getting the latest version with `@latest`:
149
- - Clear npx cache: `npx clear-npx-cache` or `rm -rf ~/.npm/_npx`
150
- - Or use specific version: `chrome-devtools-mcp-for-extension@0.8.1`
151
- - Restart your AI client completely
152
-
153
- **Direct check (manual):**
85
+ **1. Clone and install:**
154
86
  ```bash
155
- npx chrome-devtools-mcp-for-extension@latest --version
87
+ git clone https://github.com/usedhonda/chrome-devtools-mcp.git
88
+ cd chrome-devtools-mcp
89
+ npm install
90
+ npm run build
156
91
  ```
157
92
 
158
- ---
159
-
160
- ## 🛠️ Extension Development Tools
161
-
162
- Quick reference for the 3 core extension tools:
163
-
164
- | Tool | Purpose | Example Command |
165
- |------|---------|-----------------|
166
- | `list_extensions` | View all extensions with status | "List all my Chrome extensions" |
167
- | `reload_extension` | Hot-reload during development | "Reload my-extension" |
168
- | `inspect_service_worker` | Debug background scripts | "Debug service worker for my-extension" |
169
-
170
-
171
- ---
172
-
173
- ## 📊 How It Compares
174
-
175
- | Feature | This Tool | Puppeteer/Playwright | Original chrome-devtools-mcp |
176
- |---------|-----------|----------------------|------------------------------|
177
- | Extension Support | ✅ Always enabled | ❌ Disabled by default | ⚠️ Manual config required |
178
- | Setup Required | ❌ None | ✅ Complex config files | ✅ Multiple flags needed |
179
- | Real User Profile | ✅ Direct access | ❌ Temporary profiles | ⚠️ Optional |
180
- | Profile Copying | ❌ No copying needed | ⚠️ Manual setup | ⚠️ Manual setup |
181
- | Web Store Automation | ✅ Built-in | ❌ None | ❌ None |
182
- | Extension Debugging | ✅ Service worker + console | ⚠️ Limited | ❌ None |
183
-
184
- ---
185
- <details>
186
- <summary>📖 Detailed Tool Documentation</summary>
187
-
188
- ### `list_extensions` - Extension Inventory
189
- **Purpose**: Comprehensive extension status monitoring
190
- **Technical**: Accesses `chrome://extensions/` via shadow DOM manipulation
191
- **Output**: Extension metadata, enabled/disabled status, version, error detection
192
- **Use Case**: "List all my Chrome extensions" → Shows development and installed extensions
193
-
194
- ### `reload_extension` - Development Hot-Reload
195
- **Purpose**: Streamlined extension development workflow
196
- **Technical**: Finds extensions by name/partial match, triggers reload via Chrome extension API
197
- **Output**: Confirmation of reload success/failure with error details
198
- **Use Case**: "Reload my ad-blocker extension" → Instantly applies code changes
199
-
200
- ### `inspect_service_worker` - Debug Integration
201
- **Purpose**: Deep debugging of extension background processes
202
- **Technical**: Opens DevTools for service workers, supports Manifest V2/V3 architectures
203
- **Output**: Direct DevTools access to extension console, network, sources
204
- **Use Case**: "Debug why my content script isn't working" → Opens debugging interface
205
-
206
- </details>
207
-
208
- ---
209
-
210
- <details>
211
- <summary>⚙️ Advanced Configuration</summary>
212
-
213
- ## Auto-load Development Extension
214
-
215
- Add to `~/.claude.json`:
93
+ **2. Configure MCP client to use local version:**
216
94
 
95
+ Update `~/.claude.json`:
217
96
  ```json
218
97
  {
219
98
  "mcpServers": {
220
99
  "chrome-devtools-extension": {
221
- "type": "stdio",
222
- "command": "npx",
100
+ "command": "node",
223
101
  "args": [
224
- "chrome-devtools-mcp-for-extension@latest",
225
- "--loadExtension=/path/to/your/extension"
226
- ],
227
- "env": {}
102
+ "/absolute/path/to/chrome-devtools-mcp/scripts/cli.mjs",
103
+ "--loadExtensionsDir=/path/to/your/test/extensions"
104
+ ]
228
105
  }
229
106
  }
230
107
  }
231
108
  ```
232
109
 
233
- ⚠️ **Note**: `--loadExtension` flag may be deprecated in Chrome 137+. Using system profile (default) is recommended.
234
-
235
- ## Debug Mode
110
+ **3. Restart your AI client**
236
111
 
237
- Add to `~/.claude.json`:
112
+ ### Development Workflow
238
113
 
239
- ```json
240
- {
241
- "mcpServers": {
242
- "chrome-devtools-extension": {
243
- "type": "stdio",
244
- "command": "npx",
245
- "args": ["chrome-devtools-mcp-for-extension@latest"],
246
- "env": {
247
- "DEBUG": "mcp:*"
248
- }
249
- }
250
- }
251
- }
252
- ```
114
+ **Standard workflow (manual rebuild):**
115
+ ```bash
116
+ # 1. Edit TypeScript files
117
+ vim src/tools/extensions.ts
253
118
 
254
- ## Custom Chrome Channel
119
+ # 2. Build
120
+ npm run build
255
121
 
256
- Add to `~/.claude.json`:
122
+ # 3. Restart AI client
123
+ # Cmd+R in VS Code (or restart your MCP client)
257
124
 
258
- ```json
259
- {
260
- "mcpServers": {
261
- "chrome-devtools-extension": {
262
- "type": "stdio",
263
- "command": "npx",
264
- "args": [
265
- "chrome-devtools-mcp-for-extension@latest",
266
- "--channel=canary"
267
- ],
268
- "env": {}
269
- }
270
- }
271
- }
125
+ # 4. Test changes
126
+ # Ask AI to use the modified tool
272
127
  ```
273
128
 
274
- Options: `stable` (default), `beta`, `dev`, `canary`
275
-
276
- ## Isolated Profile Mode
277
-
278
- Add to `~/.claude.json`:
279
-
280
- ```json
129
+ **Hot-reload workflow (automatic rebuild):**
130
+ ```bash
131
+ # 1. Update MCP configuration to use wrapper
132
+ # Edit ~/.claude.json:
281
133
  {
282
134
  "mcpServers": {
283
135
  "chrome-devtools-extension": {
284
- "type": "stdio",
285
- "command": "npx",
136
+ "command": "node",
286
137
  "args": [
287
- "chrome-devtools-mcp-for-extension@latest",
288
- "--isolated"
138
+ "/absolute/path/to/chrome-devtools-mcp/scripts/mcp-wrapper.mjs"
289
139
  ],
290
- "env": {}
140
+ "cwd": "/absolute/path/to/chrome-devtools-mcp",
141
+ "env": {
142
+ "MCP_ENV": "development"
143
+ }
291
144
  }
292
145
  }
293
146
  }
294
- ```
295
147
 
296
- Forces temporary profile instead of system profile.
148
+ # 2. Restart AI client ONCE (Cmd+R)
297
149
 
298
- </details>
150
+ # 3. Edit TypeScript files
151
+ vim src/tools/extensions.ts
299
152
 
300
- ---
301
-
302
- <details>
303
- <summary>🏗️ Technical Architecture & Implementation</summary>
304
-
305
- ## What Makes This Different
306
-
307
- This fork significantly restructures the original Chrome DevTools MCP for extension-focused development:
308
-
309
- ### System Profile Architecture (v0.6.0+)
310
-
311
- **Zero-Config Design:**
312
- ```typescript
313
- // Automatically detects and uses system Chrome profile
314
- if (!isolated && !userDataDir) {
315
- const systemProfile = detectSystemChromeProfile(channel) || detectAnySystemChromeProfile();
316
-
317
- if (systemProfile) {
318
- userDataDir = systemProfile.path; // Direct access, no copying
319
- usingSystemProfile = true;
320
- }
321
- }
153
+ # 4. Changes automatically rebuild and reload
154
+ # No need to restart AI client!
155
+ # Just test your changes immediately
322
156
  ```
323
157
 
324
- **Profile Paths:**
325
- - macOS: `~/Library/Application Support/Google/Chrome`
326
- - Windows: `%LOCALAPPDATA%\Google\Chrome\User Data`
327
- - Linux: `~/.config/google-chrome`
158
+ **Hot-reload benefits:**
159
+ - Automatic TypeScript compilation (`tsc -w`)
160
+ - Automatic server restart on file changes
161
+ - No VSCode Reload Window needed
162
+ - ✅ 2-5 second feedback loop (vs 20-30 seconds)
328
163
 
329
- **Detection Priority:**
330
- 1. Specified channel (via `--channel` flag)
331
- 2. Fallback: stable → beta → dev → canary
332
- 3. Last resort: Creates temporary isolated profile
164
+ **See also:** [Hot-Reload Setup Guide](docs/hot-reload-setup-guide.md)
333
165
 
334
- ### Extension Loading Architecture
166
+ ### Project Structure
335
167
 
336
- **Unconditional Extension Enablement (v0.6.1+):**
337
- ```typescript
338
- // Always remove --disable-extensions flag
339
- ignoreDefaultArgs: ['--disable-extensions', '--enable-automation']
168
+ ```
169
+ chrome-devtools-mcp/
170
+ ├── src/
171
+ │ ├── tools/ # MCP tool definitions
172
+ │ │ ├── extensions.ts # Extension management (list, reload, debug)
173
+ │ │ ├── chatgpt-web.ts # ChatGPT automation
174
+ │ │ └── ...
175
+ │ ├── browser.ts # Browser/profile management
176
+ │ ├── main.ts # MCP server entry point
177
+ │ └── graceful.ts # Graceful shutdown
178
+ ├── scripts/
179
+ │ ├── cli.mjs # Production entry (users)
180
+ │ ├── mcp-wrapper.mjs # Development wrapper (hot-reload)
181
+ │ └── browser-globals-mock.mjs # Node.js browser globals
182
+ ├── build/ # Compiled JavaScript (gitignored)
183
+ └── docs/ # Documentation
340
184
  ```
341
185
 
342
- **Why this design:**
343
- - Puppeteer's default `--disable-extensions` conflicts with extension development
344
- - Previous versions used conditional logic (buggy, removed in v0.6.1)
345
- - Current approach: **Always enable all extensions** for predictable behavior
346
-
347
- ### Chrome Security Challenges Solved
348
-
349
- #### Chrome 137+ Breaking Changes
350
- - **Problem**: Chrome 137+ disabled `--load-extension` in automation contexts
351
- - **Solution**: Added `--disable-features=DisableLoadExtensionCommandLineSwitch` bypass
352
- - **Impact**: Development extensions can still be loaded via CLI flags
353
-
354
- #### Automation Detection Bypass
355
- - **Problem**: Chrome blocks many operations when detecting automated control
356
- - **Solution**: `--disable-blink-features=AutomationControlled` for real-world testing
357
- - **Use Case**: Google login, OAuth flows, Web Store submission
358
-
359
- #### Profile Management Strategy
360
- - **Default**: Direct system profile access (no copying, instant sync)
361
- - **Fallback**: Temporary profile with bookmarks copy (when Chrome is already running)
362
- - **Override**: `--isolated` flag for completely separate profile
363
-
364
- ### Architecture Diagram
186
+ ### Internal Architecture
365
187
 
188
+ **For users (production):**
366
189
  ```
367
- Extension Development Flow:
368
- ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
369
- │ AI Assistant │───▶│ MCP Server │───▶│ Chrome Browser │
370
- │ (Claude/Cursor) │ │ (Extension Tools)│ │ + Extensions │
371
- └─────────────────┘ └──────────────────┘ └─────────────────┘
372
- │ │
373
- ▼ ▼
374
- ┌──────────────────┐ ┌─────────────────┐
375
- │ Web Store │ │ System Profile │
376
- │ Automation │ │ (Direct Access) │
377
- └──────────────────┘ └─────────────────┘
190
+ npx chrome-devtools-mcp-for-extension@latest
191
+
192
+ scripts/cli.mjs
193
+
194
+ node --import browser-globals-mock.mjs build/src/main.js
195
+
196
+ MCP Server (single process, simple)
378
197
  ```
379
198
 
380
- ### Web Store Automation Tools
381
-
382
- #### Submission Workflow (`submit_to_webstore`)
383
- 1. **Manifest Validation**: Manifest V3 compliance, permission security analysis
384
- 2. **Package Creation**: ZIP generation with optimized compression, development file exclusion
385
- 3. **Store Listing**: Auto-generated descriptions based on manifest permissions
386
- 4. **Browser Automation**: Login flow, form population, file upload, error detection
387
-
388
- #### Screenshot Generation (`generate_extension_screenshots`)
389
- - **Primary**: 1280x800 (Web Store requirement)
390
- - **Promotional Tiles**: Small (440x280), Large (920x680), Marquee (1400x560)
391
- - **Smart Capture**: Extension popup, options page, in-context usage
392
-
393
- ### Manifest Validation System
394
-
395
- ```typescript
396
- interface ManifestValidation {
397
- required: string[]; // name, version, manifest_version
398
- warnings: string[]; // description length, icon sizes
399
- security: string[]; // dangerous permissions analysis
400
- suggestions: string[]; // optimization recommendations
401
- }
199
+ **For developers (hot-reload):**
200
+ ```
201
+ node scripts/mcp-wrapper.mjs (MCP_ENV=development)
202
+
203
+ tsc -w (automatic compilation)
204
+
205
+ chokidar (file watcher)
206
+
207
+ Auto-restart build/src/main.js on changes
208
+
209
+ MCP Server (development mode, 2-5s reload)
402
210
  ```
403
211
 
404
- **Validation Features:**
405
- - Manifest V3 compliance enforcement
406
- - Permission analysis with security implications
407
- - Icon size recommendations (16x16, 48x48, 128x128)
408
- - Service worker file verification
409
- - Host permission optimization suggestions
410
-
411
- ### Added Dependencies
412
- - **archiver** (7.0.1): ZIP package creation for extension submission
413
- - **puppeteer-core** (24.22.3): Chrome automation with extension support
414
- - **@modelcontextprotocol/sdk** (1.18.1): MCP server implementation
212
+ **Key files:**
213
+ - `scripts/cli.mjs`: Simple wrapper for production (loads browser-globals-mock)
214
+ - `scripts/mcp-wrapper.mjs`: Development wrapper (hot-reload with tsc -w)
215
+ - `scripts/browser-globals-mock.mjs`: Polyfills for chrome-devtools-frontend in Node.js
216
+ - `src/main.ts`: Main MCP server (includes fallback browser globals)
415
217
 
416
- ### MCP Server Coexistence
417
- - **Server Name**: `chrome-devtools-extension` (vs original `chrome-devtools`)
418
- - **Package Name**: `chrome-devtools-mcp-for-extension`
419
- - **Purpose**: Allows both servers to run simultaneously for different use cases
218
+ **Why browser-globals-mock?**
219
+ - chrome-devtools-frontend expects browser globals (`location`, `self`, `localStorage`)
220
+ - Node.js doesn't have these globals
221
+ - `--import` flag loads the mock BEFORE any chrome-devtools-frontend modules
420
222
 
421
- </details>
223
+ ### Testing
422
224
 
423
- ---
225
+ ```bash
226
+ # Build
227
+ npm run build
424
228
 
425
- <details>
426
- <summary>👨‍💻 Developer Reference</summary>
229
+ # Type check
230
+ npm run typecheck
427
231
 
428
- ## Supported Extension Types
429
- - **Manifest V3**: Full support (recommended)
430
- - **Service Workers**: Background script debugging
431
- - **Content Scripts**: Page interaction testing
432
- - **Popup Extensions**: UI testing and screenshots
433
- - **Options Pages**: Settings interface validation
232
+ # Run tests
233
+ npm test
434
234
 
435
- ## Browser Compatibility
436
- - **Chrome**: Primary target (latest stable)
437
- - **Chrome Canary**: Development testing
438
- - **Chromium**: Community builds
439
- - **Edge**: Chromium-based versions
235
+ # Format code
236
+ npm run format
237
+ ```
440
238
 
441
- ## Technical Requirements
442
- - **Node.js**: 22.12.0+ (for latest Chrome DevTools Protocol)
443
- - **Chrome**: Any version with extension support
444
- - **Storage**: ~50MB for dependencies
445
- - **Network**: Required for Web Store automation
239
+ ### Publishing (Maintainers Only)
446
240
 
447
- ## Extension Loading Capabilities
448
- - **Startup Loading**: Extensions loaded at Chrome startup via `--loadExtension`
449
- - **System Extensions**: Auto-loads all extensions from Chrome profile (default)
450
- - **Manual Reloading**: Update extensions via `reload_extension` MCP tool
451
- - **Multi-Extension**: Support for multiple extensions simultaneously
241
+ ```bash
242
+ # 1. Update version in package.json
243
+ npm version patch # or minor, major
452
244
 
453
- ⚠️ **Note**: Runtime extension installation not supported. Extensions must be loaded at startup.
245
+ # 2. Build
246
+ npm run build
454
247
 
455
- ## Security & Privacy Considerations
456
- - **System Profile Access**: Uses system Chrome profile by default (includes cookies, sessions, history, bookmarks)
457
- - **Profile Isolation**: Use `--isolated` flag for temporary profile without personal data
458
- - **Extension Sandboxing**: Extension permissions are sandboxed per Chrome security model
459
- - **Web Store Auth**: Uses standard Google OAuth flow (no credentials stored)
248
+ # 3. Test locally
249
+ npx .
460
250
 
461
- ⚠️ **Warning**: When using system profile, the MCP server has access to all data in your Chrome profile. Use `--isolated` mode for testing sensitive operations.
251
+ # 4. Publish to npm
252
+ npm publish
462
253
 
463
- </details>
254
+ # 5. Push to GitHub
255
+ git push && git push --tags
256
+ ```
464
257
 
465
258
  ---
466
259
 
467
- <details>
468
- <summary>❓ Troubleshooting</summary>
260
+ ## ✨ Features
469
261
 
470
- ## Extension Not Loading
262
+ - 🧩 **Extension Development**: Load, debug, and reload Chrome extensions
263
+ - 🏪 **Web Store Automation**: Automated submission with screenshots
264
+ - 🔧 **Browser Testing**: Test extensions in real user environments
265
+ - 🐛 **Advanced Debugging**: Service worker inspection, console monitoring
266
+ - 📸 **Screenshot Generation**: Auto-create store listing images
267
+ - 🤖 **ChatGPT Integration**: Automated ChatGPT interactions for research
471
268
 
472
- **Check manifest.json:**
473
- ```
474
- "List extensions and show any errors"
475
- ```
476
-
477
- **Verify extension is in correct directory:**
478
- - Manifest must be at root: `/your-extension/manifest.json`
479
- - Not: `/your-extension/dist/manifest.json`
269
+ ---
480
270
 
481
- **Solution:**
271
+ ## 📚 Common Workflows
482
272
 
483
- Update `~/.claude.json`:
484
- ```json
485
- {
486
- "mcpServers": {
487
- "chrome-devtools-extension": {
488
- "type": "stdio",
489
- "command": "npx",
490
- "args": [
491
- "chrome-devtools-mcp-for-extension@latest",
492
- "--loadExtension=/correct/path"
493
- ],
494
- "env": {}
495
- }
496
- }
497
- }
273
+ ### Create & Test Extension
274
+ ```
275
+ 1. "Create a Chrome extension that blocks ads"
276
+ 2. "List extensions to verify it loaded"
277
+ 3. "Test the extension on youtube.com"
278
+ 4. "Show any errors from the extension"
498
279
  ```
499
280
 
500
- ## Service Worker Not Inspecting
501
-
502
- **Extension may not be active:**
281
+ ### Debug Extension Issues
503
282
  ```
504
- "List extensions" // Check if enabled
505
- "Reload my-extension" // Restart extension
283
+ 1. "List extensions and show any errors"
284
+ 2. "Inspect service worker for my-ad-blocker"
285
+ 3. "Show console messages"
286
+ 4. "Reload the extension with latest changes"
506
287
  ```
507
288
 
508
- **DevTools window not appearing:**
509
- - Service worker only runs when needed
510
- - Trigger extension action first (click popup, run content script)
511
-
512
- ## Web Store Submission Fails
513
-
514
- **Manifest V3 compliance:**
289
+ ### Publish to Web Store
515
290
  ```
516
- "Validate my manifest for Web Store compliance"
291
+ 1. "Generate screenshots for my extension"
292
+ 2. "Validate manifest for Web Store compliance"
293
+ 3. "Submit to Chrome Web Store"
517
294
  ```
518
295
 
519
- **Common issues:**
520
- - Missing required icons (16x16, 48x48, 128x128)
521
- - Invalid permissions (host_permissions format)
522
- - Service worker not specified
523
-
524
- ## Extensions Disabled After Chrome Update
525
-
526
- **Chrome 137+ breaking change:**
527
- - `--load-extension` may be restricted in newer Chrome versions
528
- - **Solution**: Use system profile (default) instead of `--loadExtension` flag
296
+ ---
529
297
 
530
- ## System Extensions Loading (v0.7.1+)
298
+ ## 🛠️ Core Tools
531
299
 
532
- **How does the MCP server handle Chrome extensions?**
300
+ | Tool | Purpose | Example |
301
+ |------|---------|---------|
302
+ | `list_extensions` | View all extensions | "List my extensions" |
303
+ | `reload_extension` | Hot-reload | "Reload my-extension" |
304
+ | `inspect_service_worker` | Debug background | "Debug service worker" |
305
+ | `ask_chatgpt_web` | ChatGPT research | "Ask ChatGPT about..." |
306
+ | `take_snapshot` | Page analysis | "Snapshot current page" |
307
+ | `list_pages` | Browser tabs | "List open pages" |
533
308
 
534
- The MCP server uses an **isolated profile with `--load-extension`** to provide system extensions while maintaining independence:
309
+ **See also:** [Full Tool Documentation](docs/tools-reference.md)
535
310
 
536
- ### Default Behavior
537
- - ✅ **Independent Chrome Instance**: Runs separately from your main Chrome browser
538
- - ✅ **System Extensions Loaded**: Your installed Chrome extensions are automatically loaded via `--load-extension`
539
- - ✅ **Concurrent Usage**: Works alongside your regular Chrome browser without conflicts
540
- - 🔒 **Isolated Login State**: First launch requires Google login (for security)
541
- - 🔒 **Isolated Profile**: Uses `~/.cache/chrome-devtools-mcp/chrome-profile/`
311
+ ---
542
312
 
543
- ### What Works
544
- - ✅ **Extensions**: All system Chrome extensions are dynamically loaded
545
- - ✅ **Bookmarks**: Accessible via MCP tools (`list_bookmarks`, `navigate_bookmark`)
546
- - ✅ **Login State**: Preserved in isolated profile after first login
313
+ ## 🔍 Troubleshooting
547
314
 
548
- ### What Doesn't Work
549
- - ❌ **Bookmarks in Browser UI**: Not displayed in browser bookmarks bar (use MCP tools instead)
550
- - ❌ **Shared Login State**: System Chrome login state is not shared (first login required)
315
+ ### Extension Not Loading
551
316
 
552
- ### Profile Location
553
317
  ```
554
- ~/.cache/chrome-devtools-mcp/chrome-profile/
555
- └── Default/
556
- ├── Cookies (isolated)
557
- ├── Login Data (isolated)
558
- └── ... (all files isolated)
318
+ "List extensions and show any errors"
559
319
  ```
560
320
 
561
- ### First Launch
562
- - **Extensions**: Automatically loaded from system Chrome via `--load-extension`
563
- - **Google Login required**: You'll need to log in once (login state is isolated for security)
564
- - **Subsequent launches**: Login state is preserved in the isolated profile
321
+ **Common fixes:**
322
+ - Verify manifest.json is at root of extension directory
323
+ - Check extension path in `--loadExtensionsDir`
324
+ - Ensure manifest is valid Manifest V3
565
325
 
566
- ### Isolated Mode (No Extensions)
567
- To run without any extensions:
326
+ ### MCP Server Not Starting
327
+
328
+ **Check version:**
568
329
  ```bash
569
- npx chrome-devtools-mcp-for-extension@latest --isolated
330
+ npx chrome-devtools-mcp-for-extension@latest --version
570
331
  ```
571
332
 
572
- </details>
573
-
574
- ---
575
-
576
- # 日本語 / Japanese
577
-
578
- **Chrome拡張機能開発用のAI支援MCPサーバー**
579
-
580
- システム拡張機能を自動ロード、開発用拡張機能も簡単設定
581
-
582
- ## クイックスタート
583
-
584
- ### 1. 設定を追加
585
-
586
- `~/.claude.json` に以下を追加:
587
-
588
- ```json
589
- {
590
- "mcpServers": {
591
- "chrome-devtools-extension": {
592
- "type": "stdio",
593
- "command": "npx",
594
- "args": ["chrome-devtools-mcp-for-extension@latest"],
595
- "env": {}
596
- }
597
- }
598
- }
333
+ **Clear npx cache:**
334
+ ```bash
335
+ npx clear-npx-cache
336
+ # or
337
+ rm -rf ~/.npm/_npx
599
338
  ```
600
339
 
601
- ### 2. AIクライアントを再起動
340
+ **Check MCP configuration:**
341
+ ```bash
342
+ cat ~/.claude.json | jq '.mcpServers'
343
+ ```
602
344
 
603
- ### 3. 動作確認
345
+ ### Hot-Reload Not Working (Developers)
604
346
 
605
- AIに質問:
347
+ **Verify development mode:**
348
+ ```bash
349
+ ps aux | grep mcp-wrapper | grep MCP_ENV=development
606
350
  ```
607
- 「Chrome拡張機能を一覧表示して」
351
+
352
+ **Check tsc -w is running:**
353
+ ```bash
354
+ ps aux | grep 'tsc -w'
608
355
  ```
609
356
 
610
- インストール済みの拡張機能が表示されます
357
+ **Manually restart wrapper:**
358
+ ```bash
359
+ pkill -f mcp-wrapper
360
+ # Then restart AI client (Cmd+R)
361
+ ```
611
362
 
612
363
  ---
613
364
 
614
- ## 開発用拡張機能のロード(--loadExtensionsDirあり)
365
+ ## 📖 Documentation
615
366
 
616
- 開発中の拡張機能をテストする場合:
617
-
618
- ```json
619
- {
620
- "mcpServers": {
621
- "chrome-devtools-extension": {
622
- "command": "npx",
623
- "args": [
624
- "chrome-devtools-mcp-for-extension@latest",
625
- "--loadExtensionsDir=/path/to/your/extensions"
626
- ]
627
- }
628
- }
629
- }
630
- ```
367
+ - [MCP Configuration Guide](docs/mcp-configuration-guide.md)
368
+ - [Hot-Reload Setup Guide](docs/hot-reload-setup-guide.md) (Developers)
369
+ - [Tools Reference](docs/tools-reference.md)
370
+ - [ChatGPT Integration](docs/chatgpt-integration.md)
371
+ - [Web Store Automation](docs/webstore-automation.md)
631
372
 
632
373
  ---
633
374
 
634
- ## 主な機能
375
+ ## 🙏 Credits
635
376
 
636
- - 🧩 **拡張機能の開発・デバッグ・リロード**: ライブ開発環境
637
- - 🏪 **Chrome Web Store への自動申請**: スクリーンショット生成付き
638
- - 🔧 **実環境でのブラウザテスト**: 既存の拡張機能と共存
639
- - 🐛 **高度なデバッグ**: サービスワーカー検査、コンソール監視
377
+ This project is a fork of [Chrome DevTools MCP](https://github.com/ChromeDevTools/chrome-devtools-mcp) by Google LLC.
640
378
 
641
- ## 使用例
379
+ **Major additions:**
380
+ - Chrome extension development tools
381
+ - Web Store automation
382
+ - ChatGPT integration
383
+ - Hot-reload development workflow
384
+ - System profile management
642
385
 
643
- ```
644
- 「広告ブロック拡張機能を作成して」
645
- 「拡張機能のエラーを確認して」
646
- 「サービスワーカーをデバッグして」
647
- 「Web Storeに申請して」
648
- ```
386
+ ---
649
387
 
650
- その他の詳細は英語セクションを参照してください。
388
+ ## 📄 License
651
389
 
652
- ---
390
+ Apache-2.0
653
391
 
654
- **Version**: 0.6.2
392
+ **Version**: 0.18.0
655
393
  **Repository**: https://github.com/usedhonda/chrome-devtools-mcp
656
- **License**: Apache-2.0
657
- **Original**: Chrome DevTools MCP by Google LLC