home / mcp / n8n mcp server

n8n MCP Server

Provides an MCP server to manage n8n workflows via the MCP interface, including workflows, credentials, tags, variables, and executions.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "get2knowio-n8n-mcp": {
      "command": "n8n-mcp",
      "args": [],
      "env": {
        "N8N_API_KEY": "YOUR_API_KEY",
        "N8N_BASE_URL": "http://localhost:5678",
        "N8N_PASSWORD": "test",
        "N8N_USERNAME": "test"
      }
    }
  }
}

You run an MCP server that bridges n8n workflows with AI agents, giving you programmatic control to create, read, update, and manage workflows and related resources through a unified interface. This server simplifies automations, testing, and integration by exposing workflow operations, credential handling, tag and variable management, and execution data via MCP-compatible tooling.

How to use

Use an MCP client to interact with the server. You can run the MCP server locally via stdio or connect to it through a remote HTTP endpoint if provided. You will manage workflows, credentials, tags, variables, and executions, and you can drive actions with CLI commands or via MCP-enabled agents.

Key tasks you’ll perform include listing workflows, creating or updating workflows, activating or deactivating them, managing credentials and credential aliases, tagging, handling variables, pulling from source control, examining executions, and running a workflow once for testing.

How to install

Prerequisites: Node.js and npm should be available on your system. Ensure you have network access for npm packages.

# Global install option (recommended for quick start)
npm i -g @get2knowio/n8n-mcp

# Or run directly without installing
npx @get2knowio/n8n-mcp

Configuration and run options

Configure access to your n8n instance. You can authenticate with API keys or basic authentication. Use environment variables to supply credentials and the base URL of your n8n instance.

# API key authentication
export N8N_BASE_URL=http://localhost:5678
export N8N_API_KEY=your_api_key_here

# Basic authentication
export N8N_BASE_URL=http://localhost:5678
export N8N_USERNAME=your_username
export N8N_PASSWORD=your_password

Running the MCP server

Start the MCP server in stdio mode for integration with AI agents. You can run it after installation.

# Global install path
n8n-mcp

# Or using npx without installation
npx @get2knowio/n8n-mcp

CLI usage overview

If you prefer the CLI, you can list, get, create, and manage resources directly from the command line. All CLI output is structured JSON by default.

n8n-mcp list
n8n-mcp get 1
n8n-mcp create path/to/workflow.json
n8n-mcp activate 1

Notes on security and debugging

For traceable errors and easier troubleshooting, enable debug logging and optional source maps when developing or debugging.

MCP_DEBUG=debug MCP_ENABLE_SOURCE_MAPS=1 npm start 2>server.log

Examples of common workflows

Create a new workflow that uses a webhook, then test the deployment by running the workflow manually or triggering it via the webhook.

Available tools

list_workflows

List all workflows available in the connected n8n instance.

get_workflow

Retrieve a single workflow by its ID.

create_workflow

Create a new workflow with nodes and connections.

update_workflow

Update an existing workflow, with optional optimistic concurrency.

delete_workflow

Delete a workflow by its ID.

activate_workflow

Activate a workflow to enable automatic running.

deactivate_workflow

Deactivate a workflow to stop automatic running.

list_credentials

List all credentials available in the n8n instance.

resolve_credential_alias

Resolve a credential alias to its actual credential ID.

source_control_pull

Pull changes from source control to synchronize workflows.

get_credential_schema

Fetch the JSON schema for a credential type.

list_workflow_tags

List tags associated with a specific workflow.

set_workflow_tags

Assign tags to a workflow by name or ID.

transfer_workflow

Transfer a workflow to a different project or owner (enterprise feature).

transfer_credential

Transfer a credential to a different project or owner (enterprise feature).

list_executions

List workflow executions with pagination support.

get_execution

Get details for a specific execution by ID.

delete_execution

Delete an execution record.

webhook_urls

Get webhook URLs for a webhook node in a workflow.

run_once

Execute a workflow once for testing or manual runs.

list_variables

List all key-value variables with pagination.

create_variable

Create a new variable, enforcing unique keys.

update_variable

Update an existing variable value.

delete_variable

Delete a variable by ID.

list_tags

List all tags with optional pagination.

get_tag

Get a tag by ID.

create_tag

Create a new tag with a name and optional color.

update_tag

Update an existing tag's name or color.

delete_tag

Delete a tag by ID.