Integrating n8n with Msty
In the evolving landscape of AI and automation, integrating platforms like n8n with Msty can significantly enhance your workflows. This guide walks you through setting up n8n as an MCP server, connecting it to Msty, and leveraging AI models for seamless interactions.
Video Guide
Understanding n8n - Your Automation Companion
n8n is an open-source workflow automation tool that enables you to connect various apps and services without extensive coding. With its visual interface, you can design complex workflows that automate tasks across different platforms.
Key Features:
- Visual Workflow Builder: Design workflows using a drag-and-drop interface.
- Extensive Integrations: Connect with over 200 services, including databases, APIs, and cloud platforms.
- Custom Functions: Implement custom logic using JavaScript functions within workflows.
Set Up n8n's MCP Server Trigger
The MCP (Model Context Protocol) Server Trigger in n8n allows external clients to interact with n8n workflows as tools. This is particularly useful for integrating with AI platforms like Msty.
Steps to Configure:
- Create a New Workflow in n8n.
- Add MCP Server Trigger Node by searching for "MCP Server Trigger" node.
- Configure MCP Server Trigger Parameters by double clicking the MCP Server Trigger node. This is also where you can capture the production URL endpoint that we'll need later in the setup.
You can also configure authentication from here to add more security around this endpoint and you n8n workflow. Keep in mind, if you don't add any authentication, then you'll be leaving the workflow open to anyone who knows the URL.
- Add tools and additional nodes to your workflow.
In our example workflow, we've added the MCP Server Trigger node and added two tools to it.
- An HTTP Request node that calls a Chuck Norris fact endpoint (https://api.chucknorris.io/jokes/random) to get a random Chuck Norris fact
- Added the Discord node and connected it to our Discord channel so that we can send Chuck Norris facts to our Discord
Build out your workflow and test as you go. Once you are done building out your n8n workflow, head over to Msty Studio where we'll add n8n to the Toolbox.
Integrate n8n as a Tool in Msty Using MCP-Remote
To enable Msty to interact with your n8n workflows, you'll first add it as a tool.
- Navigate to the Toolbox and click button to Add New Tool.
- Add a Tool ID.
- Add the Tool Configuration.
We'll add the n8n workflow using a utility called mcp-remote
, which acts as a bridge between Msty and external MCP Servers.
Copy and paste the below into the Tool Configuration text area.
{
"command": "npx",
"args": [
"mcp-remote",
"<MCP_URL>",
"--header",
"Authorization: Bearer ${AUTH_TOKEN}"
],
"env": {
"AUTH_TOKEN": "<MCP_BEARER_TOKEN>"
}
}
Replace <MCP_URL>
with your n8n production URL.
If you enabled authentication in your n8n setup, then include --header
, Authorization: Bearer ${AUTH_TOKEN}
, and the env
section. For the environment variables, these can be set in the next step.
- Give the tool a unique name.
- Click Add to save it out.
Test Tool
After you saved the new tool, click the asterisk (*) next to the tool name to open the tool advanced settings.
In the advanced settings, this is where you can set the environment variables for the tool.
You can also test the tool by expanding Tool Console and the clicking the button to List Features.
This will run the tool and check for what features are available. If it returns the list of features you are expecting, then you know the tool is working.
Otherwise, if you see an error, re-check the configuration of the tool and try again.
Add Tool to a Toolset
Next, click on the Toolset tab and then add a new Toolset where you'll enable the tool you just created.
Engage with AI Models Accessing n8n Tools
With the integration in place, AI models within Msty can invoke n8n workflows as tools. This enables dynamic interactions where AI agents can trigger complex automation sequences defined in n8n.
In the chat window, add the tool by selecting the Toolset icon and then select the toolset you just created.
You can now chat with the LLM of your choice which will have access to the tools you just added.
Powerful Use Cases
You can use n8n tools in Msty to automate a wide range of tasks.
Here are just a few examples:
- Data Retrieval: AI agents can fetch data from databases or APIs via n8n workflows.
- Task Automation: Automate repetitive tasks like sending emails or updating records.
- Complex Decision Making: Implement logic-heavy processes that AI agents can trigger based on context.
Conclusion
Integrating n8n with Msty via MCP enhances the capabilities of AI-driven workflows, allowing for sophisticated automation and seamless interactions between tools. By setting up n8n as an MCP server and connecting it to Msty, you unlock a new realm of possibilities in AI-assisted automation.