MCP Hub
Back to servers

@thecodesaiyan/tcs-n8n-mcp

MCP server for n8n workflow automation. Manage workflows, executions, tags, variables, credentials and users via the Model Context Protocol.

Updated
Feb 15, 2026

Quick Install

npx -y @thecodesaiyan/tcs-n8n-mcp

@thecodesaiyan/tcs-n8n-mcp

Manage your n8n workflows through AI assistants

npm version License: MIT Node.js MCP CI

An MCP server that gives AI assistants full control over your n8n workflow automation platform. List, create, update, execute, and manage workflows, executions, tags, variables, credentials, and users — all through natural language.

Installation · Tools · Security · Development


Features

  • 22 tools covering the full n8n REST API
  • Works everywhere — Claude Code, Claude Desktop, VS Code, Cursor, Windsurf, Cline
  • Secure by default — ID validation, sanitised errors, masked secrets, request timeouts
  • Flexible authentication — API key (default), Bearer token, or Basic Auth
  • Zero config — just provide your n8n API key and go
  • Lightweight — under 30KB, no runtime dependencies beyond the MCP SDK and Zod

Prerequisites


Installation

Quick Start

npx @thecodesaiyan/tcs-n8n-mcp --setup

The setup wizard walks you through configuration, tests your connection, and outputs ready-to-paste config for your MCP client.

Windows users: npx cannot resolve bin commands from scoped packages on Windows. Install globally instead:

npm install -g @thecodesaiyan/tcs-n8n-mcp
tcs-n8n-mcp --setup

Environment Variables

VariableRequiredDefaultDescription
N8N_API_KEYYesYour n8n API key (or password for basic auth)
N8N_API_URLNohttp://localhost:5678Base URL of your n8n instance
N8N_AUTH_TYPENoapikeyAuthentication method: apikey, bearer, or basic
N8N_API_USEROnly for basicUsername for basic authentication
N8N_TIMEOUT_MSNo30000Request timeout in milliseconds

Authentication Types

  • apikey (default) — Sends X-N8N-API-KEY header. This is n8n's standard API authentication.
  • bearer — Sends Authorization: Bearer <token> header.
  • basic — Sends Authorization: Basic <base64> header. Requires N8N_API_USER to be set.

Client Setup

Claude Code

Option A: Interactive wizard

npx @thecodesaiyan/tcs-n8n-mcp --setup

Option B: CLI command

macOS / Linux:

claude mcp add n8n -e N8N_API_URL=http://localhost:5678 -e N8N_API_KEY=your-api-key -- npx -y @thecodesaiyan/tcs-n8n-mcp

Windows (install globally first):

npm install -g @thecodesaiyan/tcs-n8n-mcp
claude mcp add n8n -e N8N_API_URL=http://localhost:5678 -e N8N_API_KEY=your-api-key -- tcs-n8n-mcp

Option C: Manual config

Add to ~/.claude.json:

macOS / Linux:

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": ["-y", "@thecodesaiyan/tcs-n8n-mcp"],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}

Windows:

