MCP Servers & Tools
Expose n8n workflows as MCP tools via n8n API and Redis for AI clients
Connects MCP clients such as Claude Desktop to existing n8n workflows so agents can run end-to-end tasks as outcome-oriented tools rather than many small calls.
What it does
## Try it out! ### 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 rather than just simple tools. Designing agent tools for outcome rather than utility has been a long recommended practice of mine and it applies well when it comes to building MCP servers; In gist, it prefers agents to be making the least calls possible to complete a task. This is why n8n can be a great fit for MCP servers! This template connects your agent/MCP client (like Claude Desktop) to your existing workflows by allowing the AI to discover, manage and run these workflows indirectly. ### How it works * An MCP trigger is used and attaches 4 custom workflow tools to discover and manage existing workflows to use and 1 custom workflow tool to execute them. * We'll introduce an idea of "available" workflows which the agent is allowed to use. This will help limit and avoid some issues when trying to use every workflow such as clashes or non-production. * The n8n node is a core node which taps into your n8n instance API and is able to retrieve all workflows or filter by tag. For our example, we've tagged the workflows we want to use with "mcp" and these are exposed through the tool "search workflows". * Redis is used as our main memory for keeping track of which workflows are "available". The tools we have are "add Workflow", "remove workflow" and "list workflows". The agent should be able to manage this autonomously. * Our approach to allow the agent to execute workflows is to use the Subworkflow trigger. The tricky part is figuring out the input schema for each but was eventually solved by pulling this information out of the workflow's template JSON and adding it as part of the "available" workflow's description. To pass parameters through the Subworkflow trigger, we can do so via the passthrough method - which is that incoming data is used when parameters are not explicitly set within the node. * When running, the agent will not see the "available" workflows immediately but will need to discover them via "list" and "search". The human will need to make the agent aware that these workflows will be preferred when answering queries or completing tasks. ### How to use * First, decide which workflows will be made visible to the MCP server. This example uses the tag
The steps
- Simplify Workflows
- When Executed by Another Workflow
- Operations
- Get MCP-tagged Workflows
- Filter Matching Ids
- Store In Memory
- AddTool Success
- AddTool Error
- Get Memory
- Split Out
- Filter Matching IDs
- Store In Memory1
- Remove Tool Success
- Convert to JSON
39 steps in total.
Similar automations
MCP Servers & ToolsExpose production tools to MCP clients with Slack approval gates20 stepsMCP Servers & ToolsTurn n8n Workflows into an MCP Server38 stepsMCP Servers & ToolsExpose Google Drive Search and File Reads to AI Clients via MCP Server14 stepsMCP Servers & ToolsManage Harvest Clients and Company Data via MCP Server52 steps