@mcpc-tech/unplugin-dev-inspector-mcp 0.0.16 → 0.0.18

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/dist/index.cjs CHANGED
@@ -43,7 +43,6 @@ async function launchBrowserWithDevTools(options) {
43
43
  //#region src/core.ts
44
44
  const unplugin$1 = (0, unplugin.createUnplugin)((options = {}) => {
45
45
  const enabled = options.enabled ?? process.env.NODE_ENV !== "production";
46
- const enableMcp = options.enableMcp ?? true;
47
46
  const virtualModuleName = options.virtualModuleName ?? "virtual:dev-inspector-mcp";
48
47
  const webpackModuleName = virtualModuleName.replace("virtual:", "");
49
48
  let resolvedHost = options.host || "localhost";
@@ -67,7 +66,8 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
67
66
  window.__DEV_INSPECTOR_CONFIG__ = {
68
67
  host: '${resolvedHost}',
69
68
  port: '${resolvedPort}',
70
- base: '/'
69
+ base: '/',
70
+ showInspectorBar: ${options.showInspectorBar ?? true}
71
71
  };
72
72
 
73
73
  // Dynamically load inspector script
@@ -122,6 +122,7 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
122
122
  const host = options.host ?? (typeof viteHost === "string" ? viteHost : viteHost === true ? "0.0.0.0" : "localhost");
123
123
  const port = options.port ?? server?.config.server.port ?? 5173;
124
124
  const base = server?.config.base ?? "/";
125
+ const showInspectorBar = options.showInspectorBar ?? true;
125
126
  const displayHost = host === "0.0.0.0" ? "localhost" : host;
126
127
  return html.replace("</body>", `<dev-inspector-mcp></dev-inspector-mcp><script>
127
128
  (function() {
@@ -131,7 +132,8 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
131
132
  window.__DEV_INSPECTOR_CONFIG__ = {
132
133
  host: '${displayHost}',
133
134
  port: '${port}',
134
- base: '${base}'
135
+ base: '${base}',
136
+ showInspectorBar: ${showInspectorBar}
135
137
  };
136
138
  var script = document.createElement('script');
137
139
  var config = window.__DEV_INSPECTOR_CONFIG__;
@@ -148,45 +150,44 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
148
150
  }
149
151
  },
150
152
  async configureServer(server) {
151
- if (enableMcp) {
152
- const viteHost = server.config.server.host;
153
- const serverContext = {
154
- host: options.host ?? (typeof viteHost === "string" ? viteHost : viteHost === true ? "0.0.0.0" : "localhost"),
155
- port: options.port ?? server.config.server.port ?? 5173
156
- };
157
- const displayHost = serverContext.host === "0.0.0.0" ? "localhost" : serverContext.host;
158
- const baseUrl = `http://${displayHost}:${serverContext.port}/__mcp__/sse`;
159
- console.log(`[dev-inspector] 📡 MCP: ${baseUrl}\n`);
160
- await require_config_updater.setupMcpMiddleware(server.middlewares, serverContext);
161
- require_config_updater.setupAcpMiddleware(server.middlewares, serverContext, {
162
- acpMode: options.acpMode,
163
- acpModel: options.acpModel,
164
- acpDelay: options.acpDelay
165
- });
166
- const root = server.config.root;
167
- await require_config_updater.updateMcpConfigs(root, baseUrl, {
168
- updateConfig: options.updateConfig,
169
- updateConfigServerName: options.updateConfigServerName,
170
- updateConfigAdditionalServers: options.updateConfigAdditionalServers,
171
- customEditors: options.customEditors
172
- });
173
- if (options.autoOpenBrowser ?? true) {
174
- const targetUrl = options.browserUrl ?? `http://${displayHost}:${serverContext.port}`;
175
- setTimeout(async () => {
176
- if (await launchBrowserWithDevTools({
177
- url: targetUrl,
178
- serverContext
179
- })) console.log(`[dev-inspector] 🌐 Browser opened: ${targetUrl}`);
180
- else console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to open browser manually.\n`);
181
- }, 1e3);
182
- } else {
183
- console.log(`[dev-inspector] ⚠️ autoOpenBrowser: false - Console/Network context unavailable`);
184
- console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to enable.\n`);
185
- }
153
+ const viteHost = server.config.server.host;
154
+ const serverContext = {
155
+ host: options.host ?? (typeof viteHost === "string" ? viteHost : viteHost === true ? "0.0.0.0" : "localhost"),
156
+ port: options.port ?? server.config.server.port ?? 5173
157
+ };
158
+ const displayHost = serverContext.host === "0.0.0.0" ? "localhost" : serverContext.host;
159
+ const baseUrl = `http://${displayHost}:${serverContext.port}/__mcp__/sse`;
160
+ console.log(`[dev-inspector] 📡 MCP: ${baseUrl}\n`);
161
+ await require_config_updater.setupMcpMiddleware(server.middlewares, serverContext);
162
+ require_config_updater.setupAcpMiddleware(server.middlewares, serverContext, {
163
+ acpMode: options.acpMode,
164
+ acpModel: options.acpModel,
165
+ acpDelay: options.acpDelay
166
+ });
167
+ const root = server.config.root;
168
+ await require_config_updater.updateMcpConfigs(root, baseUrl, {
169
+ updateConfig: options.updateConfig,
170
+ updateConfigServerName: options.updateConfigServerName,
171
+ updateConfigAdditionalServers: options.updateConfigAdditionalServers,
172
+ customEditors: options.customEditors
173
+ });
174
+ if (options.autoOpenBrowser ?? false) {
175
+ const targetUrl = options.browserUrl ?? `http://${displayHost}:${serverContext.port}`;
176
+ setTimeout(async () => {
177
+ if (await launchBrowserWithDevTools({
178
+ url: targetUrl,
179
+ serverContext
180
+ })) console.log(`[dev-inspector] 🌐 Browser opened: ${targetUrl}`);
181
+ else console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to open browser manually.\n`);
182
+ }, 1e3);
183
+ } else {
184
+ console.log(`[dev-inspector] ⚠️ autoOpenBrowser: false - Console/Network context unavailable`);
185
+ console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to enable.\n`);
186
186
  }
187
187
  require_config_updater.setupInspectorMiddleware(server.middlewares, {
188
188
  agents: options.agents,
189
- defaultAgent: options.defaultAgent
189
+ defaultAgent: options.defaultAgent,
190
+ showInspectorBar: options.showInspectorBar
190
191
  });
191
192
  },
192
193
  handleHotUpdate() {}
@@ -213,36 +214,34 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
213
214
  host,
214
215
  port
215
216
  };
216
- if (enableMcp) {
217
- const displayHost = host === "0.0.0.0" ? "localhost" : host;
218
- const baseUrl = `http://${displayHost}:${port}/__mcp__/sse`;
219
- console.log(`[dev-inspector] 📡 MCP (Standalone): ${baseUrl}\n`);
220
- require_config_updater.setupMcpMiddleware(server, serverContext);
221
- require_config_updater.setupAcpMiddleware(server, serverContext, {
222
- acpMode: options.acpMode,
223
- acpModel: options.acpModel,
224
- acpDelay: options.acpDelay
225
- });
226
- const root = compiler.context;
227
- await require_config_updater.updateMcpConfigs(root, baseUrl, {
228
- updateConfig: options.updateConfig,
229
- updateConfigServerName: options.updateConfigServerName,
230
- updateConfigAdditionalServers: options.updateConfigAdditionalServers,
231
- customEditors: options.customEditors
232
- });
233
- if (options.autoOpenBrowser ?? true) {
234
- const targetUrl = options.browserUrl ?? `http://${displayHost}:${port}`;
235
- setTimeout(async () => {
236
- if (await launchBrowserWithDevTools({
237
- url: targetUrl,
238
- serverContext
239
- })) console.log(`[dev-inspector] 🌐 Browser opened: ${targetUrl}`);
240
- else console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to open browser manually.\n`);
241
- }, 1e3);
242
- } else {
243
- console.log(`[dev-inspector] ⚠️ autoOpenBrowser: false - Console/Network context unavailable`);
244
- console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to enable.\n`);
245
- }
217
+ const displayHost = host === "0.0.0.0" ? "localhost" : host;
218
+ const baseUrl = `http://${displayHost}:${port}/__mcp__/sse`;
219
+ console.log(`[dev-inspector] 📡 MCP (Standalone): ${baseUrl}\n`);
220
+ require_config_updater.setupMcpMiddleware(server, serverContext);
221
+ require_config_updater.setupAcpMiddleware(server, serverContext, {
222
+ acpMode: options.acpMode,
223
+ acpModel: options.acpModel,
224
+ acpDelay: options.acpDelay
225
+ });
226
+ const root = compiler.context;
227
+ await require_config_updater.updateMcpConfigs(root, baseUrl, {
228
+ updateConfig: options.updateConfig,
229
+ updateConfigServerName: options.updateConfigServerName,
230
+ updateConfigAdditionalServers: options.updateConfigAdditionalServers,
231
+ customEditors: options.customEditors
232
+ });
233
+ if (options.autoOpenBrowser ?? false) {
234
+ const targetUrl = options.browserUrl ?? `http://${displayHost}:${port}`;
235
+ setTimeout(async () => {
236
+ if (await launchBrowserWithDevTools({
237
+ url: targetUrl,
238
+ serverContext
239
+ })) console.log(`[dev-inspector] 🌐 Browser opened: ${targetUrl}`);
240
+ else console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to open browser manually.\n`);
241
+ }, 1e3);
242
+ } else {
243
+ console.log(`[dev-inspector] ⚠️ autoOpenBrowser: false - Console/Network context unavailable`);
244
+ console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to enable.\n`);
246
245
  }
247
246
  require_config_updater.setupInspectorMiddleware(server, {
248
247
  agents: options.agents,
package/dist/index.d.cts CHANGED
@@ -74,11 +74,6 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
74
74
  * @default true (automatically disabled in production)
75
75
  */
76
76
  enabled?: boolean;
77
- /**
78
- * Enable MCP server for AI integration
79
- * @default true
80
- */
81
- enableMcp?: boolean;
82
77
  /**
83
78
  * Custom host for MCP server URL
84
79
  * Useful when behind a proxy or in Docker containers
@@ -121,7 +116,7 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
121
116
  /**
122
117
  * Automatically open browser with Chrome DevTools when dev server starts
123
118
  * Uses Chrome DevTools Protocol for full debugging capabilities (console, network, etc.)
124
- * @default true when enableMcp is true
119
+ * @default false
125
120
  */
126
121
  autoOpenBrowser?: boolean;
127
122
  /**
@@ -130,6 +125,12 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
130
125
  * @example "http://localhost:5173/dashboard"
131
126
  */
132
127
  browserUrl?: string;
128
+ /**
129
+ * Whether to show the inspector bar UI
130
+ * Set to false if you only want to use the editor integration
131
+ * @default true
132
+ */
133
+ showInspectorBar?: boolean;
133
134
  }
134
135
  declare const unplugin: unplugin0.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
135
136
  //#endregion
package/dist/index.d.ts CHANGED
@@ -74,11 +74,6 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
74
74
  * @default true (automatically disabled in production)
75
75
  */
76
76
  enabled?: boolean;
77
- /**
78
- * Enable MCP server for AI integration
79
- * @default true
80
- */
81
- enableMcp?: boolean;
82
77
  /**
83
78
  * Custom host for MCP server URL
84
79
  * Useful when behind a proxy or in Docker containers
@@ -121,7 +116,7 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
121
116
  /**
122
117
  * Automatically open browser with Chrome DevTools when dev server starts
123
118
  * Uses Chrome DevTools Protocol for full debugging capabilities (console, network, etc.)
124
- * @default true when enableMcp is true
119
+ * @default false
125
120
  */
126
121
  autoOpenBrowser?: boolean;
127
122
  /**
@@ -130,6 +125,12 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
130
125
  * @example "http://localhost:5173/dashboard"
131
126
  */
132
127
  browserUrl?: string;
128
+ /**
129
+ * Whether to show the inspector bar UI
130
+ * Set to false if you only want to use the editor integration
131
+ * @default true
132
+ */
133
+ showInspectorBar?: boolean;
133
134
  }
134
135
  declare const unplugin: unplugin0.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
135
136
  //#endregion
package/dist/index.js CHANGED
@@ -42,7 +42,6 @@ async function launchBrowserWithDevTools(options) {
42
42
  //#region src/core.ts
43
43
  const unplugin = createUnplugin((options = {}) => {
44
44
  const enabled = options.enabled ?? process.env.NODE_ENV !== "production";
45
- const enableMcp = options.enableMcp ?? true;
46
45
  const virtualModuleName = options.virtualModuleName ?? "virtual:dev-inspector-mcp";
47
46
  const webpackModuleName = virtualModuleName.replace("virtual:", "");
48
47
  let resolvedHost = options.host || "localhost";
@@ -66,7 +65,8 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
66
65
  window.__DEV_INSPECTOR_CONFIG__ = {
67
66
  host: '${resolvedHost}',
68
67
  port: '${resolvedPort}',
69
- base: '/'
68
+ base: '/',
69
+ showInspectorBar: ${options.showInspectorBar ?? true}
70
70
  };
71
71
 
72
72
  // Dynamically load inspector script
@@ -121,6 +121,7 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
121
121
  const host = options.host ?? (typeof viteHost === "string" ? viteHost : viteHost === true ? "0.0.0.0" : "localhost");
122
122
  const port = options.port ?? server?.config.server.port ?? 5173;
123
123
  const base = server?.config.base ?? "/";
124
+ const showInspectorBar = options.showInspectorBar ?? true;
124
125
  const displayHost = host === "0.0.0.0" ? "localhost" : host;
125
126
  return html.replace("</body>", `<dev-inspector-mcp></dev-inspector-mcp><script>
126
127
  (function() {
@@ -130,7 +131,8 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
130
131
  window.__DEV_INSPECTOR_CONFIG__ = {
131
132
  host: '${displayHost}',
132
133
  port: '${port}',
133
- base: '${base}'
134
+ base: '${base}',
135
+ showInspectorBar: ${showInspectorBar}
134
136
  };
135
137
  var script = document.createElement('script');
136
138
  var config = window.__DEV_INSPECTOR_CONFIG__;
@@ -147,45 +149,44 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
147
149
  }
148
150
  },
149
151
  async configureServer(server) {
150
- if (enableMcp) {
151
- const viteHost = server.config.server.host;
152
- const serverContext = {
153
- host: options.host ?? (typeof viteHost === "string" ? viteHost : viteHost === true ? "0.0.0.0" : "localhost"),
154
- port: options.port ?? server.config.server.port ?? 5173
155
- };
156
- const displayHost = serverContext.host === "0.0.0.0" ? "localhost" : serverContext.host;
157
- const baseUrl = `http://${displayHost}:${serverContext.port}/__mcp__/sse`;
158
- console.log(`[dev-inspector] 📡 MCP: ${baseUrl}\n`);
159
- await setupMcpMiddleware(server.middlewares, serverContext);
160
- setupAcpMiddleware(server.middlewares, serverContext, {
161
- acpMode: options.acpMode,
162
- acpModel: options.acpModel,
163
- acpDelay: options.acpDelay
164
- });
165
- const root = server.config.root;
166
- await updateMcpConfigs(root, baseUrl, {
167
- updateConfig: options.updateConfig,
168
- updateConfigServerName: options.updateConfigServerName,
169
- updateConfigAdditionalServers: options.updateConfigAdditionalServers,
170
- customEditors: options.customEditors
171
- });
172
- if (options.autoOpenBrowser ?? true) {
173
- const targetUrl = options.browserUrl ?? `http://${displayHost}:${serverContext.port}`;
174
- setTimeout(async () => {
175
- if (await launchBrowserWithDevTools({
176
- url: targetUrl,
177
- serverContext
178
- })) console.log(`[dev-inspector] 🌐 Browser opened: ${targetUrl}`);
179
- else console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to open browser manually.\n`);
180
- }, 1e3);
181
- } else {
182
- console.log(`[dev-inspector] ⚠️ autoOpenBrowser: false - Console/Network context unavailable`);
183
- console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to enable.\n`);
184
- }
152
+ const viteHost = server.config.server.host;
153
+ const serverContext = {
154
+ host: options.host ?? (typeof viteHost === "string" ? viteHost : viteHost === true ? "0.0.0.0" : "localhost"),
155
+ port: options.port ?? server.config.server.port ?? 5173
156
+ };
157
+ const displayHost = serverContext.host === "0.0.0.0" ? "localhost" : serverContext.host;
158
+ const baseUrl = `http://${displayHost}:${serverContext.port}/__mcp__/sse`;
159
+ console.log(`[dev-inspector] 📡 MCP: ${baseUrl}\n`);
160
+ await setupMcpMiddleware(server.middlewares, serverContext);
161
+ setupAcpMiddleware(server.middlewares, serverContext, {
162
+ acpMode: options.acpMode,
163
+ acpModel: options.acpModel,
164
+ acpDelay: options.acpDelay
165
+ });
166
+ const root = server.config.root;
167
+ await updateMcpConfigs(root, baseUrl, {
168
+ updateConfig: options.updateConfig,
169
+ updateConfigServerName: options.updateConfigServerName,
170
+ updateConfigAdditionalServers: options.updateConfigAdditionalServers,
171
+ customEditors: options.customEditors
172
+ });
173
+ if (options.autoOpenBrowser ?? false) {
174
+ const targetUrl = options.browserUrl ?? `http://${displayHost}:${serverContext.port}`;
175
+ setTimeout(async () => {
176
+ if (await launchBrowserWithDevTools({
177
+ url: targetUrl,
178
+ serverContext
179
+ })) console.log(`[dev-inspector] 🌐 Browser opened: ${targetUrl}`);
180
+ else console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to open browser manually.\n`);
181
+ }, 1e3);
182
+ } else {
183
+ console.log(`[dev-inspector] ⚠️ autoOpenBrowser: false - Console/Network context unavailable`);
184
+ console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to enable.\n`);
185
185
  }
186
186
  setupInspectorMiddleware(server.middlewares, {
187
187
  agents: options.agents,
188
- defaultAgent: options.defaultAgent
188
+ defaultAgent: options.defaultAgent,
189
+ showInspectorBar: options.showInspectorBar
189
190
  });
190
191
  },
191
192
  handleHotUpdate() {}
@@ -212,36 +213,34 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
212
213
  host,
213
214
  port
214
215
  };
215
- if (enableMcp) {
216
- const displayHost = host === "0.0.0.0" ? "localhost" : host;
217
- const baseUrl = `http://${displayHost}:${port}/__mcp__/sse`;
218
- console.log(`[dev-inspector] 📡 MCP (Standalone): ${baseUrl}\n`);
219
- setupMcpMiddleware(server, serverContext);
220
- setupAcpMiddleware(server, serverContext, {
221
- acpMode: options.acpMode,
222
- acpModel: options.acpModel,
223
- acpDelay: options.acpDelay
224
- });
225
- const root = compiler.context;
226
- await updateMcpConfigs(root, baseUrl, {
227
- updateConfig: options.updateConfig,
228
- updateConfigServerName: options.updateConfigServerName,
229
- updateConfigAdditionalServers: options.updateConfigAdditionalServers,
230
- customEditors: options.customEditors
231
- });
232
- if (options.autoOpenBrowser ?? true) {
233
- const targetUrl = options.browserUrl ?? `http://${displayHost}:${port}`;
234
- setTimeout(async () => {
235
- if (await launchBrowserWithDevTools({
236
- url: targetUrl,
237
- serverContext
238
- })) console.log(`[dev-inspector] 🌐 Browser opened: ${targetUrl}`);
239
- else console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to open browser manually.\n`);
240
- }, 1e3);
241
- } else {
242
- console.log(`[dev-inspector] ⚠️ autoOpenBrowser: false - Console/Network context unavailable`);
243
- console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to enable.\n`);
244
- }
216
+ const displayHost = host === "0.0.0.0" ? "localhost" : host;
217
+ const baseUrl = `http://${displayHost}:${port}/__mcp__/sse`;
218
+ console.log(`[dev-inspector] 📡 MCP (Standalone): ${baseUrl}\n`);
219
+ setupMcpMiddleware(server, serverContext);
220
+ setupAcpMiddleware(server, serverContext, {
221
+ acpMode: options.acpMode,
222
+ acpModel: options.acpModel,
223
+ acpDelay: options.acpDelay
224
+ });
225
+ const root = compiler.context;
226
+ await updateMcpConfigs(root, baseUrl, {
227
+ updateConfig: options.updateConfig,
228
+ updateConfigServerName: options.updateConfigServerName,
229
+ updateConfigAdditionalServers: options.updateConfigAdditionalServers,
230
+ customEditors: options.customEditors
231
+ });
232
+ if (options.autoOpenBrowser ?? false) {
233
+ const targetUrl = options.browserUrl ?? `http://${displayHost}:${port}`;
234
+ setTimeout(async () => {
235
+ if (await launchBrowserWithDevTools({
236
+ url: targetUrl,
237
+ serverContext
238
+ })) console.log(`[dev-inspector] 🌐 Browser opened: ${targetUrl}`);
239
+ else console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to open browser manually.\n`);
240
+ }, 1e3);
241
+ } else {
242
+ console.log(`[dev-inspector] ⚠️ autoOpenBrowser: false - Console/Network context unavailable`);
243
+ console.log(`[dev-inspector] 💡 Use "launch_chrome_devtools" prompt to enable.\n`);
245
244
  }
246
245
  setupInspectorMiddleware(server, {
247
246
  agents: options.agents,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpc-tech/unplugin-dev-inspector-mcp",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "Universal dev inspector plugin for React/Vue - inspect component sources and API calls in any bundler",
5
5
  "type": "module",
6
6
  "license": "MIT",