{
  "mcpServers": {
    "n8n": {
      "command": "tcs-n8n-mcp",
      "args": [],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}
Claude Desktop

Add to your Claude Desktop config file:

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

macOS / Linux:

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": ["-y", "@thecodesaiyan/tcs-n8n-mcp"],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}

Windows (run npm install -g @thecodesaiyan/tcs-n8n-mcp first):

{
  "mcpServers": {
    "n8n": {
      "command": "tcs-n8n-mcp",
      "args": [],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}

Restart Claude Desktop after saving.

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your project, or use Command Palette > MCP: Open User Configuration:

macOS / Linux:

{
  "servers": {
    "n8n": {
      "command": "npx",
      "args": ["-y", "@thecodesaiyan/tcs-n8n-mcp"],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}

Windows (run npm install -g @thecodesaiyan/tcs-n8n-mcp first):

{
  "servers": {
    "n8n": {
      "command": "tcs-n8n-mcp",
      "args": [],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}
Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-level):

macOS / Linux:

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": ["-y", "@thecodesaiyan/tcs-n8n-mcp"],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}

Windows (run npm install -g @thecodesaiyan/tcs-n8n-mcp first):

{
  "mcpServers": {
    "n8n": {
      "command": "tcs-n8n-mcp",
      "args": [],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}
Windsurf

Add to your Windsurf config file:

OSPath
Windows%USERPROFILE%\.codeium\windsurf\mcp_config.json
macOS / Linux~/.codeium/windsurf/mcp_config.json

macOS / Linux:

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": ["-y", "@thecodesaiyan/tcs-n8n-mcp"],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}

Windows (run npm install -g @thecodesaiyan/tcs-n8n-mcp first):

{
  "mcpServers": {
    "n8n": {
      "command": "tcs-n8n-mcp",
      "args": [],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}
Cline

Open MCP Servers > Configure > Advanced MCP Settings and add:

macOS / Linux:

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": ["-y", "@thecodesaiyan/tcs-n8n-mcp"],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}

Windows (run npm install -g @thecodesaiyan/tcs-n8n-mcp first):

{
  "mcpServers": {
    "n8n": {
      "command": "tcs-n8n-mcp",
      "args": [],
      "env": {
        "N8N_API_KEY": "your-api-key-here",
        "N8N_API_URL": "http://localhost:5678"
      }
    }
  }
}

Available Tools (22)

Workflows (8)

ToolDescription
list_workflowsList all workflows with pagination
get_workflowGet full workflow details including nodes, connections, and settings
create_workflowCreate a new workflow with optional nodes and connections
update_workflowUpdate an existing workflow's name, nodes, connections, or settings
delete_workflowPermanently delete a workflow
activate_workflowActivate a workflow so it runs on its configured triggers
deactivate_workflowDeactivate a workflow to stop trigger-based execution
execute_workflowExecute a workflow immediately and return the execution ID

Executions (3)

ToolDescription
list_executionsList executions with optional filters for workflow ID and status
get_executionGet full execution details including per-node results and errors
delete_executionDelete an execution record

Tags (4)

ToolDescription
list_tagsList all tags used for organising workflows
create_tagCreate a new tag
update_tagRename an existing tag
delete_tagDelete a tag

Variables (4)

ToolDescription
list_variablesList all environment variables (values are masked for security)
create_variableCreate a new key-value environment variable
update_variableUpdate an existing variable's key or value
delete_variableDelete an environment variable

Credentials (1)

ToolDescription
list_credentialsList all credentials (metadata only — secrets are never exposed)

Users (2)

ToolDescription
list_usersList all users with their roles and status
get_userGet full details of a user by ID

Security

ProtectionDescription
ID ValidationAll resource IDs are validated as numeric strings to prevent path traversal attacks
Error SanitisationAPI error responses only return HTTP status codes, never raw response bodies
Secret MaskingVariable values are hidden in list output to prevent accidental secret exposure
Request TimeoutAll API calls have a configurable timeout (default 30s) to prevent hanging connections
No Key LoggingAPI keys are never logged, echoed, or included in tool output
Credential SafetyThe credentials tool only returns metadata — secrets are never exposed
Startup ValidationCredentials and connectivity are verified on startup before accepting any requests
Header Injection PreventionBasic auth credentials are validated to reject control characters

Development

git clone https://github.com/ntatschner/tcs-n8n-mcp.git
cd tcs-n8n-mcp
npm install

Commands

CommandDescription
npm run buildCompile TypeScript to build/
npm testRun test suite
npm run test:coverageRun tests with coverage report
npm startStart the MCP server

Running locally

# API key auth (default)
N8N_API_KEY=your-key N8N_API_URL=http://localhost:5678 npm start

# Bearer token auth
N8N_AUTH_TYPE=bearer N8N_API_KEY=your-token N8N_API_URL=http://localhost:5678 npm start

# Basic auth
N8N_AUTH_TYPE=basic N8N_API_USER=admin N8N_API_KEY=password N8N_API_URL=http://localhost:5678 npm start

Project Structure

src/
  index.ts              Entry point, fetch wrapper, server setup
  config.ts             Auth type parsing, header building, timeout, connection check
  types.ts              Shared types, interfaces, response helpers
  validation.ts         Zod schemas for input validation
  tools/
    workflows.ts        Workflow CRUD, activation, execution
    executions.ts       Execution listing and management
    tags.ts             Tag CRUD operations
    variables.ts        Environment variable management
    credentials.ts      Credential metadata listing
    users.ts            User listing and details

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/my-feature)
  3. Run tests (npm test)
  4. Commit your changes (git commit -m 'feat: add my feature')
  5. Push to the branch (git push origin feat/my-feature)
  6. Open a Pull Request

License

MIT — Made by @ntatschner

Reviews

No reviews yet

Sign in to write a review