@mcpc-tech/unplugin-dev-inspector-mcp 0.1.30 → 0.1.32
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/client/dist/{PromptParamsDialog-D0TaQM5I.js → PromptParamsDialog-B0YpiWEk.js} +113 -87
- package/client/dist/inspector.js +19 -20
- package/client/dist/sidebar.js +1 -1
- package/dist/config-updater.cjs +160 -14
- package/dist/config-updater.js +160 -14
- package/dist/index.cjs +5 -2
- package/dist/index.d.cts +16 -9
- package/dist/index.d.ts +16 -9
- package/dist/index.js +5 -2
- package/dist/react/react.js +382 -4
- package/package.json +1 -1
package/dist/config-updater.js
CHANGED
|
@@ -81,7 +81,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
81
81
|
* Default port for the standalone server.
|
|
82
82
|
* Can be overridden via DEV_INSPECTOR_PORT environment variable.
|
|
83
83
|
*/
|
|
84
|
-
const DEFAULT_PORT =
|
|
84
|
+
const DEFAULT_PORT = 6137;
|
|
85
85
|
/**
|
|
86
86
|
* Get the configured port from environment variable or default.
|
|
87
87
|
*/
|
|
@@ -169,6 +169,10 @@ var StandaloneServer = class {
|
|
|
169
169
|
listen(...args) {
|
|
170
170
|
return this.server.listen(...args);
|
|
171
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Start the standalone server.
|
|
174
|
+
* Host resolution: string value used as-is, `true` = '0.0.0.0', default = 'localhost'
|
|
175
|
+
*/
|
|
172
176
|
async start(options = {}) {
|
|
173
177
|
const startPort = options.port || getDefaultPort();
|
|
174
178
|
this.host = typeof options.host === "string" ? options.host : options.host === true ? "0.0.0.0" : "localhost";
|
|
@@ -86619,8 +86623,8 @@ const PROMPT_SCHEMAS = {
|
|
|
86619
86623
|
required: false
|
|
86620
86624
|
}]
|
|
86621
86625
|
},
|
|
86622
|
-
|
|
86623
|
-
name: "
|
|
86626
|
+
list_inspections: {
|
|
86627
|
+
name: "list_inspections",
|
|
86624
86628
|
title: "View All Inspections",
|
|
86625
86629
|
description: "View all element inspections in the queue with their status.",
|
|
86626
86630
|
arguments: []
|
|
@@ -86652,6 +86656,12 @@ const PROMPT_SCHEMAS = {
|
|
|
86652
86656
|
title: "Get Stdio Messages",
|
|
86653
86657
|
description: "List stdio (stdout/stderr) messages from the server process. Always refreshes the list first.",
|
|
86654
86658
|
arguments: []
|
|
86659
|
+
},
|
|
86660
|
+
capture_area: {
|
|
86661
|
+
name: "capture_area",
|
|
86662
|
+
title: "Capture Area Context",
|
|
86663
|
+
description: "Draw a rectangle on the page to capture multiple elements at once for troubleshooting.",
|
|
86664
|
+
arguments: []
|
|
86655
86665
|
}
|
|
86656
86666
|
};
|
|
86657
86667
|
|
|
@@ -86754,6 +86764,72 @@ Returns: source location, DOM hierarchy, computed styles, dimensions, and user n
|
|
|
86754
86764
|
} },
|
|
86755
86765
|
required: ["code"]
|
|
86756
86766
|
}
|
|
86767
|
+
},
|
|
86768
|
+
capture_area_context: {
|
|
86769
|
+
name: "capture_area_context",
|
|
86770
|
+
description: `Capture area context by activating visual area selection mode.
|
|
86771
|
+
|
|
86772
|
+
User draws a rectangle on the page to select multiple elements at once. After selection, returns context for all elements in the area including source locations, DOM info, and screenshot.
|
|
86773
|
+
|
|
86774
|
+
**Flow**:
|
|
86775
|
+
1. Activates area selection mode (user sees crosshair cursor)
|
|
86776
|
+
2. User draws rectangle around target elements
|
|
86777
|
+
3. Returns: primary element + related elements with source locations, DOM hierarchy, and screenshot`,
|
|
86778
|
+
inputSchema: {
|
|
86779
|
+
type: "object",
|
|
86780
|
+
properties: {}
|
|
86781
|
+
}
|
|
86782
|
+
},
|
|
86783
|
+
get_network_requests: {
|
|
86784
|
+
name: "get_network_requests",
|
|
86785
|
+
description: `Get network requests from browser for debugging.
|
|
86786
|
+
|
|
86787
|
+
Returns list of HTTP requests with ID, method, URL, and status code. Use reqid parameter to get full details of a specific request including headers, body, and timing.
|
|
86788
|
+
|
|
86789
|
+
**Usage**:
|
|
86790
|
+
- Call without parameters to list all requests
|
|
86791
|
+
- Call with reqid to get specific request details`,
|
|
86792
|
+
inputSchema: {
|
|
86793
|
+
type: "object",
|
|
86794
|
+
properties: { reqid: {
|
|
86795
|
+
type: "number",
|
|
86796
|
+
description: "Optional. Request ID to get full details. If omitted, returns list of all requests."
|
|
86797
|
+
} }
|
|
86798
|
+
}
|
|
86799
|
+
},
|
|
86800
|
+
get_console_messages: {
|
|
86801
|
+
name: "get_console_messages",
|
|
86802
|
+
description: `Get console messages from browser for debugging.
|
|
86803
|
+
|
|
86804
|
+
Returns list of console logs with ID, level (log/warn/error/info), and message content. Use msgid parameter to get full details of a specific message.
|
|
86805
|
+
|
|
86806
|
+
**Usage**:
|
|
86807
|
+
- Call without parameters to list all messages
|
|
86808
|
+
- Call with msgid to get specific message details`,
|
|
86809
|
+
inputSchema: {
|
|
86810
|
+
type: "object",
|
|
86811
|
+
properties: { msgid: {
|
|
86812
|
+
type: "number",
|
|
86813
|
+
description: "Optional. Message ID to get full details. If omitted, returns list of all messages."
|
|
86814
|
+
} }
|
|
86815
|
+
}
|
|
86816
|
+
},
|
|
86817
|
+
get_stdio_messages: {
|
|
86818
|
+
name: "get_stdio_messages",
|
|
86819
|
+
description: `Get stdio (stdout/stderr) terminal messages from dev server process.
|
|
86820
|
+
|
|
86821
|
+
Returns list of terminal output with ID, stream type (stdout/stderr), and content. Use stdioid parameter to get full details of a specific message.
|
|
86822
|
+
|
|
86823
|
+
**Usage**:
|
|
86824
|
+
- Call without parameters to list all stdio messages
|
|
86825
|
+
- Call with stdioid to get specific message details`,
|
|
86826
|
+
inputSchema: {
|
|
86827
|
+
type: "object",
|
|
86828
|
+
properties: { stdioid: {
|
|
86829
|
+
type: "number",
|
|
86830
|
+
description: "Optional. Stdio message ID to get full details. If omitted, returns list of all messages."
|
|
86831
|
+
} }
|
|
86832
|
+
}
|
|
86757
86833
|
}
|
|
86758
86834
|
};
|
|
86759
86835
|
|
|
@@ -86821,6 +86897,8 @@ function getStdioById(id) {
|
|
|
86821
86897
|
|
|
86822
86898
|
//#endregion
|
|
86823
86899
|
//#region src/mcp.ts
|
|
86900
|
+
const TRUNCATE_URL_LENGTH = 60;
|
|
86901
|
+
const TRUNCATE_MESSAGE_LENGTH = 180;
|
|
86824
86902
|
/**
|
|
86825
86903
|
* Get Chrome DevTools binary path from npm package, then use node to run it, faster/stabler than npx
|
|
86826
86904
|
*/
|
|
@@ -86908,9 +86986,61 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
86908
86986
|
args: [getChromeDevToolsBinPath()]
|
|
86909
86987
|
} } }
|
|
86910
86988
|
}]);
|
|
86989
|
+
if (chromeDisabled) {
|
|
86990
|
+
mcpServer.tool(TOOL_SCHEMAS.get_network_requests.name, TOOL_SCHEMAS.get_network_requests.description, TOOL_SCHEMAS.get_network_requests.inputSchema, async ({ reqid }) => {
|
|
86991
|
+
if (reqid !== void 0) {
|
|
86992
|
+
const req = getRequestById(reqid);
|
|
86993
|
+
return { content: [{
|
|
86994
|
+
type: "text",
|
|
86995
|
+
text: req ? req.details || JSON.stringify(req, null, 2) : "Request not found"
|
|
86996
|
+
}] };
|
|
86997
|
+
}
|
|
86998
|
+
return { content: [{
|
|
86999
|
+
type: "text",
|
|
87000
|
+
text: getNetworkRequests().map((r) => {
|
|
87001
|
+
const truncatedUrl = r.url.length > TRUNCATE_URL_LENGTH ? r.url.substring(0, TRUNCATE_URL_LENGTH - 3) + "..." : r.url;
|
|
87002
|
+
return `reqid=${r.id} ${r.method} ${truncatedUrl} [${r.status}]`;
|
|
87003
|
+
}).reverse().join("\n") || "No network requests"
|
|
87004
|
+
}] };
|
|
87005
|
+
});
|
|
87006
|
+
mcpServer.tool(TOOL_SCHEMAS.get_console_messages.name, TOOL_SCHEMAS.get_console_messages.description, TOOL_SCHEMAS.get_console_messages.inputSchema, async ({ msgid }) => {
|
|
87007
|
+
if (msgid !== void 0) {
|
|
87008
|
+
const log = getLogById(msgid);
|
|
87009
|
+
return { content: [{
|
|
87010
|
+
type: "text",
|
|
87011
|
+
text: log ? JSON.stringify(log, null, 2) : "Log not found"
|
|
87012
|
+
}] };
|
|
87013
|
+
}
|
|
87014
|
+
return { content: [{
|
|
87015
|
+
type: "text",
|
|
87016
|
+
text: getLogs().map((l) => {
|
|
87017
|
+
const msg = l.args.map((arg) => typeof arg === "object" ? JSON.stringify(arg) : String(arg)).join(" ");
|
|
87018
|
+
const truncated = msg.length > TRUNCATE_MESSAGE_LENGTH ? msg.substring(0, TRUNCATE_MESSAGE_LENGTH - 3) + "..." : msg;
|
|
87019
|
+
return `msgid=${l.id} [${l.type}] ${truncated}`;
|
|
87020
|
+
}).reverse().join("\n") || "No console messages"
|
|
87021
|
+
}] };
|
|
87022
|
+
});
|
|
87023
|
+
}
|
|
87024
|
+
mcpServer.tool(TOOL_SCHEMAS.get_stdio_messages.name, TOOL_SCHEMAS.get_stdio_messages.description, TOOL_SCHEMAS.get_stdio_messages.inputSchema, async ({ stdioid }) => {
|
|
87025
|
+
if (stdioid !== void 0) {
|
|
87026
|
+
const log = getStdioById(stdioid);
|
|
87027
|
+
return { content: [{
|
|
87028
|
+
type: "text",
|
|
87029
|
+
text: log ? JSON.stringify(log, null, 2) : "Stdio message not found"
|
|
87030
|
+
}] };
|
|
87031
|
+
}
|
|
87032
|
+
return { content: [{
|
|
87033
|
+
type: "text",
|
|
87034
|
+
text: getStdioLogs().map((log) => {
|
|
87035
|
+
const truncated = log.data.length > TRUNCATE_MESSAGE_LENGTH ? log.data.substring(0, TRUNCATE_MESSAGE_LENGTH - 3) + "..." : log.data;
|
|
87036
|
+
return `stdioid=${log.id} [${log.stream}] ${truncated}`;
|
|
87037
|
+
}).reverse().join("\n") || "No stdio messages"
|
|
87038
|
+
}] };
|
|
87039
|
+
});
|
|
86911
87040
|
const mcpClientExecServer = createClientExecServer(mcpServer, "inspector");
|
|
86912
87041
|
mcpClientExecServer.registerClientToolSchemas([
|
|
86913
87042
|
{ ...TOOL_SCHEMAS.capture_element_context },
|
|
87043
|
+
{ ...TOOL_SCHEMAS.capture_area_context },
|
|
86914
87044
|
{ ...TOOL_SCHEMAS.list_inspections },
|
|
86915
87045
|
{ ...TOOL_SCHEMAS.update_inspection_status },
|
|
86916
87046
|
{ ...TOOL_SCHEMAS.execute_page_script }
|
|
@@ -86924,7 +87054,8 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
86924
87054
|
}));
|
|
86925
87055
|
const allDefaultPrompts = [
|
|
86926
87056
|
{ ...PROMPT_SCHEMAS.capture_element },
|
|
86927
|
-
{ ...PROMPT_SCHEMAS.
|
|
87057
|
+
{ ...PROMPT_SCHEMAS.list_inspections },
|
|
87058
|
+
{ ...PROMPT_SCHEMAS.capture_area },
|
|
86928
87059
|
{ ...PROMPT_SCHEMAS.get_stdio_messages },
|
|
86929
87060
|
...!chromeDisabled ? [{
|
|
86930
87061
|
...PROMPT_SCHEMAS.launch_chrome_devtools,
|
|
@@ -86954,7 +87085,7 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
86954
87085
|
const requests = getNetworkRequests();
|
|
86955
87086
|
const logs$1 = getLogs();
|
|
86956
87087
|
const requestOptions$1 = requests.map((r) => {
|
|
86957
|
-
const truncatedUrl = r.url.length >
|
|
87088
|
+
const truncatedUrl = r.url.length > TRUNCATE_URL_LENGTH ? r.url.substring(0, TRUNCATE_URL_LENGTH - 3) + "..." : r.url;
|
|
86958
87089
|
return `reqid=${r.id} ${r.method} ${truncatedUrl} [${r.status}]`;
|
|
86959
87090
|
}).reverse().join("\n");
|
|
86960
87091
|
const messageOptions$1 = logs$1.map((l) => {
|
|
@@ -86966,13 +87097,14 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
86966
87097
|
}
|
|
86967
87098
|
return String(arg);
|
|
86968
87099
|
}).join(" ");
|
|
86969
|
-
const truncatedText = text$3.length >
|
|
87100
|
+
const truncatedText = text$3.length > TRUNCATE_MESSAGE_LENGTH ? text$3.substring(0, TRUNCATE_MESSAGE_LENGTH - 3) + "..." : text$3;
|
|
86970
87101
|
return `msgid=${l.id} [${l.type}] ${truncatedText}`;
|
|
86971
87102
|
}).reverse().join("\n");
|
|
86972
87103
|
mcpServer.setRequestHandler(ListPromptsRequestSchema, async (_request) => {
|
|
86973
87104
|
return { prompts: [...filterPrompts([
|
|
86974
87105
|
{ ...PROMPT_SCHEMAS.capture_element },
|
|
86975
|
-
{ ...PROMPT_SCHEMAS.
|
|
87106
|
+
{ ...PROMPT_SCHEMAS.capture_area },
|
|
87107
|
+
{ ...PROMPT_SCHEMAS.list_inspections },
|
|
86976
87108
|
{
|
|
86977
87109
|
...PROMPT_SCHEMAS.get_network_requests,
|
|
86978
87110
|
arguments: [{
|
|
@@ -87026,12 +87158,12 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
87026
87158
|
const reqIdMatches = (networkResult?.content?.map((item) => item.text).join("\n") || "").matchAll(/reqid=(\d+)\s+(GET|POST|PUT|DELETE|PATCH)\s+([^\s]+)\s+\[([^\]]+)\]/g);
|
|
87027
87159
|
const requestOptions = Array.from(reqIdMatches).map((match) => {
|
|
87028
87160
|
const [, reqId, method, url, status] = match;
|
|
87029
|
-
return ` ${reqId}: ${method} ${url.length >
|
|
87161
|
+
return ` ${reqId}: ${method} ${url.length > TRUNCATE_URL_LENGTH ? url.substring(0, TRUNCATE_URL_LENGTH - 3) + "..." : url} [${status}]`;
|
|
87030
87162
|
}).reverse().join("\n");
|
|
87031
87163
|
const msgIdMatches = (consoleResult?.content?.map((item) => item.text).join("\n") || "").matchAll(/msgid=(\d+)\s+\[([^\]]+)\]\s+(.+)/g);
|
|
87032
87164
|
const messageOptions = Array.from(msgIdMatches).map((match) => {
|
|
87033
87165
|
const [, msgId, level, text$2] = match;
|
|
87034
|
-
return ` ${msgId}: [${level}] ${text$2.length >
|
|
87166
|
+
return ` ${msgId}: [${level}] ${text$2.length > TRUNCATE_URL_LENGTH ? text$2.substring(0, TRUNCATE_URL_LENGTH - 3) + "..." : text$2}`;
|
|
87035
87167
|
}).reverse().join("\n");
|
|
87036
87168
|
mcpServer.setRequestHandler(ListPromptsRequestSchema, async (_request) => {
|
|
87037
87169
|
const usernamePromptsMapped = userPrompts.map((p$1) => ({
|
|
@@ -87041,7 +87173,8 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
87041
87173
|
}));
|
|
87042
87174
|
return { prompts: [...filterPrompts([
|
|
87043
87175
|
{ ...PROMPT_SCHEMAS.capture_element },
|
|
87044
|
-
{ ...PROMPT_SCHEMAS.
|
|
87176
|
+
{ ...PROMPT_SCHEMAS.list_inspections },
|
|
87177
|
+
{ ...PROMPT_SCHEMAS.capture_area },
|
|
87045
87178
|
...!chromeDisabled ? [
|
|
87046
87179
|
{ ...PROMPT_SCHEMAS.launch_chrome_devtools },
|
|
87047
87180
|
{
|
|
@@ -87144,13 +87277,20 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
87144
87277
|
role: "user",
|
|
87145
87278
|
content: item
|
|
87146
87279
|
})) || [] };
|
|
87147
|
-
case "
|
|
87280
|
+
case "list_inspections": return { messages: (await callMcpMethod(mcpServer, "tools/call", {
|
|
87148
87281
|
name: "list_inspections",
|
|
87149
87282
|
arguments: {}
|
|
87150
87283
|
}))?.content.map((item) => ({
|
|
87151
87284
|
role: "user",
|
|
87152
87285
|
content: item
|
|
87153
87286
|
})) || [] };
|
|
87287
|
+
case "capture_area": return { messages: (await callMcpMethod(mcpServer, "tools/call", {
|
|
87288
|
+
name: "capture_area_context",
|
|
87289
|
+
arguments: {}
|
|
87290
|
+
}))?.content.map((item) => ({
|
|
87291
|
+
role: "user",
|
|
87292
|
+
content: item
|
|
87293
|
+
})) || [] };
|
|
87154
87294
|
case "launch_chrome_devtools": {
|
|
87155
87295
|
const defaultUrl = process.env.DEV_INSPECTOR_PUBLIC_BASE_URL ? stripTrailingSlash(process.env.DEV_INSPECTOR_PUBLIC_BASE_URL) : `http://${serverContext?.host || "localhost"}:${serverContext?.port || 5173}`;
|
|
87156
87296
|
const url = request.params.arguments?.url || defaultUrl;
|
|
@@ -87247,7 +87387,7 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
87247
87387
|
const stdioLogs$1 = getStdioLogs();
|
|
87248
87388
|
const stdioIdStr = request.params.arguments?.stdioid;
|
|
87249
87389
|
const formattedMessages = stdioLogs$1.map((log) => {
|
|
87250
|
-
const truncatedData = log.data.length >
|
|
87390
|
+
const truncatedData = log.data.length > TRUNCATE_MESSAGE_LENGTH ? log.data.substring(0, TRUNCATE_MESSAGE_LENGTH - 3) + "..." : log.data;
|
|
87251
87391
|
return `stdioid=${log.id} [${log.stream}] ${truncatedData}`;
|
|
87252
87392
|
}).reverse();
|
|
87253
87393
|
if (stdioIdStr) {
|
|
@@ -87279,7 +87419,8 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
87279
87419
|
const defaultUrl = process.env.DEV_INSPECTOR_PUBLIC_BASE_URL ? stripTrailingSlash(process.env.DEV_INSPECTOR_PUBLIC_BASE_URL) : `http://${serverContext?.host || "localhost"}:${serverContext?.port || 5173}`;
|
|
87280
87420
|
return { prompts: [
|
|
87281
87421
|
{ ...PROMPT_SCHEMAS.capture_element },
|
|
87282
|
-
{ ...PROMPT_SCHEMAS.
|
|
87422
|
+
{ ...PROMPT_SCHEMAS.list_inspections },
|
|
87423
|
+
{ ...PROMPT_SCHEMAS.capture_area },
|
|
87283
87424
|
{
|
|
87284
87425
|
...PROMPT_SCHEMAS.get_stdio_messages,
|
|
87285
87426
|
arguments: [{
|
|
@@ -87300,7 +87441,12 @@ Default dev server URL: ${process.env.DEV_INSPECTOR_PUBLIC_BASE_URL || `http://$
|
|
|
87300
87441
|
},
|
|
87301
87442
|
{ ...PROMPT_SCHEMAS.get_network_requests },
|
|
87302
87443
|
{ ...PROMPT_SCHEMAS.get_console_messages }
|
|
87303
|
-
] : []
|
|
87444
|
+
] : [],
|
|
87445
|
+
...userPrompts.map((p$1) => ({
|
|
87446
|
+
name: p$1.name,
|
|
87447
|
+
description: p$1.description,
|
|
87448
|
+
arguments: p$1.arguments
|
|
87449
|
+
}))
|
|
87304
87450
|
] };
|
|
87305
87451
|
});
|
|
87306
87452
|
await mcpServer.sendPromptListChanged();
|
package/dist/index.cjs
CHANGED
|
@@ -55,13 +55,16 @@ const createDevInspectorPlugin = (name, transformFactory) => {
|
|
|
55
55
|
let viteCommand;
|
|
56
56
|
let standaloneServerStarted = false;
|
|
57
57
|
let resolvedHost = "localhost";
|
|
58
|
-
let resolvedPort = options.port ||
|
|
58
|
+
let resolvedPort = options.port || 6137;
|
|
59
59
|
const transformImpl = transformFactory(options);
|
|
60
60
|
const chromeDisabled = require_helpers.isChromeDisabled(options.disableChrome);
|
|
61
61
|
const ensureStandaloneServer$1 = async (root) => {
|
|
62
62
|
if (standaloneServerStarted) return;
|
|
63
63
|
standaloneServerStarted = true;
|
|
64
|
-
const { server, host, port } = await require_config_updater.startStandaloneServer({
|
|
64
|
+
const { server, host, port } = await require_config_updater.startStandaloneServer({
|
|
65
|
+
port: options.port,
|
|
66
|
+
host: options.host
|
|
67
|
+
});
|
|
65
68
|
resolvedHost = host;
|
|
66
69
|
resolvedPort = port;
|
|
67
70
|
const serverContext = {
|
package/dist/index.d.cts
CHANGED
|
@@ -131,29 +131,36 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
|
|
|
131
131
|
*/
|
|
132
132
|
enabled?: boolean;
|
|
133
133
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
134
|
+
* Host address for the standalone server to bind to.
|
|
135
|
+
* - `"localhost"` (default): Only accessible locally, avoids Mixed Content errors (HTTPS→HTTP allowed)
|
|
136
|
+
* - `"0.0.0.0"` or `true`: Accessible from all network interfaces (useful for Docker, remote access)
|
|
137
|
+
* - Custom hostname: Bind to specific interface
|
|
136
138
|
* @default "localhost"
|
|
137
|
-
* @example
|
|
139
|
+
* @example true
|
|
138
140
|
*/
|
|
139
|
-
host?: string;
|
|
141
|
+
host?: string | boolean;
|
|
140
142
|
/**
|
|
141
143
|
* Custom port for MCP server URL
|
|
142
144
|
* Useful when behind a proxy or port forwarding (e.g., Docker, SSH tunnels)
|
|
143
145
|
* Can also be set via DEV_INSPECTOR_PORT environment variable
|
|
144
|
-
* @default
|
|
145
|
-
* @example
|
|
146
|
+
* @default 6137
|
|
147
|
+
* @example 6137
|
|
146
148
|
*/
|
|
147
149
|
port?: number;
|
|
148
150
|
/**
|
|
149
151
|
* Public base URL (including protocol) that editors/browsers should use to reach the dev server.
|
|
150
152
|
*
|
|
151
|
-
* Use this when the dev server runs in a
|
|
152
|
-
* reachable URL
|
|
153
|
+
* Use this when the dev server runs in a cloud IDE or behind a reverse proxy where the externally
|
|
154
|
+
* reachable URL differs from the internal host/port.
|
|
155
|
+
*
|
|
156
|
+
* Common use cases:
|
|
157
|
+
* - Cloud IDEs: Fly.io (`https://app-6137.fly.dev`), Gitpod, GitHub Codespaces
|
|
158
|
+
* - Docker with port mapping
|
|
159
|
+
* - Reverse proxy / tunnel (ngrok, cloudflared)
|
|
153
160
|
*
|
|
154
161
|
* If provided, it will be used for MCP config auto-update and console output.
|
|
155
162
|
*
|
|
156
|
-
* @example "https://
|
|
163
|
+
* @example "https://my-app-6137.fly.dev"
|
|
157
164
|
*/
|
|
158
165
|
publicBaseUrl?: string;
|
|
159
166
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -131,29 +131,36 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
|
|
|
131
131
|
*/
|
|
132
132
|
enabled?: boolean;
|
|
133
133
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
134
|
+
* Host address for the standalone server to bind to.
|
|
135
|
+
* - `"localhost"` (default): Only accessible locally, avoids Mixed Content errors (HTTPS→HTTP allowed)
|
|
136
|
+
* - `"0.0.0.0"` or `true`: Accessible from all network interfaces (useful for Docker, remote access)
|
|
137
|
+
* - Custom hostname: Bind to specific interface
|
|
136
138
|
* @default "localhost"
|
|
137
|
-
* @example
|
|
139
|
+
* @example true
|
|
138
140
|
*/
|
|
139
|
-
host?: string;
|
|
141
|
+
host?: string | boolean;
|
|
140
142
|
/**
|
|
141
143
|
* Custom port for MCP server URL
|
|
142
144
|
* Useful when behind a proxy or port forwarding (e.g., Docker, SSH tunnels)
|
|
143
145
|
* Can also be set via DEV_INSPECTOR_PORT environment variable
|
|
144
|
-
* @default
|
|
145
|
-
* @example
|
|
146
|
+
* @default 6137
|
|
147
|
+
* @example 6137
|
|
146
148
|
*/
|
|
147
149
|
port?: number;
|
|
148
150
|
/**
|
|
149
151
|
* Public base URL (including protocol) that editors/browsers should use to reach the dev server.
|
|
150
152
|
*
|
|
151
|
-
* Use this when the dev server runs in a
|
|
152
|
-
* reachable URL
|
|
153
|
+
* Use this when the dev server runs in a cloud IDE or behind a reverse proxy where the externally
|
|
154
|
+
* reachable URL differs from the internal host/port.
|
|
155
|
+
*
|
|
156
|
+
* Common use cases:
|
|
157
|
+
* - Cloud IDEs: Fly.io (`https://app-6137.fly.dev`), Gitpod, GitHub Codespaces
|
|
158
|
+
* - Docker with port mapping
|
|
159
|
+
* - Reverse proxy / tunnel (ngrok, cloudflared)
|
|
153
160
|
*
|
|
154
161
|
* If provided, it will be used for MCP config auto-update and console output.
|
|
155
162
|
*
|
|
156
|
-
* @example "https://
|
|
163
|
+
* @example "https://my-app-6137.fly.dev"
|
|
157
164
|
*/
|
|
158
165
|
publicBaseUrl?: string;
|
|
159
166
|
/**
|
package/dist/index.js
CHANGED
|
@@ -51,13 +51,16 @@ const createDevInspectorPlugin = (name, transformFactory) => {
|
|
|
51
51
|
let viteCommand;
|
|
52
52
|
let standaloneServerStarted = false;
|
|
53
53
|
let resolvedHost = "localhost";
|
|
54
|
-
let resolvedPort = options.port ||
|
|
54
|
+
let resolvedPort = options.port || 6137;
|
|
55
55
|
const transformImpl = transformFactory(options);
|
|
56
56
|
const chromeDisabled = isChromeDisabled(options.disableChrome);
|
|
57
57
|
const ensureStandaloneServer$1 = async (root) => {
|
|
58
58
|
if (standaloneServerStarted) return;
|
|
59
59
|
standaloneServerStarted = true;
|
|
60
|
-
const { server, host, port } = await startStandaloneServer({
|
|
60
|
+
const { server, host, port } = await startStandaloneServer({
|
|
61
|
+
port: options.port,
|
|
62
|
+
host: options.host
|
|
63
|
+
});
|
|
61
64
|
resolvedHost = host;
|
|
62
65
|
resolvedPort = port;
|
|
63
66
|
const serverContext = {
|