tcs-n8n-mcp
Provides tools for managing an n8n instance through its public API, including workflows (list, get, create, update, delete, activate/deactivate), executions (list, get, delete), tags, variables, credential metadata, and users.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tcs-n8n-mcp show me my recent failed n8n executions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@thecodesaiyan/tcs-n8n-mcp
Manage your n8n workflows through AI assistants
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
Node.js >= 22.14 (Node 24 LTS is recommended)
An n8n instance (self-hosted or cloud)
An n8n API key (how to create one)
Installation
Quick Start
npx @thecodesaiyan/tcs-n8n-mcp --setupThe 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:
npxcannot 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 |
| Yes | — | Your n8n API key (or password for basic auth) |
| No |
| Absolute HTTP(S) URL for your n8n instance; either the instance root or a URL ending in |
| No |
| Authentication method: |
| Only for | — | Username for basic authentication |
| No |
| Request timeout in milliseconds |
Authentication Types
apikey(default) — SendsX-N8N-API-KEYheader. This is n8n's standard API authentication.bearer— SendsAuthorization: Bearer <token>, for deployments or reverse proxies that accept it.basic— SendsAuthorization: Basic <base64>, for compatible deployments or reverse proxies. RequiresN8N_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 --setupOption 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-mcpWindows (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-mcpOption 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 |
|
macOS |
|
Linux |
|
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 |
|
macOS / Linux |
|
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 all workflows with pagination |
| Get safe workflow metadata; set |
| Create a new workflow with optional nodes and connections |
| Update an existing workflow's name, nodes, connections, or settings |
| Permanently delete a workflow after explicit confirmation |
| Activate a workflow so it runs on its configured triggers |
| 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 with optional filters for workflow ID and status |
| Get safe execution metadata; |
| Delete an execution record after explicit confirmation |
Tags (4)
Tool | Description |
| List all tags used for organising workflows |
| Create a new tag |
| Rename an existing tag |
| Delete a tag after explicit confirmation |
Variables (4)
Tool | Description |
| List all environment variables (values are masked for security) |
| Create a new key-value environment variable |
| Update an existing variable's key or value |
| Delete an environment variable after explicit confirmation |
Credentials (1)
Tool | Description |
| List all credentials (metadata only — secrets are never exposed) |
Users (2)
Tool | Description |
| List all users with their roles and status |
| 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 |
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 |
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 installCommands
Command | Description |
| Compile TypeScript to |
| Run test suite |
| Run tests with coverage report |
| 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 startProject 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 detailsPublishing
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.
Fork the repository
Create your feature branch (
git checkout -b feat/my-feature)Run tests (
npm test)Commit your changes (
git commit -m 'feat: add my feature')Push to the branch (
git push origin feat/my-feature)Open a Pull Request
License
MIT — Made by @ntatschner
Available Tools
21 toolsactivate_workflowCIdempotent
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_workflowCIdempotent
Deactivate an n8n workflow.
Inputs: workflowId (required). Returns: id, message
delete_executionADestructive
Permanently delete an n8n execution record. Requires explicit confirmation.
Inputs: confirm (required), executionId (required). Returns: id, message
delete_tagADestructive
Permanently delete an n8n tag. Requires explicit confirmation.
Inputs: tagId (required), confirm (required). Returns: id, message
delete_variableADestructive
Permanently delete an n8n variable. Requires explicit confirmation.
Inputs: confirm (required), variableId (required). Returns: id, key, message
delete_workflowADestructive
Permanently delete an n8n workflow. Requires explicit confirmation.
Inputs: confirm (required), workflowId (required). Returns: id, message
get_executionARead-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_userBRead-onlyIdempotent
Get an n8n user by opaque ID or email address.
Inputs: userIdOrEmail (required), includeRole. Returns: object
get_workflowARead-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_credentialsARead-onlyIdempotent
List n8n credential metadata only; secret credential data is never returned.
Inputs: limit, cursor. Returns: object
list_executionsCRead-onlyIdempotent
List n8n executions with current status, project, date, detail, redaction, and cursor filters.
Inputs: limit, cursor, status, projectId, +6 more. Returns: object
list_tagsBRead-onlyIdempotent
List n8n tags with cursor pagination.
Inputs: limit, cursor. Returns: object
list_usersBRead-onlyIdempotent
List n8n users, optionally including roles or restricting results to a project.
Inputs: limit, cursor, projectId, includeRole. Returns: object
list_variablesCRead-onlyIdempotent
List n8n variables without exposing their values.
Inputs: limit, state, cursor, projectId. Returns: object
list_workflowsCRead-onlyIdempotent
List n8n workflows using current public API filters and cursor pagination.
Inputs: name, tags, limit, active, +4 more. Returns: object
update_tagCIdempotent
Rename an n8n tag.
Inputs: name (required), tagId (required). Returns: object
update_variableBIdempotent
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
Scored across 21 tools
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.
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.
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.
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
Related MCP Connectors
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
Free public MCP for AI agents — 193 tools, 44 workflows. No API key.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceProvides 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.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI models to manage workflows, credentials, nodes, templates, and monitor executions on the n8n automation platform through a standardized MCP interface.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to programmatically create, manage, and orchestrate n8n workflows through a standardized MCP interface.MIT
- FlicenseBqualityCmaintenanceEnables 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.341-