@mcpc-tech/unplugin-dev-inspector-mcp 0.0.20 → 0.0.22
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 +60 -30
- package/client/dist/inspector.iife.js +3 -2
- package/client.d.ts +21 -21
- package/dist/cli.cjs +6 -15
- package/dist/cli.js +6 -15
- package/dist/config-updater.cjs +1 -0
- package/dist/config-updater.js +4 -3
- package/dist/index.cjs +26607 -226
- package/dist/index.d.cts +34 -6
- package/dist/index.d.ts +34 -6
- package/dist/index.js +26589 -227
- package/dist/loader.cjs +11 -27
- package/dist/loader.js +11 -27
- package/package.json +11 -4
- package/dist/vue-transform.cjs +0 -140
- package/dist/vue-transform.js +0 -126
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="./assets/logo.svg" alt="DevInspector Logo" width="
|
|
2
|
+
<img src="./assets/logo.svg" alt="DevInspector Logo" width="50" height="50" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# @mcpc-tech/unplugin-dev-inspector-mcp
|
|
@@ -53,12 +53,15 @@ This project uses the following sponsor APIs and platforms:
|
|
|
53
53
|
## Key Features
|
|
54
54
|
|
|
55
55
|
### 🎯 Visual Context
|
|
56
|
+
|
|
56
57
|
Click any element to instantly send its source code location, computed styles, and DOM hierarchy to AI. No more explaining "it's the blue button in the header".
|
|
57
58
|
|
|
58
59
|
### 🛠️ Full DevTools Access
|
|
60
|
+
|
|
59
61
|
AI can access Chrome DevTools to analyze network requests, console logs, and performance metrics. It sees what you see.
|
|
60
62
|
|
|
61
63
|
### 🤖 Multi-Agent Workflow
|
|
64
|
+
|
|
62
65
|
Switch between agents (Claude Code, Goose) and track their debugging progress visually with step-by-step status updates.
|
|
63
66
|
|
|
64
67
|
## Quick Start
|
|
@@ -87,6 +90,7 @@ npx @mcpc-tech/unplugin-dev-inspector-mcp setup
|
|
|
87
90
|
```
|
|
88
91
|
|
|
89
92
|
**Options:**
|
|
93
|
+
|
|
90
94
|
- `--dry-run` - Preview changes without applying them
|
|
91
95
|
- `--config <path>` - Specify config file path (auto-detect by default)
|
|
92
96
|
- `--bundler <type>` - Specify bundler type: vite, webpack, nextjs
|
|
@@ -94,6 +98,7 @@ npx @mcpc-tech/unplugin-dev-inspector-mcp setup
|
|
|
94
98
|
- `--help` - Show help message
|
|
95
99
|
|
|
96
100
|
**Examples:**
|
|
101
|
+
|
|
97
102
|
```bash
|
|
98
103
|
# Preview changes before applying
|
|
99
104
|
npx @mcpc-tech/unplugin-dev-inspector-mcp setup --dry-run
|
|
@@ -106,6 +111,7 @@ npx @mcpc-tech/unplugin-dev-inspector-mcp setup --bundler vite
|
|
|
106
111
|
```
|
|
107
112
|
|
|
108
113
|
This will:
|
|
114
|
+
|
|
109
115
|
- Detect your bundler configuration
|
|
110
116
|
- Add the necessary import
|
|
111
117
|
- Add the plugin to your configuration
|
|
@@ -190,11 +196,14 @@ module.exports = {
|
|
|
190
196
|
|
|
191
197
|
### Next.js
|
|
192
198
|
|
|
199
|
+
Next.js supports **both Webpack and Turbopack** modes:
|
|
200
|
+
|
|
193
201
|
```diff
|
|
194
202
|
// next.config.ts
|
|
195
|
-
+import DevInspector from '@mcpc-tech/unplugin-dev-inspector-mcp';
|
|
203
|
+
+import DevInspector, { turbopackDevInspector } from '@mcpc-tech/unplugin-dev-inspector-mcp';
|
|
196
204
|
|
|
197
205
|
const nextConfig: NextConfig = {
|
|
206
|
+
+ // Webpack configuration (default mode: `next dev`)
|
|
198
207
|
+ webpack: (config) => {
|
|
199
208
|
+ config.plugins.push(
|
|
200
209
|
+ DevInspector.webpack({
|
|
@@ -203,6 +212,13 @@ const nextConfig: NextConfig = {
|
|
|
203
212
|
+ );
|
|
204
213
|
+ return config;
|
|
205
214
|
+ },
|
|
215
|
+
+
|
|
216
|
+
+ // Turbopack configuration (`next dev --turbopack`)
|
|
217
|
+
+ turbopack: {
|
|
218
|
+
+ rules: turbopackDevInspector({
|
|
219
|
+
+ enabled: true,
|
|
220
|
+
+ }),
|
|
221
|
+
+ },
|
|
206
222
|
};
|
|
207
223
|
|
|
208
224
|
export default nextConfig;
|
|
@@ -226,7 +242,10 @@ export default function RootLayout({ children }) {
|
|
|
226
242
|
}
|
|
227
243
|
```
|
|
228
244
|
|
|
229
|
-
|
|
245
|
+
**Running modes:**
|
|
246
|
+
|
|
247
|
+
- **Webpack mode:** `next dev` (uses webpack configuration)
|
|
248
|
+
- **Turbopack mode:** `next dev --turbopack` (uses turbopack configuration, Next.js 16+ default)
|
|
230
249
|
|
|
231
250
|
## Framework Support
|
|
232
251
|
|
|
@@ -237,14 +256,12 @@ export default function RootLayout({ children }) {
|
|
|
237
256
|
- **Svelte** - `.svelte` components (Vite, Webpack)
|
|
238
257
|
- **SolidJS** - `.jsx` and `.tsx` files (Vite, Webpack)
|
|
239
258
|
- **Preact** - `.jsx` and `.tsx` files (Vite, Webpack)
|
|
240
|
-
- **Next.js** - React with Webpack
|
|
259
|
+
- **Next.js** - React with Webpack and Turbopack modes
|
|
241
260
|
|
|
242
261
|
### 🚧 In Progress
|
|
243
262
|
|
|
244
263
|
- **Angular** - Support coming soon
|
|
245
264
|
|
|
246
|
-
|
|
247
|
-
|
|
248
265
|
## Configuration
|
|
249
266
|
|
|
250
267
|
### Auto-Update MCP Config
|
|
@@ -258,13 +275,13 @@ The plugin automatically updates MCP configuration files for detected editors wh
|
|
|
258
275
|
DevInspector.vite({
|
|
259
276
|
// Auto-detect and update (default: true)
|
|
260
277
|
updateConfig: true,
|
|
261
|
-
|
|
278
|
+
|
|
262
279
|
// Or specify editors manually
|
|
263
280
|
updateConfig: ['cursor', 'vscode'],
|
|
264
|
-
|
|
281
|
+
|
|
265
282
|
// Or disable
|
|
266
283
|
updateConfig: false,
|
|
267
|
-
|
|
284
|
+
|
|
268
285
|
// Server name in MCP config (default: 'dev-inspector')
|
|
269
286
|
updateConfigServerName: 'my-app-inspector',
|
|
270
287
|
})
|
|
@@ -289,13 +306,12 @@ DevInspector.vite({
|
|
|
289
306
|
|
|
290
307
|
### Custom Agents
|
|
291
308
|
|
|
292
|
-
This plugin uses the [Agent Client Protocol (ACP)](https://agentclientprotocol.com) to connect with AI agents.
|
|
309
|
+
This plugin uses the [Agent Client Protocol (ACP)](https://agentclientprotocol.com) to connect with AI agents.
|
|
293
310
|
|
|
294
311
|
⏱️ **Note:** Initial connection may be slow as agents are launched via `npx` (downloads packages on first run).
|
|
295
312
|
|
|
296
313
|
Default agents: [View configuration →](https://github.com/mcpc-tech/dev-inspector-mcp/blob/main/packages/unplugin-dev-inspector/client/constants/agents.ts)
|
|
297
314
|
|
|
298
|
-
|
|
299
315
|
You can customize available AI agents and set a default agent:
|
|
300
316
|
|
|
301
317
|
```typescript
|
|
@@ -327,11 +343,11 @@ export default {
|
|
|
327
343
|
```
|
|
328
344
|
|
|
329
345
|
**Key Features:**
|
|
346
|
+
|
|
330
347
|
- Custom agents with the **same name** as [default agents](https://agentclientprotocol.com/overview/agents) automatically inherit missing properties (icons, env)
|
|
331
348
|
- You can override just the command/args while keeping default icons
|
|
332
349
|
- If no custom agents provided, defaults are: Claude Code, Codex CLI, Gemini CLI, Kimi CLI, Goose, OpenCode
|
|
333
350
|
|
|
334
|
-
|
|
335
351
|
## What It Does
|
|
336
352
|
|
|
337
353
|
**Click element → Describe issue → AI analyzes → Get fix**
|
|
@@ -342,56 +358,67 @@ export default {
|
|
|
342
358
|
4. Get intelligent solutions through natural conversation
|
|
343
359
|
|
|
344
360
|
**Examples:**
|
|
361
|
+
|
|
345
362
|
- "Why is this button not clickable?" → AI checks `pointer-events`, z-index, overlays
|
|
346
363
|
- "This API call is failing" → AI analyzes network requests, timing, responses
|
|
347
364
|
- "Where is this component?" → Jump to source file and line number
|
|
348
365
|
|
|
349
366
|
## Two Workflow Modes
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
367
|
+
|
|
368
|
+
DevInspector offers two ways to interact with your AI, depending on your preference:
|
|
369
|
+
|
|
370
|
+
### 1. Editor Mode
|
|
371
|
+
|
|
372
|
+
**Best for:** Code-heavy tasks, refactoring, and maintaining flow.
|
|
373
|
+
|
|
374
|
+
- **How it works:** You use your IDE's AI assistant (Cursor, Windsurf, Copilot).
|
|
375
|
+
- **The Flow:** Click an element in the browser -> The context (source, props, styles) is sent to your Editor via MCP -> You ask your Editor to fix it.
|
|
376
|
+
- **Why:** Keeps you in your coding environment.
|
|
377
|
+
|
|
378
|
+
### 2. Inspector Bar Mode (Recommended)
|
|
379
|
+
|
|
380
|
+
**Best for:** Quick fixes, visual tweaks, or if you don't use an AI editor.
|
|
381
|
+
|
|
382
|
+
- **How it works:** You use the floating "Inspector Bar" directly in the browser.
|
|
383
|
+
- **The Flow:** Click "Ask AI" in the browser -> Select an agent (e.g., Claude Code, Custom Script) -> The agent runs in your terminal but interacts with the browser overlay.
|
|
384
|
+
- **Why:** No context switching. Great for "what is this?" questions or network debugging.
|
|
385
|
+
|
|
386
|
+
## MCP Tools
|
|
368
387
|
|
|
369
388
|
### `capture_element_context`
|
|
389
|
+
|
|
370
390
|
Activates visual selector. Returns source location, DOM hierarchy, styles, dimensions, and user notes.
|
|
371
391
|
|
|
372
392
|
### `list_inspections`
|
|
393
|
+
|
|
373
394
|
Shows all inspections with ID, element details, notes, and status (pending/in-progress/completed/failed).
|
|
374
395
|
|
|
375
396
|
### `update_inspection_status`
|
|
397
|
+
|
|
376
398
|
Updates inspection status with optional progress steps.
|
|
377
399
|
|
|
378
400
|
**Parameters:** `status`, `message` (required for completed/failed), `progress`, `inspectionId` (optional)
|
|
379
401
|
|
|
380
402
|
### `execute_page_script`
|
|
403
|
+
|
|
381
404
|
Executes JavaScript in browser context. Access to window, document, React/Vue instances, localStorage.
|
|
382
405
|
|
|
383
406
|
### `chrome_devtools`
|
|
407
|
+
|
|
384
408
|
Agentic tool for Chrome DevTools access. Provides network inspection, console logs, performance metrics, element interaction, and more.
|
|
385
409
|
|
|
386
410
|
## MCP Prompts
|
|
387
411
|
|
|
388
412
|
### `capture_element`
|
|
413
|
+
|
|
389
414
|
Capture and analyze UI element context.
|
|
390
415
|
|
|
391
416
|
### `view_inspections`
|
|
417
|
+
|
|
392
418
|
View all pending, in-progress, and completed inspections.
|
|
393
419
|
|
|
394
420
|
### `launch_chrome_devtools`
|
|
421
|
+
|
|
395
422
|
Opens Chrome with DevTools API. Unlocks network analysis, console logs, performance metrics.
|
|
396
423
|
|
|
397
424
|
**Parameter:** `url` (defaults to dev server)
|
|
@@ -399,11 +426,13 @@ Opens Chrome with DevTools API. Unlocks network analysis, console logs, performa
|
|
|
399
426
|
💡 Optional if Chrome is already open. Use when you need to launch a new Chrome instance.
|
|
400
427
|
|
|
401
428
|
### `get_network_requests`
|
|
429
|
+
|
|
402
430
|
List network requests or get details of a specific one. Always refreshes the list first.
|
|
403
431
|
|
|
404
432
|
**Parameter:** `reqid` (optional) - If provided, get details for that request. If omitted, just list all requests.
|
|
405
433
|
|
|
406
434
|
### `get_console_messages`
|
|
435
|
+
|
|
407
436
|
List console messages or get details of a specific one. Always refreshes the list first.
|
|
408
437
|
|
|
409
438
|
**Parameter:** `msgid` (optional) - If provided, get details for that message. If omitted, just list all messages.
|
|
@@ -413,6 +442,7 @@ List console messages or get details of a specific one. Always refreshes the lis
|
|
|
413
442
|
For a deep dive into how the MCP context, CMCP library, and Puppet binding mechanism work together, see the [Architecture Documentation](./docs/architecture/mcp-cmcp-puppet-architecture.md).
|
|
414
443
|
|
|
415
444
|
**Key concepts:**
|
|
445
|
+
|
|
416
446
|
- **Hub-and-spoke model**: Vite dev server acts as central hub managing multiple client connections
|
|
417
447
|
- **CMCP bidirectional execution**: Server defines tool schemas, browser client provides implementations
|
|
418
448
|
- **Puppet binding**: Enables Chrome DevTools ↔ Inspector message passthrough
|