MCP Server Trigger Authentication with Entra

Hello community, new to n8n and a little bit overwhelmed :sweat_smile:

Describe the problem/error/question

I have created a small web application, whose backend accesses an “MCP Server Trigger” node. While it is working great there is the issue of the MCP Server having no authentication. I’ve seen two options for authentication inside this node, using Bearer Auth or Header Auth. I was asking myself if I could authenticate by attaching a “Call n8n Workflow Tool” to the trigger and then use a Code node to authenticate inside of that. The app is currently hosted on Azure, and I am using Easy Auth for Authentication there. So essentially, I’m asking if it would be possible to authenticate an Entra JWT inside a Code node. Also if it is possible, would it be a good idea or should I just stick with the authentication methods provided by the node?

I appreciate all answers, thanks in advance :smiley:

Hey! Yes, you can validate an Entra JWT in a Code node using a library like jsonwebtoken, but honestly the built-in Bearer Auth on the MCP Server Trigger is cleaner and easier to maintain. Just pass your Azure Easy Auth token as a Bearer token in the request headers, and validate it in the trigger node settings. Using a Code node adds complexity and potential failure points. Stick with the native authentication unless you have a specific reason to customize—it handles token validation securely without extra coding.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.