AutomationFlowsAI & RAG › S2 - AI Agent + Mcp Cluster Intelligence V1

S2 - AI Agent + Mcp Cluster Intelligence V1

S2 - AI Agent + MCP Cluster Intelligence v1. Uses chatTrigger, agent, lmChatGoogleGemini, toolHttpRequest. Chat trigger; 7 nodes.

Chat trigger trigger★★☆☆☆ complexityAI-powered7 nodesChat TriggerAgentGoogle Gemini ChatTool Http Request
AI & RAG Trigger: Chat trigger Nodes: 7 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "S2 - AI Agent + MCP Cluster Intelligence v1",
  "nodes": [
    {
      "parameters": {
        "public": false,
        "allowFileUploads": false,
        "options": {}
      },
      "id": "a1b2c3d4-0001-0001-0001-000000000001",
      "name": "Chat Trigger",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        240,
        304
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "You are an expert SRE assistant with direct access to a Kubernetes cluster.\n\nYou have tools:\n1. kubectl_read - run any read-only kubectl command against the cluster.\n   Parameter: \"command\" (string) \u2014 the kubectl subcommand and flags to execute, e.g. \"get pods -A\", \"describe pod <name> -n <ns>\", \"logs <pod> -n <ns> --tail=50\", \"get events -A --sort-by=.lastTimestamp\".\n2. promql - run any PromQL query against Prometheus to get live metrics.\n   Parameter: \"query\" (string) \u2014 a valid PromQL expression, e.g. \"up\", \"rate(container_cpu_usage_seconds_total[5m])\", \"kube_pod_status_ready{condition=\\\"true\\\"}\".\n\nWhen investigating:\n- Start with: kubectl get pods -A\n- For unhealthy pods: kubectl describe pod <name> -n <namespace>\n- Check events: kubectl get events -A --sort-by=.lastTimestamp\n- Use PromQL for live metrics when relevant\n\nReturn a structured response:\nSUMMARY: one-line status\nSEVERITY: critical / warning / healthy\nROOT_CAUSE: your assessment\nCONFIDENCE: high / medium / low\nRECOMMENDED_ACTION: what should be done\nREQUIRES_APPROVAL: yes/no"
        }
      },
      "id": "a1b2c3d4-0002-0002-0002-000000000002",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        480,
        304
      ],
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.5-flash",
        "options": {}
      },
      "id": "a1b2c3d4-0003-0003-0003-000000000003",
      "name": "Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        368,
        512
      ],
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "toolDescription": "Run any read-only kubectl command against the cluster. Examples: get pods -A, describe pod <name> -n <ns>, logs <pod> -n <ns> --tail=50, get events -A --sort-by=.lastTimestamp",
        "method": "POST",
        "url": "http://mcp-server:8000/tools/kubectl-read",
        "sendBody": true,
        "specifyBody": "json",
        "parametersBody": {
          "values": [
            {
              "name": "command",
              "type": "string",
              "description": "The kubectl subcommand and flags to execute, e.g. 'get pods -A' or 'describe pod my-pod -n default'"
            }
          ]
        },
        "jsonBody": "={{ ({ command: $fromAI('command', 'kubectl subcommand without kubectl prefix, e.g. get pods -n workshop', 'string') }) }}"
      },
      "id": "a1b2c3d4-0004-0004-0004-000000000004",
      "name": "kubectl_read",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "typeVersion": 1.1,
      "position": [
        480,
        512
      ]
    },
    {
      "parameters": {
        "toolDescription": "Run any PromQL query against Prometheus to get live metrics. Examples: up, rate(container_cpu_usage_seconds_total[5m]), kube_pod_status_ready{condition=\"true\"}",
        "method": "POST",
        "url": "http://mcp-server:8000/tools/promql",
        "sendBody": true,
        "parametersBody": {
          "values": [
            {
              "name": "query"
            }
          ]
        }
      },
      "id": "a1b2c3d4-0005-0005-0005-000000000005",
      "name": "promql",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "typeVersion": 1.1,
      "position": [
        624,
        512
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "out1",
              "name": "summary",
              "value": "={{ $json.output }}",
              "type": "string"
            },
            {
              "id": "out2",
              "name": "timestamp",
              "value": "={{ new Date().toISOString() }}",
              "type": "string"
            },
            {
              "id": "out3",
              "name": "workflow",
              "value": "S2 - AI Agent + MCP",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a1b2c3d4-0006-0006-0006-000000000006",
      "name": "Format Output",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        304
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "err1",
              "name": "error",
              "value": "={{ $json.error?.message || 'AI Agent failed' }}",
              "type": "string"
            },
            {
              "id": "err2",
              "name": "timestamp",
              "value": "={{ new Date().toISOString() }}",
              "type": "string"
            },
            {
              "id": "err3",
              "name": "workflow",
              "value": "S2 - AI Agent + MCP",
              "type": "string"
            },
            {
              "id": "err4",
              "name": "severity",
              "value": "error",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a1b2c3d4-0007-0007-0007-000000000007",
      "name": "Error Output",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        500
      ]
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Format Output",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "kubectl_read": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "promql": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Chat Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveDataErrorExecution": "all",
    "saveDataSuccessExecution": "all"
  },
  "staticData": null
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

S2 - AI Agent + MCP Cluster Intelligence v1. Uses chatTrigger, agent, lmChatGoogleGemini, toolHttpRequest. Chat trigger; 7 nodes.

Source: https://github.com/yanivomc/n8nWorkShop/blob/576f9a71b97d99fe4d82cb23b05b841d961d0e06/n8n-workflows/s2-ai-agent-mcp.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

An AI-powered chat assistant that analyzes Azure virtual machine activity and generates detailed timeline reports showing VM state changes, performance metrics, and operational events over time.

Agent, Tool Http Request, Chat Trigger +3
AI & RAG

This n8n workflow automates the process of saving web articles or links shared in a chat conversation directly into a Notion database, using Google's Gemini AI and Browserless for web scraping.

Google Gemini Chat, Tool Http Request, Notion Tool +3
AI & RAG

Research AI Agent: Scrape and Summarize Articles and save to Notion (Gemini, Browserless). Uses lmChatGoogleGemini, toolHttpRequest, notionTool, discordTool. Chat trigger; 9 nodes.

Google Gemini Chat, Tool Http Request, Notion Tool +3
AI & RAG

Proxmox Ai Agent With N8N And Generative Ai Integration. Uses httpRequest, toolHttpRequest, outputParserAutofixing, lmChatGoogleGemini. Chat trigger; 35 nodes.

HTTP Request, Tool Http Request, Output Parser Autofixing +6
AI & RAG

Telegram. Uses httpRequest, toolHttpRequest, outputParserAutofixing, lmChatGoogleGemini. Chat trigger; 35 nodes.

HTTP Request, Tool Http Request, Output Parser Autofixing +6