AutomationFlowsAI & RAG › Build MCP Server with RAG for Q&A

Build MCP Server with RAG for Q&A

Original n8n title: Build an Mcp Server Which Answers Questions with Retrieval Augmented Generation

ByThomas Janssen @thomasjanssen-tech on n8n.io

Click here to watch the full tutorial on YouTube

Event trigger★★★☆☆ complexityAI-powered8 nodesMcp TriggerQdrant Vector StoreOllama EmbeddingsForm TriggerDocument Default Data Loader
AI & RAG Trigger: Event Nodes: 8 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #5403 — we link there as the canonical source.

This workflow follows the Documentdefaultdataloader → Form 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
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "6b47ec70-22fc-46eb-970f-57d43f1512ea",
      "name": "MCP Server Trigger",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "path": "f88b9b77-40f2-4fad-8e14-0fc7faed7a0b"
      },
      "typeVersion": 2
    },
    {
      "id": "cda97a99-fd6a-42dd-ba61-09af42f03112",
      "name": "Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        140,
        200
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "toolDescription": "Use this tool to fetch information about MCP (Model Context Protocol)",
        "qdrantCollection": {
          "__rl": true,
          "mode": "id",
          "value": "MCP_RAG"
        }
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "638d581b-7d35-4da2-8733-5960d151b711",
      "name": "Embeddings Ollama",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOllama",
      "position": [
        320,
        420
      ],
      "parameters": {
        "model": "mxbai-embed-large:latest"
      },
      "credentials": {
        "ollamaApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3ff5792d-2991-40bc-8fde-b8dc5baacef6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        -100
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 640,
        "content": "## MCP Server\n**Our RAG MCP Server"
      },
      "typeVersion": 1
    },
    {
      "id": "18b55010-f395-429d-9b00-5b1ec50b236b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        -100
      ],
      "parameters": {
        "color": 3,
        "width": 800,
        "height": 640,
        "content": "## RAG Ingestion Pipeline\n**Use this to ingest documents"
      },
      "typeVersion": 1
    },
    {
      "id": "96f2aa5e-8651-4f6a-bf2a-9fe954812a23",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        620,
        0
      ],
      "parameters": {
        "options": {},
        "formTitle": "Add documents to RAG",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "PDF File",
              "requiredField": true,
              "acceptFileTypes": ".pdf"
            }
          ]
        },
        "formDescription": "Click here to add documents to the semantic database"
      },
      "typeVersion": 2.2
    },
    {
      "id": "7066b3bc-b2ad-4d91-8104-1b59222932a1",
      "name": "Qdrant Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        840,
        0
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "qdrantCollection": {
          "__rl": true,
          "mode": "id",
          "value": "MCP_RAG"
        }
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "463a09b8-43ce-4427-88c6-ac54d5d705c7",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1080,
        220
      ],
      "parameters": {
        "options": {},
        "dataType": "binary"
      },
      "typeVersion": 1.1
    }
  ],
  "connections": {
    "Embeddings Ollama": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}

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

Click here to watch the full tutorial on YouTube

Source: https://n8n.io/workflows/5403/ — 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

Indexation. Uses formTrigger, embeddingsOllama, textSplitterRecursiveCharacterTextSplitter, modelSelector. Event-driven trigger; 25 nodes.

Form Trigger, Ollama Embeddings, Text Splitter Recursive Character Text Splitter +9
AI & RAG

RAG Pipeline. Uses formTrigger, vectorStoreQdrant, embeddingsOllama, documentDefaultDataLoader. Event-driven trigger; 13 nodes.

Form Trigger, Qdrant Vector Store, Ollama Embeddings +6
AI & RAG

Click here to view the YouTube Tutorial

Form Trigger, Qdrant Vector Store, Ollama Embeddings +6
AI & RAG

Indexation. Uses formTrigger, embeddingsOllama, textSplitterRecursiveCharacterTextSplitter, modelSelector. Event-driven trigger; 36 nodes.

Form Trigger, Ollama Embeddings, Text Splitter Recursive Character Text Splitter +10
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Slack Trigger, Slack, Memory Buffer Window +9