AutomationFlowsAI & RAG › AI Chat Agent with MCP Tools

AI Chat Agent with MCP Tools

Original n8n title: Mcp Agent Demo

MCP Agent Demo. Uses chatTrigger, agent, memoryPostgresChat, n8n-nodes-mcp. Chat trigger; 8 nodes.

Chat trigger trigger★★★☆☆ complexityAI-powered8 nodesChat TriggerAgentMemory Postgres ChatN8N Nodes McpOpenAI Chat
AI & RAG Trigger: Chat trigger Nodes: 8 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": "MCP Agent Demo",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "id": "711b50da-0246-45c7-877a-cefef621de04",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=You are a helpful assistant who has access to a bunch of tools to assist with user queries. Before you try to execute any tool, you need to call the tool to list available tools for the capability you want to leverage.\n\nWhen you list tools available, you'll get a list back of items that look like:\n\nname:[tool_name]\ndescription:[tool description to tell you when and how to use the tool]\nschema\n0:[param 1]\n1:[param 2]\n...\nn-1:[param n]\n\nThen when you call a tool, you need to give the tool name exactly as given to you, and the tool parameters need to be a json object like:\n\n{\n  \"param 1\": \"param 1 value\",\n  ...\n  \"param n\": \"param n value\"\n}\n\nIf there are no parameters for the tool, just pass in an empty object.\n\nFor the file system, you have access to the /files directory and that is it."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        312,
        0
      ],
      "id": "209b7dea-c14a-4b89-b95b-bfd23d5899b3",
      "name": "AI Agent"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "typeVersion": 1.3,
      "position": [
        280,
        220
      ],
      "id": "0085bedd-77b0-4deb-aba8-8bb56ad82c00",
      "name": "Postgres Chat Memory",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Use this tool to list all the Brave search tools that are available."
      },
      "type": "n8n-nodes-mcp.mcpClientTool",
      "typeVersion": 1,
      "position": [
        440,
        220
      ],
      "id": "688f7c08-d47a-4068-88a4-5ea993199e0e",
      "name": "List Brave Tools",
      "credentials": {
        "mcpClientApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Use this tool to execute a Brave tool once you have called the tool to list available Brave tools.",
        "operation": "executeTool",
        "toolName": "={{ $fromAI('tool_name') }}",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', ``, 'json') }}"
      },
      "type": "n8n-nodes-mcp.mcpClientTool",
      "typeVersion": 1,
      "position": [
        600,
        220
      ],
      "id": "9e99c89a-a1c2-4061-9d68-2a91be5cf450",
      "name": "Execute Brave Tool",
      "credentials": {
        "mcpClientApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Use this tool to list all the tools available to you to perform Convex actions. Only ever call this tool once!"
      },
      "type": "n8n-nodes-mcp.mcpClientTool",
      "typeVersion": 1,
      "position": [
        780,
        220
      ],
      "id": "9d766e0b-29a1-449a-a1df-585aca1d6739",
      "name": "List Convex Tools",
      "credentials": {
        "mcpClientApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Use this tool to execute tools related to Convex.",
        "operation": "executeTool",
        "toolName": "={{ $fromAI('tool_name') }}",
        "toolParameters": "={{ $fromAI('Tool_Parameters') }}"
      },
      "type": "n8n-nodes-mcp.mcpClientTool",
      "typeVersion": 1,
      "position": [
        940,
        220
      ],
      "id": "6b21a7da-9769-4c44-9fca-80f290409ef3",
      "name": "Execute Convex Tool",
      "credentials": {
        "mcpClientApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        120,
        220
      ],
      "id": "702e1bad-25af-4010-a390-a3b9ea1d64e5",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "List Brave Tools": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Execute Brave Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "List Convex Tools": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Execute Convex Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8898335f-da6e-4458-b7f7-537f9b62f159",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "ldC1RYzwYGzlH4qS",
  "tags": []
}

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

MCP Agent Demo. Uses chatTrigger, agent, memoryPostgresChat, n8n-nodes-mcp. Chat trigger; 8 nodes.

Source: https://github.com/DPabloFlores/ottomator-agents/blob/main/n8n-mcp-agent/MCP_Agent_Demo.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

Extract Insights & Analyse Youtube Comments Via Ai Agent Chat. Uses stickyNote, lmChatOpenAi, toolWorkflow, memoryPostgresChat. Chat trigger; 29 nodes.

OpenAI Chat, Tool Workflow, Memory Postgres Chat +5
AI & RAG

I prepared a detailed guide to help you set up your workflow effectively, enabling you to extract insights from YouTube for content generation using an AI agent.

OpenAI Chat, Tool Workflow, Memory Postgres Chat +5
AI & RAG

onlyoffice-agent. Uses chatTrigger, agent, n8n-nodes-mcp, lmChatOpenAi. Chat trigger; 28 nodes.

Chat Trigger, Agent, N8N Nodes Mcp +2
AI & RAG

This n8n workflow template uses community nodes and is only compatible with the self-hosted version of n8n.

Chat Trigger, Agent, N8N Nodes Mcp +4
AI & RAG

financeiro. Uses agent, lmChatOpenAi, memoryPostgresChat, chatTrigger. Chat trigger; 25 nodes.

Agent, OpenAI Chat, Memory Postgres Chat +4