Skip to main content
Glama
tcs-n8n-mcp
by ntatschner

@thecodesaiyan/tcs-n8n-mcp

Manage your n8n workflows through AI assistants

npm version License: MIT Node.js MCP CI

An MCP server for managing supported parts of the n8n public API. It exposes workflows, executions, tags, variables, credential metadata, and users to MCP clients through typed, structured tools.

Installation · Tools · Security · Development


Features

  • 21 tools for common n8n public API operations

  • Works everywhere — Claude Code, Claude Desktop, VS Code, Cursor, Windsurf, Cline

  • Modern MCP responses — MCP SDK v2, structured content, output schemas, and tool safety annotations

  • Secure by default — encoded resource IDs, sanitised errors, bounded responses, and request timeouts

  • Flexible authentication — n8n API key (default), with Bearer and Basic modes for compatible proxies/deployments

  • Zero config — just provide your n8n API key and go

  • Focused dependencies — runtime dependencies are limited to the MCP server SDK and Zod


Related MCP server: n8n-mcp

Prerequisites


Installation

Quick Start

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

The setup wizard walks you through configuration, reads the API key or password without terminal echo, tests your connection, and configures detected clients. Printed fallback snippets use a <set-in-client-config> placeholder so credentials are not written to terminal logs.

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

Variable

Required

Default

Description

N8N_API_KEY

Yes

—

Your n8n API key (or password for basic auth)

N8N_API_URL

No

http://localhost:5678

Absolute HTTP(S) URL for your n8n instance; either the instance root or a URL ending in /api/v1

N8N_AUTH_TYPE

No

apikey

Authentication method: apikey, bearer, or basic

N8N_API_USER

Only for basic

—

Username for basic authentication

N8N_TIMEOUT_MS

No

30000

Request 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>, for deployments or reverse proxies that accept it.

  • basic — Sends Authorization: Basic <base64>, for compatible deployments or reverse proxies. Requires N8N_API_USER.

N8N_API_URL must not contain embedded credentials, a query string, or a fragment. The server normalises the URL so /api/v1 is appended exactly once.


Client Setup

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"
      }
    }
  }
}

Add to your Claude Desktop config file:

OS

Path

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.

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"
      }
    }
  }
}

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"
      }
    }
  }
}

Add to your Windsurf config file:

OS

Path

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"
      }
    }
  }
}

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 (21)

Workflows (7)

Tool

Description

list_workflows

List all workflows with pagination

get_workflow

Get safe workflow metadata; set includeRawData: true to opt into untrusted raw fields

create_workflow

Create a new workflow with optional nodes and connections

update_workflow

Update an existing workflow's name, nodes, connections, or settings

delete_workflow

Permanently delete a workflow after explicit confirmation

activate_workflow

Activate a workflow so it runs on its configured triggers

deactivate_workflow

Deactivate a workflow to stop trigger-based execution

The n8n public API does not expose a portable POST /workflows/{id}/execute operation, so this package does not offer direct workflow execution. To run a workflow on demand, expose and call a webhook trigger or use an n8n-supported test/execution facility appropriate to your deployment.

Executions (3)

Tool

Description

list_executions

List executions with optional filters for workflow ID and status

get_execution

Get safe execution metadata; includeData: true opts into untrusted node data

delete_execution

Delete an execution record after explicit confirmation

Tags (4)

Tool

Description

list_tags

List all tags used for organising workflows

create_tag

Create a new tag

update_tag

Rename an existing tag

delete_tag

Delete a tag after explicit confirmation

Variables (4)

Tool

Description

list_variables

List all environment variables (values are masked for security)

create_variable

Create a new key-value environment variable

update_variable

Update an existing variable's key or value

delete_variable

Delete an environment variable after explicit confirmation

Credentials (1)

Tool

Description

list_credentials

List all credentials (metadata only — secrets are never exposed)

Users (2)

Tool

Description

list_users

List all users with their roles and status

get_user

Get full details of a user by ID


Security

Protection

Description

Resource IDs

Opaque n8n IDs are accepted and URL-encoded as individual path segments; execution IDs remain numeric

Destructive confirmation

Delete tools require an explicit confirm: true argument and are marked destructive

Error Sanitisation

API failures return bounded, actionable details without dumping arbitrary response bodies

Secret Masking

Variable values are hidden in list output to prevent accidental secret exposure

Request Timeout

All API calls have a configurable timeout (default 30s) to prevent hanging connections

Credential handling

Interactive credential entry is hidden; client config files are atomically replaced with mode 0600 on POSIX

Credential Safety

The credentials tool only returns metadata — secrets are never exposed

Redirect Safety

API redirects are refused so custom authentication headers cannot cross origins

Response Limits

API bodies are byte-limited before JSON parsing; model-visible results are separately bounded

Header Injection Prevention

Basic auth credentials are validated to reject control characters

MCP client configuration stores N8N_API_KEY (or the Basic password) in plaintext because stdio clients pass credentials through environment variables. Restrict access to these files. Automatic setup tightens the resulting file to 0600 on POSIX; Windows users should verify the file ACL. Printed manual snippets contain a credential placeholder, never the entered secret.

Tool results are bounded to protect the model context. Use pagination and request execution data only when needed. The server supports the documented tools above, not the entire n8n REST API; availability can also vary by n8n edition and version.


Development

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

Commands

Command

Description

npm run build

Compile TypeScript to build/

npm test

Run test suite

npm run test:coverage

Run tests with coverage report

npm start

