{
  "name": "Build your own N8N workflows MCP server",
  "nodes": [
    {
      "id": "e3ed1048-bad0-4e91-bfb5-aef3e1883de4",
      "name": "Simplify Workflows",
      "type": "n8n-nodes-base.set",
      "position": [
        -1740,
        0
      ]
    },
    {
      "id": "a935f5b6-3a35-49e7-870c-87e4daf0ad13",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -3060,
        600
      ]
    },
    {
      "id": "2ff5e521-5288-47a9-af49-55a1bbbfb4f4",
      "name": "Operations",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2660,
        560
      ]
    },
    {
      "id": "5b78271a-6474-4d87-a344-72f7f63822dc",
      "name": "Get MCP-tagged Workflows",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -2400,
        200
      ]
    },
    {
      "id": "1197d29e-b124-4576-846d-876ad16de6e9",
      "name": "Filter Matching Ids",
      "type": "n8n-nodes-base.filter",
      "position": [
        -2180,
        200
      ]
    },
    {
      "id": "81623298-c3e7-4e20-86a9-d2587b302f28",
      "name": "Store In Memory",
      "type": "n8n-nodes-base.redis",
      "position": [
        -1520,
        0
      ]
    },
    {
      "id": "5ff0ea2f-a2ee-4cc3-bdf9-153ce5973770",
      "name": "AddTool Success",
      "type": "n8n-nodes-base.set",
      "position": [
        -1300,
        0
      ]
    },
    {
      "id": "1d3169cc-15cd-4296-9e63-bb162322e5e2",
      "name": "AddTool Error",
      "type": "n8n-nodes-base.set",
      "position": [
        -1740,
        200
      ]
    },
    {
      "id": "6149a950-c1ed-44b4-aee6-3daeabf8ba01",
      "name": "Get Memory",
      "type": "n8n-nodes-base.redis",
      "position": [
        -2860,
        600
      ]
    },
    {
      "id": "3c538002-45f7-4a2f-9ef4-5aede63235ab",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -2180,
        400
      ]
    },
    {
      "id": "d41e48e0-d610-4e18-9942-842419c99c83",
      "name": "Filter Matching IDs",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1960,
        400
      ]
    },
    {
      "id": "21d8cdda-bb47-42cd-a056-809a5556b438",
      "name": "Store In Memory1",
      "type": "n8n-nodes-base.redis",
      "position": [
        -1520,
        500
      ]
    },
    {
      "id": "5a391d0a-ba13-4d54-85fd-eb2f6a935614",
      "name": "Remove Tool Success",
      "type": "n8n-nodes-base.set",
      "position": [
        -1300,
        400
      ]
    },
    {
      "id": "65dfecc4-43ba-4518-adbf-9676c5cb1377",
      "name": "Convert to JSON",
      "type": "n8n-nodes-base.set",
      "position": [
        -2400,
        400
      ]
    },
    {
      "id": "b8b64fc2-63cf-4b17-9b6d-9d94aec10065",
      "name": "listTools Success",
      "type": "n8n-nodes-base.set",
      "position": [
        -2400,
        600
      ]
    },
    {
      "id": "d4fd9e74-f040-4b3c-8ce0-371315a0d130",
      "name": "Get MCP-tagged Workflows1",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -2180,
        600
      ]
    },
    {
      "id": "d58922c4-b721-4228-83cb-0b1d9632bbc6",
      "name": "Simplify Workflows1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1960,
        600
      ]
    },
    {
      "id": "b44b1115-5153-4b98-979f-219a32b693de",
      "name": "listTools Success1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1740,
        600
      ]
    },
    {
      "id": "e9d9a33c-ebfa-4f74-a4da-fb6b6f6f6df5",
      "name": "Get Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -1920,
        1020
      ]
    },
    {
      "id": "c028324a-5c79-4ce9-afd6-097b6f75a74a",
      "name": "executeTool Result",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1440,
        1020
      ]
    },
    {
      "id": "9eeac3cb-af7e-44c7-8891-6ff4367d0b54",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -3600,
        1040
      ]
    },
    {
      "id": "23601548-7863-403e-a671-267bf592b824",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -3840,
        1040
      ]
    },
    {
      "id": "54ed210d-e1b8-4bd7-85e4-88678111a45e",
      "name": "MCP Client",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        -3360,
        1240
      ]
    },
    {
      "id": "c612da64-9cc1-4601-a987-cd2023fd1863",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -3500,
        1240
      ]
    },
    {
      "id": "77a9fd22-c31c-49e4-9d5f-af572b137925",
      "name": "Convert to JSON1",
      "type": "n8n-nodes-base.set",
      "position": [
        -2360,
        1120
      ]
    },
    {
      "id": "3377aa25-4190-4bdc-be20-b4e324212060",
      "name": "Has Workflow Available?",
      "type": "n8n-nodes-base.if",
      "position": [
        -2140,
        1120
      ]
    },
    {
      "id": "92b1bb21-d739-47f0-a278-92ffa5a10cbf",
      "name": "ExecuteTool Error",
      "type": "n8n-nodes-base.set",
      "position": [
        -1920,
        1220
      ]
    },
    {
      "id": "529e35e0-cf11-405a-9011-e6f7f2122a4e",
      "name": "Workflow Exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1960,
        200
      ]
    },
    {
      "id": "ba278834-c774-4a3d-8ebc-f64ac77317c2",
      "name": "N8N Workflows MCP Server",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        -3720,
        240
      ]
    },
    {
      "id": "ed940612-4772-4377-afe2-5484a8978665",
      "name": "Add Workflow",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -3800,
        460
      ]
    },
    {
      "id": "e7d5096c-3545-43fd-aa1f-495dc041ccce",
      "name": "RemoveWorkflow",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -3700,
        560
      ]
    },
    {
      "id": "c20b63dc-e768-4529-a08c-5370853fc4c9",
      "name": "List Workflows",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -3580,
        660
      ]
    },
    {
      "id": "88fb8a1e-2f4c-4ff1-8be9-0f7afee2dd4d",
      "name": "SearchWorkflows",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -3460,
        560
      ]
    },
    {
      "id": "c643c007-de89-4d94-9739-aeb2032c792f",
      "name": "ExecuteWorkflow",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -3340,
        460
      ]
    },
    {
      "id": "4f1c1559-8d50-48b1-94f2-542e0bb4d494",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3920,
        80
      ],
      "parameters": {
        "width": 720,
        "height": 740,
        "content": "## 1. Add MCP Server Trigger\n[Read more about the MCP server trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger/)"
      }
    },
    {
      "id": "54d61491-04dc-4263-96e0-67827842ca07",
      "name": "Execute Workflow with PassThrough Variables",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -1660,
        1020
      ]
    },
    {
      "id": "1042884f-a44c-4757-9ff9-3a5cc81058f2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2600,
        -140
      ],
      "parameters": {
        "width": 740,
        "height": 300,
        "content": "## 2. Dynamically manage a list of \"Available\" Workflows\n[Learn more about the n8n node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.n8n)\n\nThe idea is to limit the number of wor"
      }
    },
    {
      "id": "903ead44-3eab-4606-aa4e-e66378bb5f7e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2420,
        820
      ],
      "parameters": {
        "width": 1160,
        "height": 600,
        "content": "## 3. Let the Agent execute any N8N Workflow\n[Learn more about the Execute Workflow node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/)\n\nFinally once the agent h"
      }
    },
    {
      "id": "194fbcbc-a7bb-41c8-9289-a214b1415386",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -3660,
        1240
      ]
    },
    {
      "id": "aee33258-cf30-4cb4-ab58-7bef7ba27b65",
      "name": "Is Empty Array?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1740,
        400
      ]
    },
    {
      "id": "b367a25f-e679-4a71-910e-27f1aa686816",
      "name": "Delete Key",
      "type": "n8n-nodes-base.redis",
      "position": [
        -1520,
        300
      ]
    },
    {
      "id": "eec527e1-db4d-4294-a076-379ebd9640a9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3920,
        860
      ],
      "parameters": {
        "width": 740,
        "height": 560,
        "content": "## 4. Connect any Agent with a MCP Client\nUse this agent to test your MCP server. Note, i"
      }
    },
    {
      "id": "c9b51f36-f9bd-4a60-b195-8da229462331",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2880,
        820
      ],
      "parameters": {
        "width": 320,
        "height": 400,
        "content": "* **AddWorkflow**\n  This tool adds (or rather, appends) workflows to our \"available\" list.\n* **RemoveWorkflow**\n  This tool removes a workflow entry from our list.\n* **listWorkflows**\n  This tool disp"
      }
    },
    {
      "id": "91b2859a-7563-4ebd-ae61-c9a487e18d81",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4600,
        -180
      ],
      "parameters": {
        "width": 600,
        "height": 1440,
        "content": "## Try it out!\n### This n8n template shows you how to create an MCP server out of your existing n8n workflows. With this, any MCP client connected can get more done with powerful end-to-end workflows "
      }
    },
    {
      "id": "ec3194d2-90c8-4019-a1b5-576c61e9a8b0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2600,
        -280
      ],
      "parameters": {
        "width": 380,
        "height": 120,
        "content": "### How many existing workflows can I use?\nWell, as many as you want really! For this example, I've limited it for workflows which are tagged as \"mcp\" but you can remove this filter to allow all."
      }
    },
    {
      "id": "5f587241-5604-4724-bc01-3c9bc3f7bdc2",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1720,
        1000
      ],
      "parameters": {
        "width": null,
        "height": 440,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 🚨 Ensure this node does not set the input schema!\nFor passthrough parameters to work, this node should not make available input schema fields. ie. the input fields should not be vis"
      }
    }
  ],
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "Filter Matching IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Key": {
      "main": [
        [
          {
            "node": "Remove Tool Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Memory": {
      "main": [
        [
          {
            "node": "Operations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MCP Client": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Operations": {
      "main": [
        [
          {
            "node": "Get MCP-tagged Workflows",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Convert to JSON",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "listTools Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get MCP-tagged Workflows1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Convert to JSON1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Workflow": {
      "ai_tool": [
        [
          {
            "node": "N8N Workflows MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get Parameters": {
      "main": [
        [
          {
            "node": "Execute Workflow with PassThrough Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Workflows": {
      "ai_tool": [
        [
          {
            "node": "N8N Workflows MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "RemoveWorkflow": {
      "ai_tool": [
        [
          {
            "node": "N8N Workflows MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Convert to JSON": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ExecuteWorkflow": {
      "ai_tool": [
        [
          {
            "node": "N8N Workflows MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Is Empty Array?": {
      "main": [
        [
          {
            "node": "Delete Key",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store In Memory1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SearchWorkflows": {
      "ai_tool": [
        [
          {
            "node": "N8N Workflows MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Store In Memory": {
      "main": [
        [
          {
            "node": "AddTool Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to JSON1": {
      "main": [
        [
          {
            "node": "Has Workflow Available?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store In Memory1": {
      "main": [
        [
          {
            "node": "Remove Tool Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Exists?": {
      "main": [
        [
          {
            "node": "Simplify Workflows",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AddTool Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simplify Workflows": {
      "main": [
        [
          {
            "node": "Store In Memory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Matching IDs": {
      "main": [
        [
          {
            "node": "Is Empty Array?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Matching Ids": {
      "main": [
        [
          {
            "node": "Workflow Exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simplify Workflows1": {
      "main": [
        [
          {
            "node": "listTools Success1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Workflow Available?": {
      "main": [
        [
          {
            "node": "Get Parameters",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ExecuteTool Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get MCP-tagged Workflows": {
      "main": [
        [
          {
            "node": "Filter Matching Ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get MCP-tagged Workflows1": {
      "main": [
        [
          {
            "node": "Simplify Workflows1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Get Memory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow with PassThrough Variables": {
      "main": [
        [
          {
            "node": "executeTool Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}