Twinkle HubTwinkle Hub
Sign in

📌 2026-05-12 added: Legislature dataset live (8 datasets · 284,257+ rows)

View full changelog →

n8n MCP

n8n

n8n-mcp lets LLMs drive your own n8n instance (self-hosted or SaaS) — list workflows, trigger webhooks, query execution logs, create/edit nodes. The go-to for 'LLM writes strategy → n8n executes the automation'.

Token required5-min install

Why client-side

An n8n API key is a high-privilege credential — create/edit/delete any workflow, read any execution. twinkle-hub does not store it. It lives in your local MCP client's config; Claude Desktop spawns a child process carrying that env var, connecting directly to your n8n.

Prerequisites

  • Node.js ≥ 18
  • Your own n8n instance (not someone else's) — e.g. https://your-name.app.n8n.cloud or self-hosted https://10.0.x.x:5678
  • MCP-capable client

Get a token

  1. 1Log into your n8n instance
  2. 2Click your avatar top-right → Settings (n8n < 1.0 has no API — upgrade)
  3. 3Pick n8n API in the left nav
  4. 4Click Create API Key, label it (e.g. "claude-mcp")
  5. 5Copy the key — shown once, gone forever after closing
  6. 6Scope — recommended: workflow:read / workflow:execute / execution:read. Add workflow:create / workflow:update if you need writes

Install

Claude Desktop (macOS)

~/Library/Application Support/Claude/claude_desktop_config.json

N8N_API_URL must end with /api/v1. SaaS example: https://abc.app.n8n.cloud/api/v1. Self-hosted: http://192.168.x.x:5678/api/v1

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": ["-y", "n8n-mcp"],
      "env": {
        "N8N_API_URL": "<your_n8n_api_url>",
        "N8N_API_KEY": "<your_n8n_api_key>"
      }
    }
  }
}

Full install doc (GitHub)

First run

Try this prompt

List every workflow on my n8n

Common tools

  • list_workflows() list all workflows
  • get_workflow(id) full definition
  • execute_workflow(id, data) trigger run
  • list_executions(workflowId) execution history
  • create_workflow(definition) LLM writes a new workflow
  • update_workflow(id, definition) LLM edits existing workflow

Troubleshooting

SymptomFix
401 UnauthorizedAPI key expired or scope insufficient
ECONNREFUSEDn8n URL correct? On self-hosted, is /api/v1 enabled (N8N_PUBLIC_API_DISABLED=false)?
Partial workflow listAPI key scope too narrow — add scopes in n8n settings
Self-signed certSelf-hosted HTTPS with self-signed cert fails — use HTTP or fix the cert chain

Security notes

  • Keep the API key in local config only — never commit to git
  • Don't install on shared machines (other users can read the config)
  • Narrow the scope for the LLM token — start read-only, expand only after watching behaviour