home / mcp / n8n mcp server

N8N MCP Server

Provides MCP access to list, view, run, and monitor n8n workflows via an MCP client.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "dopehunter-n8n_mcp_server_complete": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "N8N_API_KEY": "YOUR_API_KEY",
        "N8N_BASE_URL": "http://localhost:5678/api"
      }
    }
  }
}

You can manage n8n workflows directly from AI agents or LLMs through a dedicated MCP server. This server exposes a stable interface to list, view, execute, and monitor your n8n workflows, letting you pass data into workflows and orchestrate automation from your AI copilots.

How to use

You connect an MCP client to the server and use the available MCP methods to interact with your n8n instance. You can list all workflows, inspect details of a specific workflow, run a workflow with optional input data, and review execution history. You can also activate or deactivate workflows as needed. All actions are performed through the MCP interface, which you use from your AI agent to orchestrate automation tasks.

How to install

Prerequisites you need before starting:

  • Node.js v14+
  • n8n instance with API access
  • An MCP client that supports the Model Context Protocol

Step by step commands to get up and running:

# Install the MCP server package
npm install @dopehunter/n8n-mcp-server

# Create environment configuration
cp .env.example .env

Configure your environment and start

Edit the environment file to point the MCP server at your n8n instance. You need the base URL for the n8n API and an API key with sufficient permissions.

# .env
N8N_BASE_URL=http://localhost:5678/api
N8N_API_KEY=your_n8n_api_key_here

Start the MCP server using the standard startup command.

npm start

Once the server is running, you can test basic MCP operations by issuing requests to the MCP endpoint exposed by the server.

curl -X POST http://localhost:3000/mcp -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":"1","method":"mcp.tools.list","params":{}}'

Troubleshooting and tips

Connection issues often indicate the n8n instance is not reachable at the URL you configured. Double-check that N8N_BASE_URL points to a live n8n API and that the API key is correct and has the necessary permissions.

If you encounter permission or authentication problems, regenerate or verify your n8n API key and ensure it is correctly set in the .env file.

If you are running the server in a container, ensure the container has network access to your n8n instance and that any required environment variables are passed through.

Configuration and security notes

Keep your API keys and base URL secure. Do not expose these values in logs or client-side configurations. Use proper secret management for production deployments.

Available tools

n8n_list_workflows

List all workflows in the connected n8n instance. Returns the available workflows for selection or inspection.

n8n_get_workflow

Retrieve details for a specific workflow by its ID, including nodes and configuration.

n8n_execute_workflow

Execute a specified workflow and optionally pass data to the workflow run.

n8n_get_executions

Fetch the execution history for a given workflow, with an optional limit on results.

n8n_activate_workflow

Activate a workflow to make it available for triggering.

n8n_deactivate_workflow

Deactivate a workflow to prevent it from triggering.