# Build an n8n MCP Server for Claude & Cursor – Agent-Driven Workflow Execution ## Metadata - **Published:** 5/13/2025 - **Duration:** 16 minutes - **YouTube URL:** https://youtube.com/watch?v=QuqOL30O8Zs - **Channel:** nerding.io ## Description 50% off One-click remote hosted MCP servers use NERDINGIO at Supermachine.ai https://supermachine.ai/ In this video, we explore how to turn your #n8n instance into an #mcp server, enabling AI agents like Claude or Cursor to discover, manage, and run full workflowsβ€”not just individual tools. This approach brings agent autonomy to the next level by giving your LLM assistant access to outcome-based workflows, designed for efficiency and control. 🧠 What You’ll Learn: βœ… What is an MCP server and why n8n is a great fit βœ… How to connect Claude Desktop or Cursor to your n8n workflows βœ… How to expose only approved workflows via tags like "mcp" βœ… Using Redis as agent memory to track available workflows βœ… Auto-discovering, adding, removing, and listing workflows βœ… Executing workflows via the Subworkflow trigger with parameter passthrough βœ… How to extract input schema from workflow JSON for smarter tool use πŸ’‘ Why It Matters: This setup enables AI agents to make fewer, more effective calls, focusing on outcomes rather than low-level tools. Agents using Claude or Cursor can now: - Search for tagged workflows - Add/remove workflows from use - Run production-safe, prebuilt flows autonomously - Adapt to changing tasks with fewer API calls and more context - Perfect for teams using Claude Desktop, Cursor IDE, or any MCP-compatible client. πŸ”— Resources: πŸ“˜ n8n Template by Jimleuk: https://n8n.io/workflows/3770-build-your-own-n8n-workflows-mcp-server/ πŸ“Ž Model Context Protocol: https://modelcontextprotocol.io/ 🧠 Claude Desktop: https://claude.ai πŸ“© Newsletter: https://sendfox.com/nerdingio πŸ“ž Book a Call: https://calendar.app.google/vx62Asp9DTk7dRLW7 ## Key Highlights ### 1. MCP Server for n8n Workflows The video demonstrates building an MCP server to expose n8n workflows, enabling listing, searching, and executing them through an SSE endpoint. ### 2. Integration with Claude and Cursor The MCP server can be integrated with AI tools like Claude and Cursor, allowing users to trigger and interact with n8n workflows directly from these environments. ### 3. Super Gateway & Super Machine Super Gateway allows running servers over SSE/WebSockets and Super Machine offers a hosted solution for MCP servers, addressing scalability and security concerns. ### 4. Workflow Tagging for Access Control Using tags (like 'MCP') on workflows allows for gating which workflows are exposed to specific applications, enhancing security and control over API access. ## Summary ## Video Summary: Build an n8n MCP Server for Claude & Cursor – Agent-Driven Workflow Execution **1. Executive Summary:** This video demonstrates how to transform an n8n instance into a Model Context Protocol (MCP) server, enabling AI agents like Claude and Cursor to discover, manage, and execute n8n workflows. By exposing outcome-based workflows through an SSE endpoint, the video shows how to extend agent autonomy, allowing them to make fewer, more effective API calls and adapt to changing tasks more efficiently. **2. Main Topics Covered:** * **Introduction to MCP Servers and n8n Compatibility:** Explains the concept of an MCP server and why n8n is suitable for creating one. * **Connecting Claude Desktop and Cursor to n8n:** Shows how to integrate n8n workflows with AI tools like Claude and Cursor. * **Workflow Tagging for Controlled Access:** Explains how to use tags (e.g., "MCP") to restrict the workflows exposed to external applications, improving security and access management. * **Utilizing Redis for Agent Memory:** Details the use of Redis to store and track available workflows for the agent. * **Workflow Management (Discovery, Adding, Removing, Listing):** Demonstrates how agents can discover, add, remove, and list available workflows. * **Workflow Execution via Subworkflow Trigger:** Explains the use of the Subworkflow trigger with parameter passthrough to execute workflows. * **Super Gateway & Super Machine:** Discussion of Super Gateway, a solution for running servers over SSE/WebSockets, and Super Machine, a hosted solution that simplifies MCP server deployment and addresses scalability and security concerns. **3. Key Takeaways:** * **Enhanced Agent Autonomy:** Agents can now execute complex, pre-built workflows rather than just individual tools, leading to more effective and efficient task completion. * **Improved API Call Efficiency:** Agents make fewer API calls, focusing on outcomes and reducing unnecessary communication. * **Secure Workflow Exposure:** Tagging allows for controlled access to specific workflows, ensuring security and limiting access to sensitive processes. * **Simplified Deployment with Super Machine:** Super Machine provides a one-click solution for hosting MCP servers, removing the complexities of manual setup and offering scalability. * **Integration with Popular AI Tools:** Demonstrates seamless integration with Claude and Cursor, enabling workflow execution directly within these environments. **4. Notable Quotes or Examples:** * *"... what that means is you can actually use MCP to connect to your NAN workflows, list them, search them, and execute them."* - Defining the core functionality of the MCP server. * *"So that means that any uh workflow that is tagged right up here like this one uh with MCP will actually be identifiable to this particular uh flow. So this is another way of just kind of like gating uh your your API..."* - Explaining the use of tagging for access control. * Demonstration of connecting n8n workflow to Claude and Cursor for workflow execution. **5. Target Audience:** * n8n users looking to integrate their workflows with AI agents. * AI developers using Claude or Cursor who want to extend the capabilities of these tools. * Individuals interested in automating complex tasks using AI-driven workflow execution. * Teams seeking a secure and scalable solution for exposing n8n workflows to external applications. ## Full Transcript Hey everyone, welcome to Nering I.io. I'm JD and today what we're going to go through is how you can build an MCP NAN workflow. And what that means is you can actually use MCP to connect to your NAN workflows, list them, search them, and execute them. We're also going to look at how they can pipe all of this through what's called a super gateway. And with that, let's go ahead and get started. All right. So what we're going to do is we're going to look at a blog post from NATN and specifically this is uh creating an MCP server that will expose your NAN workflows. And I thought this was super interesting. So not only can you uh work within an MCP server on an AN through their native nodes, but you can also actually uh use it in cloud or cursor or in your other AI applications and executions. So that's what we're going to take a look at and build today. All right. So, let's dive into this workflow. So, the the cool thing about this is it gives you an entire uh pipeline for multiple different things. You have your MCP server that you can trigger, which we're going to look at. You have a workflow that will actually do the execution and go and look for any other workflows and then you actually have a way to test right in the uh in in this workflow. So you can pretty much do everything all in one template. We're going to kind of see how you can extend it and uh build it. But there's also like some really good instructions. um you know make sure you zoom in to read and how to use this. They do talk about how you can integrate with claude. So we're going to go through and uh put that together as well. We're going to take a look at how you can put it into cursor and we're going to look at the things that kind of power this. So the first thing is to build your MCP server. Basically you just need exactly uh that just an MCP server that you can pull from over here. you can just do MCP and then you have a server trigger. So, what this is going to do is it's going to make an SSE uh or streamable server. This allows you to then uh put out whatever tools that you want. There's no way to do like resources or prompts, but tools are the most widely used anyways. So, it's super cool that uh you can actually test this workflow. in order to actually test it. It's very similar to like if you worked with any of the web hook solutions or things like that, you have a test URL and when you activate the the test, it means that this URL is now waiting for events to happen. So you could actually go and fire off an event to this SSE and then you would see the event in order to pin it uh so that you could have something if you wanted. I don't know if there's a way to pin here, but you could at least see the events coming through. The other thing is is that you basically have uh a test URL and a production URL. Really, the only difference is this dash test and the path. This variable is basically in your URI right there. Other cool things is you can add authentication. Um, so if you need to make sure that this is a little bit more secure, you can have barrier off or header off. Um, which is great. We're just going to leave it open so that we can just hit it and uh see what this is actually doing. So, if you uh some other things to note that you're going to have to do in order to wire this up, you actually have to create an MCP API key. And so, the way to do that is you can just come in here and you have to paste your key, but uh and then follow the base URL. So in order to do that, you need to go over to your NN API and then you can actually see this uh API key. So you can go ahead and create another one. So now that we know uh actually the other thing you're going to have to do is this actually uses Reddus for memory and so you need to go ahead and create a Reddus account with a new credential here. Uh you can actually get a free Reddus account right out of the box. Um so I would just go to like reddus.io and uh set up a Reddus account for free and then you can put in your your credentials. So this is the workflow that we'll actually be executing and then we're actually going to look at how this chat works and see if we can get this up and running. So here is our uh expression or our prompt, right? And so there are two good key things to notice. You have this here only look for active workflows uh with the list workflows tool and then you have the ability to execute those workflows as well. Um and that's really it. It's uh a prompt that is going to look at your SSH or I'm sorry SSE key uh endpoint and then if there's authentication here like we talked about we can send it and then we're going to give access to all tools. You can also do things like select a tools or uh accept all uh tools. So this is used for primarily testing or integrating. So again, you could put this anywhere in your application. I used it for testing, but then I also wanted to connect it to the um to the server. And if you look here, what this is doing is it's actually pulling the uh information from N8N out of your workflow ID. And in order to do that, it's actually executing this other workflow, right? So it's looking to see which operation you're actually trying to do. So these operations map to the tools that are over on the server and then based on that it's actually going and calling out. So we're not hitting it's important to know that we are not hitting the NAN API directly from these tools. What we're doing is we're actually hitting a workflow that's going out and then hitting the API. So what's happening in these APIs is it's basically looking for workflows or executing particular type of workflows and they're specifically looking for tags that have the tag MCP. So that means that any uh workflow that is tagged right up here like this one uh with MCP will actually be identifiable to this particular uh flow. So this is another way of just kind of like gating uh your your API so that let's say you wanted to hand this out to another application. You could actually say that uh you know nerding io is the tag and all of those are the the workflows that are exposed to that particular application as opposed to giving access to the literally everything in your NAN you're kind of gating what information is available. So now that we know we can actually look at these workflows, we can actually execute these workflows. We know kind of what they're doing, how they're getting information. Um we're going to test it, but uh let's just go through testing the the list uh oops the list uh tools and we'll just or list workflows and we'll see what's happening and we'll go back and look at an execute. So, what workflows do I do? And as you can see, we're going through and we're executing and it's finding that we only have one workflow and that is the uh MCP server with Google calendar and custom functions. And that's because I wired that particular uh uh MCP server up so that I could actually go find it. So if we look over here, just click save. Uh we can see that both of these are tagged with MCP. I'm actually in this workflow. So it can see this other workflow. Again, if you haven't used tags, all you have to do is come up here and you can just type it in. So now let's go back to our uh workflow. So we saw that we can actually uh list whatever workflows and now we want to see what's actually happening when we execute that workflow. So when we tell it to execute that that workflow again we're coming through this operations. We're going to take all of the information that we put in, converted JSON, see if the workflow is available, pass all of those parameters, and then actually dynamically execute this workflow. So, if we look here, when executed by another workflow, we're passing the ID from our source into the workflow of IDs and picking the first one. And that's what'll actually execute the tool. All right. So, one of the other things that's super interesting is that you can wire this up to uh cloud and things like cursor. So, if you go to this URL, it'll take you to the server trigger node and it just kind of gives you all the the parameters, but what it specifically calls out is down here this integrating with cloud desktop. So what this is actually doing is you can actually take this piece and run it'll let you run this command and spin up. So with super gateway it's actually an open-source uh solution. And what this does is it allows you to run standard in standard outbased servers over SSE or over websockets. One of the problems that I've seen in the community is that people are trying to install their MCP servers directly onto their uh their their host server. So it could be where they're actually building their code. It could be their the server where they're actually hosting an ADN. It actually adds like a layer of complexity. It doesn't really scale well and it's a pretty big security problem. And so what I did is I actually reached out to SuperC Corp and they have this paid solution called Super Machine and this allows you to actually host your own MCP servers. So they have up to 4,000 MCP servers that you can choose from. And they have multiple plans where you can get between 20 and 100 MCP servers. Right now they're actually offering a 50% off coupon with uh Nerding.io. And so if this is something you're interested in, you should definitely check them out. It's super easy to get started with creating a new MCP server. So all you have to do is like one click, maybe it maybe more than one, but you can come in here and you can basically pick any of these servers. There's over 4,000 servers. And all it is to go ahead and create an MCP server is pick the MCP. It's actually going to go pull the GitHub files. It does dynamic setup. So every single time it knows exactly what it needs to to to pull in and then as soon as it's ready to go, you now have an SSE server that you can hit automatically. I'm actually going to have a follow-up video to show how I actually use Super Machine uh with all of my local development as well as things in production. But there you go. Now you have a MCP server ready to go with a few simple clicks. Again, look for the coupon code. It's 50% off. Highly recommend checking them out. So, let's get back to the NAN flow. So, now that we actually know how we can hit this with our Claude server or with Claude, we're actually going to go and take this command and we're going to connect directly to uh to Claude. Uh again, I don't have a header, so I don't need this piece. I'm just going to go ahead and uh take this piece. So now what I can do is I can just say uh what NAN workflows do I have available before? and go ahead and hit that. And so now you can see that it's actually running. It's coming back with the tools that I actually have. Uh it's letting me know what custom calendar function tools I have. It's telling me what the the payload can be. Uh and would we like to execute it? Uh, this is going to probably fail just because I don't have this workflow set up, but let's just see how the MCP actually goes through. So, it can tell us more about the uh the the function and things like that. But what we're going to do now too is just show how we can actually connect this into cursor as well. So that means that I could be working using cursor execute a workflow and have it pull back information in while I'm actually building uh and and programming at the same time. So if I needed to go find and scrape and pull back workflow information, I can actually do that from cursor. So again, all we have to do is come into our cursor settings. You can see all the other tools I have. And uh I'm creating this nan. All you have to do is edit. Same as we would do with claude. We just put it in our JSON. And again, we're using super gateway. This is the SSE that we're going to hit. And we'll try and see how this works. So what end to end workflows do I have available? So it knows that it has to go out. It knows it has these particular MCP tools. Again, coming back. Look at that. It's pulling back the tool and function ID. And again, now from here, we could actually execute uh our um our workflow and actually use it while we're developing. So again, super awesome. I'm like loving super gateway and super machine and I thought this was crazy cool to be able to execute n workflows directly from cursor. And so now that we have all of this put together again we can actually execute these workflows. We can add new workflows. We can remove workflows and this all and search the workflows like we just did. All right everyone that's it for us today. What we went through is an N8 MCP server that allows you to look at your N8N workflows, execute them in both claude and cursor. And with that, happy nerding. --- *Generated for LLM consumption from nerding.io video library*