N8n cli to mcp

From 8Dvibes/n8n-cli · View interactive version

N8n cli to mcp is an AI agent skill from the GitHub repository 8Dvibes/n8n-cli. Expose an n8n workflow as an MCP tool for AI agents. Generates a tool definition that Claude, Cursor, or Codex can call. Inverse of /n8n-cli-from-mcp. Use when agents need to invoke an n8n workflow on demand.

How to use this skill

Skill file

/n8n-cli-to-mcp — n8n Workflow → Agent Tool

Take an n8n workflow (typically webhook-triggered) and produce a tool definition that any AI agent can call.

Procedure

  1. Get the workflow:
  1. Infer the tool's interface:
  1. Output format options (ask the user which they want):

a. MCP tool definition (for Claude Code MCP servers):

```json

{

"name": "n8n_process_order",

"description": "Submits an order to the order processing workflow",

"inputSchema": {

"type": "object",

"properties": {

"customer_id": {"type": "string"},

"product_id": {"type": "string"},

"quantity": {"type": "integer"}

},

"required": ["customer_id", "product_id", "quantity"]

}

}

```

Plus a wrapper script that bridges the MCP call to the n8n webhook URL.

b. OpenAI function-calling spec:

```json

{

"type": "function",

"function": {

"name": "n8n_process_order",

"description": "...",

"parameters": { /* same schema */ }

}

}

```

c. Anthropic tool spec:

```json

{

"name": "n8n_process_order",

"description": "...",

"input_schema": { /* same schema */ }

}

```

d. Simple HTTP tool (for any agent):

  1. Generate a wrapper if needed:
  1. Save the spec to:

Output format

Tips

Example end-to-end

User says: "I built an n8n workflow that takes a customer ID and returns their LTV. Wrap it as a tool I can call from Claude Code."

  1. Find the workflow → n8n-cli wf list --name "LTV"
  2. Get its webhook URL → check the trigger node config
  3. Inspect input/output → walk nodes
  4. Generate MCP tool spec
  5. Save to ~/.claude/tools/n8n-customer-ltv.json
  6. Tell user how to register the tool with Claude Code
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.