- Explore MCP Servers
- n8n-mcp-tool
N8n Mcp Tool
What is N8n Mcp Tool
n8n-mcp-tool is a command-line interface (CLI) tool designed to facilitate the creation of workflows in a self-hosted n8n instance using the Model Context Protocol (MCP). It allows users to define workflows programmatically through JSON definitions.
Use cases
Use cases for n8n-mcp-tool include automating repetitive tasks, integrating various services and APIs, and enabling AI assistants to create and manage workflows dynamically.
How to use
To use n8n-mcp-tool, first install it globally using ‘npm install -g n8n-mcp-tool’ or as a project dependency. Set the required environment variables: ‘N8N_API_KEY’ for your n8n API key and ‘N8N_BASE_URL’ for your n8n instance URL. The tool is primarily invoked by MCP-compatible agents, which will call the ‘create_workflow’ tool with a JSON payload.
Key features
Key features of n8n-mcp-tool include the ability to create n8n workflows from JSON definitions, integration with MCP-compatible agents, and direct command-line usage for testing and development.
Where to use
n8n-mcp-tool is suitable for use in automation, workflow management, and integration scenarios, particularly where AI assistants that support MCP are involved.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is N8n Mcp Tool
n8n-mcp-tool is a command-line interface (CLI) tool designed to facilitate the creation of workflows in a self-hosted n8n instance using the Model Context Protocol (MCP). It allows users to define workflows programmatically through JSON definitions.
Use cases
Use cases for n8n-mcp-tool include automating repetitive tasks, integrating various services and APIs, and enabling AI assistants to create and manage workflows dynamically.
How to use
To use n8n-mcp-tool, first install it globally using ‘npm install -g n8n-mcp-tool’ or as a project dependency. Set the required environment variables: ‘N8N_API_KEY’ for your n8n API key and ‘N8N_BASE_URL’ for your n8n instance URL. The tool is primarily invoked by MCP-compatible agents, which will call the ‘create_workflow’ tool with a JSON payload.
Key features
Key features of n8n-mcp-tool include the ability to create n8n workflows from JSON definitions, integration with MCP-compatible agents, and direct command-line usage for testing and development.
Where to use
n8n-mcp-tool is suitable for use in automation, workflow management, and integration scenarios, particularly where AI assistants that support MCP are involved.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
n8n MCP Tool
A tool to create new workflows in a self-hosted n8n instance from a JSON definition using the Model Context Protocol.
Overview
This package provides a command-line interface (CLI) tool that allows you to programmatically create workflows in your self-hosted n8n instance. It leverages the Model Context Protocol (MCP) to expose a create_workflow
tool, making it suitable for integration with AI assistants (like Claude) that support MCP.
Features
- Create n8n Workflows: Easily create new workflows in your n8n instance by providing a JSON definition.
- MCP Integration: Exposes a tool for Model Context Protocol compatible agents.
- CLI Usage: Can be used directly from the command line for testing and development.
Installation
To install this tool globally (recommended for CLI tools):
npm install -g n8n-mcp-tool
Or, if you prefer to use it as a project dependency:
npm install n8n-mcp-tool
Usage
Environment Variables
Before using the tool, you must set the following environment variables:
N8N_API_KEY
: Your n8n API key. You can generate one in your n8n instance under “Settings” > “User Management” > “API Keys”.N8N_BASE_URL
: The base URL of your self-hosted n8n instance (e.g.,https://your-n8n-instance.com/
). Ensure it ends with a trailing slash if necessary for your n8n setup.
You can set these in your shell or use a .env
file in the directory where you run the tool locally.
As an MCP Tool (e.g., with Claude)
This tool is primarily designed to be invoked by an MCP-compatible agent. When used with an agent like Claude, you will configure the server to use this tool. The agent will then call the create_workflow
tool with a JSON payload defining the n8n workflow.
Example Claude config.json
entry:
Replace YOUR_N8N_API_KEY
and https://your-n8n-instance.com/
with your actual values.
Direct CLI Usage (for testing/development)
While primarily designed for MCP integration, you can technically test it directly by piping a JSON input to it if you need to.
First, ensure the tool is built (if running from source):
npm run build
Then, you can pipe a JSON string to the globally installed command:
echo '{"workflow_json": {"name": "Test Workflow from CLI", "nodes": [{"parameters": {}, "name": "Start", "type": "n8n-nodes-base.start", "typeVersion": 1, "id": "node1"}]}}' | mcp-n8n-create-workflow
(Note: Ensure your N8N_API_KEY
and N8N_BASE_URL
environment variables are set in your shell when running direct CLI commands.)
Development
To set up the project for local development:
- Clone the repository:
git clone [https://github.com/YourUsername/n8n-mcp-tool.git](https://github.com/YourUsername/n8n-mcp-tool.git) # Replace YourUsername cd n8n-mcp-tool
- Install dependencies:
npm install
- Build the project:
npm run build
Contributing
Contributions are welcome! If you find a bug or have an idea for an improvement, please:
- Open an issue to discuss the proposed change.
- Fork the repository and create a new branch for your feature or fix.
- Submit a pull request with your changes.
License
This project is licensed under the ISC License. See the LICENSE file for details.
🚨 Note: A much more comprehensive n8n MCP server tool already exists here: https://github.com/leonardsellem/n8n-mcp-server. I built this project primarily as a personal learning exercise.
DevTools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.