n8n Workflow Automation MCP server

Enables AI to create, manage, and execute n8n workflows using natural language commands for automating complex business processes without requiring technical knowledge of n8n's internal APIs.
Back to servers
Setup instructions
Provider
Jacob Dietle
Release date
May 21, 2025
Language
Python
Stats
5 stars

The n8n MCP Server provides a powerful interface that allows AI agents to interact with n8n workflows through natural language. This server implements the Model Context Protocol (MCP) to create a bridge between AI systems and your automated workflows in n8n.

Installation Options

Quick Deployment with Railway

The fastest way to deploy the n8n MCP server is using Railway's one-click deployment:

Deploy on Railway

After clicking the button, you'll be prompted to configure the necessary environment variables (details in the Configuration section below).

Docker Deployment

For local testing or manual deployment, you can use Docker:

  1. Build the Docker image:

    docker build -t n8n-mcp-server-supergateway .
    
  2. Run the Docker container:

    docker run --rm -it -p 8080:8080 \
      -e PORT=8080 \
      -e N8N_API_URL="YOUR_N8N_API_URL" \
      -e N8N_API_KEY="YOUR_N8N_API_KEY" \
      -e N8N_WEBHOOK_USERNAME="your_webhook_user" \
      -e N8N_WEBHOOK_PASSWORD="your_webhook_password" \
      -e DEBUG=true \
      n8n-mcp-server-supergateway
    

The server will be accessible via SSE on http://localhost:8080 with /sse for the event stream and /message for posting messages.

Configuration

The following environment variables are required:

  • N8N_API_URL: Your n8n instance API URL (e.g., https://n8n.example.com/api/v1)
  • N8N_API_KEY: Your n8n API Key (treated as a secret)
  • N8N_WEBHOOK_USERNAME: Username for basic authentication on n8n webhook nodes (default: anyname)
  • N8N_WEBHOOK_PASSWORD: Password for basic authentication on n8n webhook nodes (default: somepassword)
  • DEBUG: Set to true for verbose logging, false for production (default: false)
  • PORT: The port the application will listen on (default: 8080)

How to Generate an n8n API Key

  1. Open your n8n instance in a browser
  2. Navigate to Settings > API
  3. Create a new API key with appropriate permissions
  4. Copy the key for use in your configuration

Connecting to the Server

Once running, the server exposes an MCP interface over Server-Sent Events (SSE) at:

  • SSE Stream: http://<server_address>:<port>/sse
  • Message Endpoint: http://<server_address>:<port>/message

If deployed on Railway, your server address will be your public Railway URL (e.g., https://my-n8n-mcp.up.railway.app).

Direct SSE Connection

If your MCP client supports connecting to an MCP server via an SSE URL and message endpoint, use this configuration:

{
  "n8n_local_docker_sse": {
    "url": "https://my-n8n-mcp.up.railway.app/sse",
    "disabled": false,
    "alwaysAllow": [
      "mcp_n8n_docker_direct_list_workflows", 
      "mcp_n8n_docker_direct_get_workflow",
      "mcp_n8n_docker_direct_create_workflow",
      "mcp_n8n_docker_direct_update_workflow",
      "mcp_n8n_docker_direct_delete_workflow",
      "mcp_n8n_docker_direct_activate_workflow",
      "mcp_n8n_docker_direct_deactivate_workflow",
      "mcp_n8n_docker_direct_list_executions"
    ],
    "timeout": 300
  }
}

Using Supergateway on the Client-Side

If your MCP client expects to launch a local command that communicates via stdio, you can use Supergateway as an SSE-to-stdio bridge:

{
  "mcpServers": {
    "n8n-remote-sse": {
      "command": "npx",
      "args": [
        "-y",
        "supergateway",
        "--sse", "http://<server_address>:<port>",
        "--outputTransport", "stdio",
        "--logLevel", "info"
      ],
      "env": {},
      "disabled": false
    }
  }
}

Available Tools

Using Webhooks

To use webhook functionality with the MCP server:

  1. Create a webhook-triggered workflow in n8n
  2. Set up Basic Authentication on your webhook node (recommended)
  3. Use the run_webhook tool to trigger the workflow

Example:

const result = await mcp.tools.run_webhook({
  workflowName: "hello-world", // Will call <n8n-url>/webhook/hello-world
  data: {
    prompt: "Hello from AI assistant!"
  }
});

Workflow Management Tools

  • workflow_list: List all workflows
  • workflow_get: Get details of a specific workflow
  • workflow_create: Create a new workflow
  • workflow_update: Update an existing workflow
  • workflow_delete: Delete a workflow
  • workflow_activate: Activate a workflow
  • workflow_deactivate: Deactivate a workflow

Execution Management Tools

  • execution_run: Execute a workflow via the API
  • execution_get: Get details of a specific execution
  • execution_list: List executions for a workflow

Self-Hosting (Advanced)

For direct Node.js execution without Docker:

  1. Clone the repository:

    git clone https://github.com/YOUR_USERNAME/YOUR_REPONAME.git
    cd YOUR_REPONAME
    
  2. Install dependencies:

    npm install
    
  3. Build the server:

    npm run build
    
  4. Configure environment variables: Create a .env file with your n8n API details and other required variables

  5. Run the stdio MCP server:

    node build/index.js
    
  6. Optional: Exposing via SSE with manual Supergateway setup:

    npx -y supergateway --stdio "node build/index.js" --port 8080
    

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "n8n_local_docker_sse" '{"url":"https://my-n8n-mcp.up.railway.app/sse","disabled":false,"alwaysAllow":["mcp_n8n_docker_direct_list_workflows","mcp_n8n_docker_direct_get_workflow","mcp_n8n_docker_direct_create_workflow","mcp_n8n_docker_direct_update_workflow","mcp_n8n_docker_direct_delete_workflow","mcp_n8n_docker_direct_activate_workflow","mcp_n8n_docker_direct_deactivate_workflow","mcp_n8n_docker_direct_list_executions"],"timeout":300}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "n8n_local_docker_sse": {
            "url": "https://my-n8n-mcp.up.railway.app/sse",
            "disabled": false,
            "alwaysAllow": [
                "mcp_n8n_docker_direct_list_workflows",
                "mcp_n8n_docker_direct_get_workflow",
                "mcp_n8n_docker_direct_create_workflow",
                "mcp_n8n_docker_direct_update_workflow",
                "mcp_n8n_docker_direct_delete_workflow",
                "mcp_n8n_docker_direct_activate_workflow",
                "mcp_n8n_docker_direct_deactivate_workflow",
                "mcp_n8n_docker_direct_list_executions"
            ],
            "timeout": 300
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "n8n_local_docker_sse": {
            "url": "https://my-n8n-mcp.up.railway.app/sse",
            "disabled": false,
            "alwaysAllow": [
                "mcp_n8n_docker_direct_list_workflows",
                "mcp_n8n_docker_direct_get_workflow",
                "mcp_n8n_docker_direct_create_workflow",
                "mcp_n8n_docker_direct_update_workflow",
                "mcp_n8n_docker_direct_delete_workflow",
                "mcp_n8n_docker_direct_activate_workflow",
                "mcp_n8n_docker_direct_deactivate_workflow",
                "mcp_n8n_docker_direct_list_executions"
            ],
            "timeout": 300
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later