n8n-nodes-smart-browser-automation 1.6.20 → 1.6.21
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.
|
@@ -117,22 +117,19 @@ class SmartBrowserAutomationTools {
|
|
|
117
117
|
if (!mcpEndpoint) {
|
|
118
118
|
throw new n8n_workflow_1.NodeOperationError(node, 'MCP Endpoint is required in credentials', {
|
|
119
119
|
itemIndex,
|
|
120
|
-
description: '
|
|
120
|
+
description: 'Configure MCP Endpoint in Smart Browser Automation credentials (e.g. http://localhost:3000 or https://host/sse)',
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
+
// Basic pre-validation so users see a clear error in the UI
|
|
124
|
+
if (!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(mcpEndpoint)) {
|
|
125
|
+
throw new n8n_workflow_1.NodeOperationError(node, `MCP Endpoint looks incomplete: "${mcpEndpoint}" (add http:// or https://)`, { itemIndex });
|
|
126
|
+
}
|
|
123
127
|
try {
|
|
124
128
|
await sessionManager.initialize(mcpEndpoint, useCDP, useCDP ? cdpUrl : undefined);
|
|
125
129
|
}
|
|
126
130
|
catch (error) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
description: JSON.stringify({
|
|
130
|
-
mcpEndpoint,
|
|
131
|
-
browserMode: credentials.browserMode,
|
|
132
|
-
useCDP,
|
|
133
|
-
cdpEndpoint: useCDP ? cdpUrl : undefined,
|
|
134
|
-
}),
|
|
135
|
-
});
|
|
131
|
+
const e = error;
|
|
132
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Failed to connect to MCP at ${mcpEndpoint} (${useCDP ? 'cdp' : 'launch'}${useCDP ? ` | cdp=${cdpUrl || 'unset'}` : ''}): ${e.message}`, { itemIndex });
|
|
136
133
|
}
|
|
137
134
|
const mcpTools = await sessionManager.listTools();
|
|
138
135
|
if (!mcpTools.length) {
|