Start 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              Thin CLI and stdio entry point
  server.ts             MCP server factory and tool registration
  client.ts             Normalised, timeout-aware n8n API client
  config.ts             Auth type parsing, header building, timeout, connection check
  types.ts              Shared types, response validation and bounded output helpers
  validation.ts         Zod schemas for input validation
  tools/
    workflows.ts        Workflow CRUD and activation
    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

Publishing

Releases are tag-driven. Set package.json to the intended version, then push the matching v<version> tag. CI verifies that the tag exactly matches package.json, runs the supported Node matrix, coverage, audit, pack, and installed-tarball smoke checks, publishes to npm, and only then creates the GitHub release.

The npm package must have a trusted publisher configured for this GitHub repository and .github/workflows/ci.yml. Publishing uses GitHub Actions OIDC with provenance and does not use a long-lived NPM_TOKEN.


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

Available Tools

21 tools
activate_workflowC
Idempotent

Activate an n8n workflow.

Inputs: workflowId (required). Returns: id, message

create_tagB

Create a tag for organizing n8n workflows.

Inputs: name (required). Returns: object

create_variableC

Create an n8n variable, optionally in a specified project.

Inputs: key (required), value (required), projectId. Returns: id, key, message

create_workflowC

Create an n8n workflow using the current public API fields.

Inputs: name (required), nodes, pinData, settings, +6 more. Returns: object

deactivate_workflowC
Idempotent

Deactivate an n8n workflow.

Inputs: workflowId (required). Returns: id, message

delete_executionA
Destructive

Permanently delete an n8n execution record. Requires explicit confirmation.

Inputs: confirm (required), executionId (required). Returns: id, message

delete_tagA
Destructive

Permanently delete an n8n tag. Requires explicit confirmation.

Inputs: tagId (required), confirm (required). Returns: id, message

delete_variableA
Destructive

Permanently delete an n8n variable. Requires explicit confirmation.

Inputs: confirm (required), variableId (required). Returns: id, key, message

delete_workflowA
Destructive

Permanently delete an n8n workflow. Requires explicit confirmation.

Inputs: confirm (required), workflowId (required). Returns: id, message

get_executionA
Read-onlyIdempotent

Get an n8n execution. Detailed fields are untrusted external data, excluded by default, and bounded when explicitly requested.

Inputs: executionId (required), includeData, ignoreDataSizeLimit, redactExecutionData. Returns: object

get_userB
Read-onlyIdempotent

Get an n8n user by opaque ID or email address.

Inputs: userIdOrEmail (required), includeRole. Returns: object

get_workflowA
Read-onlyIdempotent

Get an n8n workflow by opaque ID. Raw fields are untrusted external data and require explicit opt-in.

Inputs: workflowId (required), includeRawData, excludePinnedData. Returns: object

list_credentialsA
Read-onlyIdempotent

List n8n credential metadata only; secret credential data is never returned.

Inputs: limit, cursor. Returns: object

list_executionsC
Read-onlyIdempotent

List n8n executions with current status, project, date, detail, redaction, and cursor filters.

Inputs: limit, cursor, status, projectId, +6 more. Returns: object

list_tagsB
Read-onlyIdempotent

List n8n tags with cursor pagination.

Inputs: limit, cursor. Returns: object

list_usersB
Read-onlyIdempotent

List n8n users, optionally including roles or restricting results to a project.

Inputs: limit, cursor, projectId, includeRole. Returns: object

list_variablesC
Read-onlyIdempotent

List n8n variables without exposing their values.

Inputs: limit, state, cursor, projectId. Returns: object

list_workflowsC
Read-onlyIdempotent

List n8n workflows using current public API filters and cursor pagination.

Inputs: name, tags, limit, active, +4 more. Returns: object

update_tagC
Idempotent

Rename an n8n tag.

Inputs: name (required), tagId (required). Returns: object

update_variableB
Idempotent

Replace both the key and value of an existing n8n variable.

Inputs: key (required), value (required), variableId (required), projectId. Returns: id, key, message

update_workflowB

Update an n8n workflow. Published workflows are republished unless publishIfActive is false.

Inputs: workflowId (required), name, nodes, pinData, +7 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 21 tools

    Disambiguation5/5

    Every tool pairs a distinct verb with a distinct resource (workflow, execution, tag, variable, credential, user), so an agent can pick correctly from name alone. The only mild adjacency is update_workflow's republication behavior versus activate_workflow/deactivate_workflow, but the description explicitly calls out publishIfActive, resolving the overlap.

    Naming Consistency5/5

    Uniform snake_case verb_noun convention throughout: list_/get_/create_/update_/delete_ plus the lifecycle pair activate_/deactivate_workflow. Resource names are used consistently across all six sub-domains with no camelCase or stylistic drift.

    Tool Count4/5

    At 21 tools the surface is slightly larger than the ideal 3-15 band, but the count is justified by six distinct n8n resources, each getting a coherent list/get/create/update/delete-style set. No tool looks like filler or a duplicate of another.

    Completeness3/5

    Workflows, tags, and variables have full CRUD coverage, but executions are read-only plus delete (no retry/stop), credentials expose only list (no create/update/delete or schema), and users only list/get with no create/update/delete. These are real gaps that would force an agent to fall back to the raw API for common admin operations.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      Provides AI assistants with direct access to the n8n automation platform to manage and execute workflows, variables, and credentials. It features 18 integrated tools that allow for seamless automation management via the Model Context Protocol.
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI models to manage workflows, credentials, nodes, templates, and monitor executions on the n8n automation platform through a standardized MCP interface.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to programmatically create, manage, and orchestrate n8n workflows through a standardized MCP interface.
      MIT
    • F
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to fully automate n8n instances via 34 MCP tools, covering workflow creation, execution debugging, credential management, environment variables, tags, and user administration through natural language.
      34
      1
      -