n8n Flow Audit with Claude Code MCP
Install n8n MCP server, point Claude Code at it, audit all workflows for fragility, missing error handlers, and undocumented nodes. Prompt templates.
The n8n MCP server from czlonkowsko gives Claude Code direct access to read, document, and fix n8n workflows without manual JSON export. Install the MCP server, point Claude Code at it, and ask for documentation, fragility analysis, and error handling improvements across all your flows.
Setup
# Install the n8n MCP server
# Add to your Claude Code MCP config:
# {
# "mcpServers": {
# "n8n": {
# "command": "npx",
# "args": ["@czlonkowsko/n8n-mcp-server"],
# "env": {
# "N8N_API_URL": "http://localhost:5678",
# "N8N_API_KEY": "your-n8n-api-key"
# }
# }
# }
# }Audit workflow: step by step
- Ask Claude to list all workflows and their active/inactive status
- For each active workflow, ask for a plain-English description of what it does
- Ask Claude to identify fragile nodes (HTTP scraping, hardcoded URLs, missing error handlers)
- Ask Claude to add documentation annotations to each workflow (no logic changes)
- Ask Claude to suggest error handling improvements for the most critical flows
Prompt templates that work
# Documentation prompt
"Read workflow [name]. For each node, document:
what it does, what input it expects, what credentials it uses,
and what would break if the upstream API changed.
Add annotations to the workflow JSON. Do not change any logic."
# Fragility analysis prompt
"Analyze workflow [name] for failure modes:
- HTTP nodes scraping websites (break on layout changes)
- Hardcoded values that should be env variables
- Missing Error Trigger nodes
- Nodes depending on specific response shapes
Rate each node: stable / fragile / critical-risk."
# Error handling prompt
"Add error handling to workflow [name]:
- Error Trigger node connected to Slack notification
- Retry logic on HTTP nodes (3 retries, exponential backoff)
- Fallback values for optional data
Do not change the happy-path logic."What teams report
The n8n subreddit confirmed this approach works well. Multiple users reported that Claude Code documented their entire workflow library in a single session. The key insight: ask for documentation only in the first pass, then make improvements in a separate pass. Combining both creates overly aggressive refactors.