Skip to main content
Glama
n8n MCP Server

n8n MCP Server

by mastrangi

n8n MCP Server

An MCP server that lets any MCP-compatible client (Claude Code, Claude Desktop, etc.) manage workflows and executions on your own self-hosted n8n instance, via n8n's public REST API. Runs locally over stdio — your n8n URL and API key never leave your machine.

Requirements

  • Python 3.11+

  • uv

  • A running n8n instance with the public API enabled

  • An n8n API key (n8n → Settings → API)

Related MCP server: n8n MCP Server

Setup

  1. Clone this repository and install dependencies:

    git clone https://github.com/mastrangi/mcp-n8n.git
    cd mcp-n8n
    uv sync
  2. Create .env (never committed) from the template:

    cp .env.example .env

    Fill in:

    • N8N_URL — your n8n instance's base URL (e.g. https://n8n.example.com)

    • N8N_API_KEY — generated from your n8n instance's Settings → API page

  3. Register with your MCP client. For Claude Code, run from the directory you cloned this repo into:

    claude mcp add n8n -- uv run --directory "$(pwd)" n8n-mcp

    For other clients, point them at the same command (uv run --directory /absolute/path/to/mcp-n8n n8n-mcp) using stdio transport.

  4. Verify it's connected:

    claude mcp list

Tools

Tool

Description

list_workflows

List workflows, filtered by active status, name, or tags

get_workflow

Get a workflow's full definition by ID

create_workflow

Create a workflow from nodes/connections/settings (pass parentFolderId in the workflow object to place it in a folder)

update_workflow

Replace a workflow's definition

delete_workflow

Delete a workflow by ID

activate_workflow

Activate a workflow

deactivate_workflow

Deactivate a workflow

list_executions

List executions, filtered by workflow or status

get_execution

Get a specific execution's details

execute_workflow

Trigger a workflow via its Webhook trigger node (only works for workflows that have one and are active — n8n's public API has no generic "run by ID" endpoint), optionally forwarding data as the webhook's JSON body

list_folders

List folders in a project, filtered by parent folder or name

create_folder

Create a folder in a project, optionally nested under a parent folder

Why no execute_workflow_by_id?

n8n's public REST API has no generic "run this workflow now" endpoint — only workflows with a Webhook trigger node can be invoked externally, by calling that webhook directly. execute_workflow does exactly that: it looks up the workflow's Webhook node and calls it, returning an error that explains why when the workflow has no webhook or isn't active.

Development

uv run pytest -v

Security

  • N8N_API_KEY lives only in your local .env file, which is gitignored. No tool logs, prints, or returns the key.

  • execute_workflow calls the target webhook without the n8n API key attached — n8n's Webhook node captures request headers into execution data, so sending the key there would let it leak back out through get_execution(include_data=True).

License

MIT — see LICENSE.

Available Tools

12 tools
activate_workflowActivate WorkflowC

Activate a workflow by ID.

Inputs: workflow_id (required). Returns: object

create_folderCreate FolderA

Create a folder within a project. Pass parent_folder_id to nest it inside another folder instead of the project root.

project_id is required (see list_folders for how to find it), except that n8n also accepts the literal string "personal" to mean your own personal project.

Inputs: name (required), project_id (required), parent_folder_id. Returns: object

create_workflowCreate WorkflowA

Create a new workflow. workflow must include name, nodes, connections, and settings.

To place the workflow in a folder instead of the project root, include parentFolderId (a folder ID from list_folders) in workflow. To create it in a project other than your personal one, include projectId.

Inputs: workflow (required). Returns: object

deactivate_workflowDeactivate WorkflowC

Deactivate a workflow by ID.

Inputs: workflow_id (required). Returns: object

delete_workflowDelete WorkflowB

Delete a workflow by ID.

Inputs: workflow_id (required). Returns: object

execute_workflowExecute WorkflowA

Trigger a workflow's execution via its Webhook trigger node, if it has one.

n8n's public API has no generic "run workflow by ID" endpoint, so this only works for workflows containing a Webhook trigger node, and the workflow must be active for the webhook to respond. data, if given, is sent as the JSON request body, landing in the workflow's $json.body.

Inputs: workflow_id (required), data. Returns: object

get_executionGet ExecutionA

Get details of a specific execution by ID. Set include_data=True to include input/output data.

Inputs: execution_id (required), include_data. Returns: object

get_workflowGet WorkflowA

Get the full definition (nodes, connections, settings) of a workflow by ID.

Inputs: workflow_id (required). Returns: object

list_executionsList ExecutionsA

List workflow executions, optionally filtered by workflow ID or status (success, error, running, waiting).

Defaults to returning up to 100 executions. n8n caps this at 250 per request; pass a higher limit (up to 250) explicitly if you need more and results seem truncated.

Inputs: limit, status, workflow_id. Returns: result

list_foldersList FoldersA

List folders within a project, optionally filtered by parent folder or name.

project_id is required — n8n's public API has no way to discover it if your license doesn't support listing projects. If you don't know it, call list_workflows and read shared[0]["projectId"] off any returned workflow.

n8n defaults to returning only 10 folders per page. Pass a higher take (or page through with skip) if a project has more folders than that — results are silently truncated to take with no other signal that more exist.

Inputs: project_id (required), name, skip, take, +1 more. Returns: result

list_workflowsList WorkflowsA

List n8n workflows, optionally filtered by active status, name, or comma-separated tags.

Defaults to returning up to 100 workflows. n8n caps this at 250 per request; pass a higher limit (up to 250) explicitly if you need more and results seem truncated.

Inputs: name, tags, limit, active. Returns: result

update_workflowUpdate WorkflowA

Replace an existing workflow's definition. workflow must include name, nodes, connections, and settings.

Inputs: workflow (required), workflow_id (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool targets a distinct resource-action pair: workflow CRUD/lifecycle, execution retrieval/triggering, and folder listing/creation are clearly separated. Even execute_workflow and activate_workflow are unambiguous because their descriptions clarify webhook triggering versus status changes.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern, such as list_workflows, create_folder, and deactivate_workflow. The naming is predictable and makes the action and resource immediately clear.

    Tool Count5/5

    With 12 tools, the server is well-scoped for managing n8n workflows, executions, and folders. Each tool covers a meaningful operation without redundancy or excessive granularity.

    Completeness4/5

    Workflow lifecycle coverage is strong: create, read, update, delete, activate, deactivate, and list are all present. Minor gaps exist for folders (no update or delete operations) and executions (no cancel or delete), but core workflows are fully covered and workarounds are available.

    Related MCP Connectors

    Related MCP Servers