Sponsored by Deepsite.site

N8n Workflow Builder

Created By
ifmelate9 months ago
Content

n8n Workflow Builder MCP

This project provides a Model Context Protocol (MCP) server for building and manipulating n8n workflows JSON in Cursor IDE. It's a way to build n8n workflows just by prompting with AI in chat.

DEMO VIDEO:

Watch the video

Current status of implementation

It's in early development stage. Basically, it's working - MCP server creates JSON file with n8n workflow that you can copy and paste to workflow editor in n8n UI. Current problems:

  • sometimes llm agents put wrong parameters in the request. I plan to find a way to fix this.
  • sometimes connection between nodes is not setting. I'm working to resolve it.
  • not all types of node are checked working. I'm working to resolve it.
  • initial prompt does matter. If it's not clear, the agent will go wrong way. I plan to find a way to fix this.

Key Features

  • Workflow Management: Create, update, and execute n8n workflows programmatically (execute is not implemented yet)
  • Node Discovery: Explore available n8n nodes and their capabilities
  • Connection Management: Create connections between workflow nodes
  • AI Integration: Special tools for connecting AI components in workflows
  • AI-Friendly Interface: Designed specifically for interaction with AI agents

Prerequisites

  • Node.js (v14 or higher)
  • Cursor IDE (v0.48 or newer)
  • npm or yarn
  • TypeScript compiler (installed as a dev dependency via npm install)

Installation

  1. Clone the repository:

    git clone https://github.com/ifmelate/n8n-workflow-builder-mcp.git
    cd n8n-workflow-builder-mcp
    
  2. Install dependencies:

    npm install
    
  3. Build the TypeScript project:

    npm run build
    
  4. Make the MCP server script executable (if needed):

    chmod +x dist/index.js
    

Running the Server

Start the MCP server:

npm start

This will run the compiled code from dist/index.js.

For development with auto-rebuild and restart on changes:

npm run dev

Cursor IDE Integration

There are two ways to set up the MCP server with Cursor:

  1. Start Cursor IDE
  2. Go to Settings > Features > MCP Servers
  3. Click "Add Server" and provide the absolute path to the dist/index.js file (e.g., /Users/yourname/n8n-workflow-builder-mcp/dist/index.js)
  4. Make sure the server is enabled
  5. Restart Cursor IDE for changes to take effect

Method 2: Manual Configuration

  1. Ensure the .cursor directory exists:

    mkdir -p .cursor
    
  2. Create the MCP configuration file:

    cat > .cursor/mcp.json << 'EOF'
    {
      "mcpServers": {
        "n8n-workflow-builder": {
          "command": "node",
          "args": ["/absolute/path/to/n8n-workflow-builder-mcp/dist/index.js"]
        }
      }
    }
    EOF
    

    Make sure to replace /absolute/path/to with the actual path on your system.

  3. Restart Cursor IDE for changes to take effect

Available MCP Tools

The server provides the following tools for working with n8n workflows:

Tool NameDescriptionKey Parameters
create_workflowCreate a new n8n workflowworkflow_name, workspace_dir
list_workflowsList all existing workflows(no parameters)
get_workflow_detailsGet detailed information about a specific workflowworkflow_name
add_nodeAdd a new node to a workflowworkflow_name, node_type, position, parameters, node_name, typeVersion
edit_nodeEdit an existing node in a workflowworkflow_name, node_id, node_type, node_name, position, parameters
delete_nodeDelete a node from a workflowworkflow_name, node_id
add_connectionAdd a connection between nodesworkflow_name, source_node_id, source_node_output_name, target_node_id, target_node_input_name
add_ai_connectionsAdd AI connections for LangChain nodesworkflow_name, agent_node_id, model_node_id, tool_node_ids
list_available_nodesList available node types with optional filteringsearch_term (optional)

Troubleshooting Cursor Integration

If you're having trouble getting the MCP server to work with Cursor, try these steps:

  1. Restart Cursor: After setting up the MCP configuration, completely close and restart Cursor.

  2. Check Cursor MCP settings:

    • Open Cursor Settings
    • Go to Features > MCP Servers
    • Make sure your server is listed and enabled
    • If it's listed but not working, try clicking the refresh button
  3. Check server logs: Look for errors in the terminal where you're running the server or in the Cursor Output panel. Select "Cursor MCP" from the dropdown in the Output panel to see MCP-specific logs.

  4. Verify file permissions: Make sure the dist/index.js file has execution permissions.

  5. Check for port conflicts: If there are other MCP servers running, they might conflict. Check for other processes using the same ports.

  6. Try global installation: Instead of using a local path, you can try installing the server globally:

    npm install -g n8n-workflow-builder-mcp
    

    Then update the .cursor/mcp.json file to use the global command.

Common Issues and Solutions

"Failed to create client"

This usually happens when:

  • The MCP server isn't running
  • There's a connectivity issue between Cursor and the server
  • The server crashed during initialization

Try:

  1. Running the test script to make sure the server works correctly
  2. Checking for errors in the server logs
  3. Restarting Cursor

MCP Server is not showing up in Cursor

This can happen if:

  • The .cursor/mcp.json file is not properly formatted
  • Cursor hasn't detected the configuration change

Try:

  1. Validating the JSON format of your .cursor/mcp.json file
  2. Restarting Cursor
  3. Manually selecting the server in Cursor settings (if it appears there)

MCP Server shows up but tools aren't available

This can happen if:

  • The server isn't properly registering its tools
  • There's an issue with the ListOfferings request/response

Try:

  1. Running the test script to check if tools are properly registered
  2. Clicking the refresh button in the MCP server settings in Cursor
  3. Checking the server logs for any errors

Project Structure

  • /src: Main source code
  • /src/tools: MCP tools implementation
  • /src/models: Data models
  • /src/utils: Utility functions
  • /src/middleware: Authentication and middleware
  • /config: Configuration files
  • /tests: Test files
  • /workflow_nodes: n8n node definitions
  • /docs: Additional documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

Working on licence - need to have confirmation from n8n team

Server Config

{
  "mcpServers": {
    "n8n-workflow-builder": {
      "command": "node",
      "args": [
        "/absolute/path/to/n8n-workflow-builder-mcp/dist/index.js"
      ]
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor
ChatWiseThe second fastest AI chatbot™
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop