{"record":{"id":"cf43f562218106bf","repo":"n8n-io/n8n","slug":"oauth2-authentication-requires-mcp-trigger-node-v2","errorCode":null,"errorMessage":"OAuth2 authentication requires mcp trigger node v2.0 or higher","messagePattern":"OAuth2 authentication requires mcp trigger node v2\\.0 or higher","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/mcp/McpTrigger/McpTrigger.node.ts","lineNumber":175,"sourceCode":"\t\t\t\thttpMethod: 'DELETE',\n\t\t\t\tresponseMode: 'onReceived',\n\t\t\t\tisFullPath: true,\n\t\t\t\tpath: '={{$parameter[\"path\"]}}',\n\t\t\t\tnodeType: 'mcp',\n\t\t\t\tndvHideMethod: true,\n\t\t\t\tndvHideUrl: true,\n\t\t\t},\n\t\t],\n\t};\n\n\tasync webhook(context: IWebhookFunctions): Promise<IWebhookResponseData> {\n\t\tconst webhookName = context.getWebhookName();\n\t\tconst req = context.getRequestObject();\n\t\tconst resp = context.getResponseObject() as unknown as CompressionResponse;\n\n\t\tif (context.getNodeParameter('authentication') === 'n8nOAuth2') {\n\t\t\tif (context.getNode().typeVersion < 2) {\n\t\t\t\tresp.writeHead(401);\n\t\t\t\tresp.end('OAuth2 authentication requires mcp trigger node v2.0 or higher');\n\t\t\t\treturn { noWebhookResponse: true };\n\t\t\t}\n\t\t\tconst authResult = await n8nOAuth2Auth(context, { realm: 'n8n MCP Server' });\n\t\t\tif (authResult === 'handled') {\n\t\t\t\treturn { noWebhookResponse: true };\n\t\t\t}\n\t\t\tawait context.establishTriggerIdentity(authResult.token, authResult.resource);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tawait validateWebhookAuthentication(context, 'authentication');\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof WebhookAuthorizationError) {\n\t\t\t\t\tresp.writeHead(error.responseCode);\n\t\t\t\t\tresp.end(error.message);\n\t\t\t\t\treturn { noWebhookResponse: true };\n\t\t\t\t}\n\t\t\t\tthrow error;","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/mcp/McpTrigger/McpTrigger.node.ts#L157-L193","documentation":"Error \"OAuth2 authentication requires mcp trigger node v2.0 or higher\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/nodes-langchain/nodes/mcp/McpTrigger/McpTrigger.node.ts:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}