feat(MCP Server Trigger Node): Add MCP Server Trigger node to expose tools to MCP clients (#14403)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
jeanpaul
2025-04-09 14:45:24 +02:00
committed by GitHub
parent a495d81c13
commit 8360283c6f
36 changed files with 942 additions and 105 deletions

View File

@@ -283,7 +283,7 @@ export class Form extends Node {
path: '',
restartWebhook: true,
isFullPath: true,
isForm: true,
nodeType: 'form',
},
{
name: 'default',
@@ -292,7 +292,7 @@ export class Form extends Node {
path: '',
restartWebhook: true,
isFullPath: true,
isForm: true,
nodeType: 'form',
},
],
properties: [

View File

@@ -52,7 +52,7 @@ const descriptionV2: INodeTypeDescription = {
isFullPath: true,
path: '={{ $parameter["path"] || $parameter["options"]?.path || $webhookId }}',
ndvHideUrl: true,
isForm: true,
nodeType: 'form',
},
{
name: 'default',
@@ -62,7 +62,7 @@ const descriptionV2: INodeTypeDescription = {
isFullPath: true,
path: '={{ $parameter["path"] || $parameter["options"]?.path || $webhookId }}',
ndvHideMethod: true,
isForm: true,
nodeType: 'form',
},
],
eventTriggerDescription: 'Waiting for you to submit the form',

View File

@@ -256,7 +256,7 @@ export class Wait extends Webhook {
path: webhookPath,
restartWebhook: true,
isFullPath: true,
isForm: true,
nodeType: 'form',
},
{
name: 'default',
@@ -266,7 +266,7 @@ export class Wait extends Webhook {
path: webhookPath,
restartWebhook: true,
isFullPath: true,
isForm: true,
nodeType: 'form',
},
],
properties: [

View File

@@ -208,6 +208,20 @@ export async function validateWebhookAuthentication(
// Provided authentication data is wrong
throw new WebhookAuthorizationError(403);
}
} else if (authentication === 'bearerAuth') {
let expectedAuth: ICredentialDataDecryptedObject | undefined;
try {
expectedAuth = await ctx.getCredentials<ICredentialDataDecryptedObject>('httpBearerAuth');
} catch {}
const expectedToken = expectedAuth?.token as string;
if (!expectedToken) {
throw new WebhookAuthorizationError(500, 'No authentication data defined on node!');
}
if (headers.authorization !== `Bearer ${expectedToken}`) {
throw new WebhookAuthorizationError(403);
}
} else if (authentication === 'headerAuth') {
// Special header with value is needed to call webhook
let expectedAuth: ICredentialDataDecryptedObject | undefined;