mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
@@ -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: [
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user