@@ -90,6 +90,18 @@ export class McpClient implements INodeType {
9090 default : 'cmd' ,
9191 description : 'Choose the transport type to connect to MCP server' ,
9292 } ,
93+ {
94+ displayName : 'Uri Override' ,
95+ name : 'uriOverride' ,
96+ type : 'string' ,
97+ displayOptions : {
98+ show : {
99+ connectionType : [ 'sse' , 'http' ] ,
100+ } ,
101+ } ,
102+ default : '' ,
103+ description : 'Override the URL from credentials with a custom URL' ,
104+ } ,
93105 {
94106 displayName : 'Operation' ,
95107 name : 'operation' ,
@@ -220,7 +232,21 @@ export class McpClient implements INodeType {
220232 // Dynamically import the HTTP client
221233 const { StreamableHTTPClientTransport } = await import ( '@modelcontextprotocol/sdk/client/streamableHttp.js' ) ;
222234
223- const httpStreamUrl = httpCredentials . httpStreamUrl as string ;
235+ // Get URI override or use credentials URL
236+ const uriOverride = this . getNodeParameter ( 'uriOverride' , 0 ) as string ;
237+ let httpStreamUrl : string ;
238+
239+ if ( uriOverride && uriOverride . trim ( ) ) {
240+ try {
241+ // Validate URL format
242+ new URL ( uriOverride . trim ( ) ) ;
243+ httpStreamUrl = uriOverride . trim ( ) ;
244+ } catch ( error ) {
245+ throw new NodeOperationError ( this . getNode ( ) , `Invalid URI override format: ${ uriOverride } ` ) ;
246+ }
247+ } else {
248+ httpStreamUrl = httpCredentials . httpStreamUrl as string ;
249+ }
224250 const messagesPostEndpoint = ( httpCredentials . messagesPostEndpoint as string ) || '' ;
225251 timeout = httpCredentials . httpTimeout as number || 60000 ;
226252
@@ -258,7 +284,20 @@ export class McpClient implements INodeType {
258284 // Dynamically import the SSE client to avoid TypeScript errors
259285 const { SSEClientTransport } = await import ( '@modelcontextprotocol/sdk/client/sse.js' ) ;
260286
261- const sseUrl = sseCredentials . sseUrl as string ;
287+ // Get URI override or use credentials URL
288+ const uriOverride = this . getNodeParameter ( 'uriOverride' , 0 ) as string ;
289+ let sseUrl : string ;
290+ if ( uriOverride && uriOverride . trim ( ) ) {
291+ try {
292+ // Validate URL format
293+ new URL ( uriOverride . trim ( ) ) ;
294+ sseUrl = uriOverride . trim ( ) ;
295+ } catch ( error ) {
296+ throw new NodeOperationError ( this . getNode ( ) , `Invalid URI override format: ${ uriOverride } ` ) ;
297+ }
298+ } else {
299+ sseUrl = sseCredentials . sseUrl as string ;
300+ }
262301 const messagesPostEndpoint = ( sseCredentials . messagesPostEndpoint as string ) || '' ;
263302 timeout = sseCredentials . sseTimeout as number || 60000 ;
264303
0 commit comments