AutomationFlowsAI & RAG › Intelligent Web & Local Search with Brave Search API and Google Gemini Mcp…

Intelligent Web & Local Search with Brave Search API and Google Gemini Mcp…

Original n8n title: Intelligent Web & Local Search with Brave Search API and Google Gemini Mcp Server

ByJez @jez on n8n.io

This n8n workflow implements an AI-powered agent that intelligently uses the Brave Search API (via an external MCP service like Smithery) to perform both web and local searches. It understands natural language queries, selects the appropriate search tool, and exposes this…

Event trigger★★★★☆ complexityAI-powered26 nodesGoogle Gemini ChatMemory Buffer WindowMcp TriggerTool WorkflowN8N Nodes McpAgentExecute Workflow Trigger
AI & RAG Trigger: Event Nodes: 26 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Agent → Execute Workflow 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
{
  "id": "QclY1XQ8GEstkvk7",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Brave Search Smithery AI Agent MCP Server",
  "tags": [],
  "nodes": [
    {
      "id": "74edac39-0775-4a4d-a007-43e8853b6ff4",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        200,
        400
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-flash-preview-05-20"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "980cab3a-cc95-4e93-b334-7659d86e535d",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        700,
        520
      ],
      "parameters": {
        "sessionKey": "={{ $execution.id }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "530a8f53-88ff-42e2-84df-75c2e053c0ad",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3000,
        -1280
      ],
      "parameters": {
        "width": 980,
        "height": 440,
        "content": "## \ud83d\udcde MCP Client Configuration\n### For Roo Code, Cline, etc.\nTo use this Brave Search AI Agent in your MCP client:\n\n```json\n\"n8n-brave-search-agent\": {\n  \"url\": \"https://YOUR_N8N_INSTANCE/mcp/cc8cc827-3e72-4029-8a9d-76519d1c136d/sse\",\n  \"alwaysAllow\": [\n    \"call_brave_search_agent\"\n  ]\n}\n```\n\n**\ud83d\udcdd Notes:**\n*   Replace `YOUR_N8N_INSTANCE` with your actual n8n URL.\n*   The URL path `cc8cc827-3e72-4029-8a9d-76519d1c136d` comes from the **Brave Search MCP Server Trigger** node.\n*   `call_brave_search_agent` is the name of the **Tool Workflow** node in this main workflow.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0e22c1e6-8bc2-40a1-9bdf-d498e39c8184",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -1140
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 440,
        "content": "## \ud83d\udce1 Brave Search MCP Server Trigger\nThis node is the **public entry point** for the Brave Search AI Agent service. It exposes an MCP (Multi-Agent Collaboration Protocol) SSE (Server-Sent Events) endpoint.\n\n### Key Details:\n*   **\ud83d\udee4\ufe0f Path:** `/cc8cc827-3e72-4029-8a9d-76519d1c136d` (Unique endpoint identifier)\n*   **\ud83d\udc42 Function:** Listens for incoming HTTP POST requests to its SSE endpoint.\n*   **\ud83d\udee0\ufe0f Tool Exposed:** Makes the `call_brave_search_agent` tool available to external MCP clients.\n*   **\ud83d\udce5 Input:** Expects JSON: `{\"input\": {\"query\": \"user's search query\"}}`\n*   **\ud83d\udce4 Output:** Streams SSE events with the AI agent's responses."
      },
      "typeVersion": 1
    },
    {
      "id": "1f2b2e2d-b05c-4721-9603-4b7911763f7e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -680
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 340,
        "content": "## \u27a1\ufe0f call_brave_search_agent (Tool Workflow Node)\nThis node represents the **tool** (`call_brave_search_agent`) that external clients call via the MCP Server Trigger.\n\n### Functionality:\n*   **\ud83d\ude80 Action:** Invokes the **\"Brave Search Smithery AI Agent MCP Server\"** sub-workflow (ID: `QclY1XQ8GEstkvk7`) to process the user's search request.\n*   **\ud83d\udce5 Inputs to Sub-Workflow:**\n    *   `query`: The user's natural language search query from the MCP client.\n*   **\ud83d\udce4 Output:** The AI agent's final response/stream is passed back through the MCP Server Trigger to the client."
      },
      "typeVersion": 1
    },
    {
      "id": "32123f13-3b04-4245-b757-9dc128fa1ff9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2060,
        -660
      ],
      "parameters": {
        "color": 2,
        "width": 860,
        "height": 600,
        "content": "## \ud83d\uddfa\ufe0f Main MCP Server Workflow Overview\n### Brave Search AI Agent Gateway \ud83d\udd0e\nThis workflow acts as the public gateway for the Brave Search AI Agent.\n\n### 1. `Brave Search MCP Server Trigger` \ud83d\udce1\n*   Receives requests from external clients (e.g., Roo Code, Cline).\n*   **Client JSON Example:**\n    ```json\n    \"n8n-brave-search-agent\": {\n      \"url\": \"https://YOUR_N8N_INSTANCE/mcp/cc8cc827-3e72-4029-8a9d-76519d1c136d/sse\",\n      \"alwaysAllow\": [\"call_brave_search_agent\"]\n    }\n    ```\n    *(Confirm path & replace `YOUR_N8N_INSTANCE`)*\n\n### 2. `call_brave_search_agent` (Tool Workflow Node) \u27a1\ufe0f\n*   The \"tool\" exposed by the MCP Server Trigger.\n*   Calls the AI Agent Sub-Workflow (ID: `QclY1XQ8GEstkvk7`), passing the user's `query`.\n\n### Data Flow \ud83d\udd04:\nClient \u2192 MCP Trigger \u2192 `call_brave_search_agent` \u2192 Sub-Workflow \u2192 MCP Trigger \u2192 Client\n\n### \u2139\ufe0f Learn More:\nWatch a video explaining this pattern: [MCP Agent Video](https://youtu.be/dudvmyp7Pyg?si=N59DYTe2WE6GPlvf)\n   "
      },
      "typeVersion": 1
    },
    {
      "id": "14df63dc-d419-435b-9214-68dfb550d3b3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -280
      ],
      "parameters": {
        "color": 5,
        "width": 540,
        "height": 500,
        "content": "## \ud83c\udfc1 Sub-Workflow Start: Brave Search Logic\nThis is the entry point for the **Brave Search AI Agent** sub-workflow.\n\n*   **\ud83d\udce5 Receives:**\n    *   `query`: The user's natural language search query from the main workflow.\n*   **\u27a1\ufe0f Passes data to:** The **Brave Search AI Agent** node."
      },
      "typeVersion": 1
    },
    {
      "id": "f43df2ce-59d4-4e6e-a9aa-bf1cb6740ca1",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -280
      ],
      "parameters": {
        "color": 5,
        "width": 740,
        "height": 500,
        "content": "## \ud83e\udde0 Brave Search AI Agent (Core Logic)\nThis is the primary AI unit.\n\n### Components:\n*   **\ud83e\udd16 Model:** Google Gemini (`models/gemini-2.5-flash-preview-05-20`)\n*   **\ud83d\udcdc System Prompt:** Instructs the AI on query understanding and Brave Search tool usage. (See node config)\n*   **\ud83d\udee0\ufe0f Tools:**\n    *   `brave_web_search`\n    *   `brave_local_search`\n*   **\ud83d\udcbe Memory:** `Simple Memory` (Session Key: `{{ $execution.id }}`)\n*   **\ud83d\udce5 Input:** User's `query`.\n*   **\ud83d\udce4 Output:** Summarized search results after orchestrating tool calls."
      },
      "typeVersion": 1
    },
    {
      "id": "505ec39d-e687-4a5c-b0c0-c906e35cc830",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        640
      ],
      "parameters": {
        "color": 6,
        "width": 500,
        "height": 240,
        "content": "## \ud83d\udcbe Agent Memory (Simple Memory)\nProvides conversational memory for the AI Agent.\n\n*   **\ud83d\udccb Type:** Window Buffer Memory (keeps a sliding window of recent messages).\n*   **\ud83d\udd11 Session Key:** `{{ $execution.id }}`\n    *   *Ensures memory is unique to each execution, preventing cross-talk.*"
      },
      "typeVersion": 1
    },
    {
      "id": "aa198f9b-5fcf-4d7d-a597-5aa12c67e122",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        640
      ],
      "parameters": {
        "color": 6,
        "width": 540,
        "height": 420,
        "content": "## \ud83d\udee0\ufe0f Tool: brave_web_search (MCP Client)\nCalls the external **Brave Web Search** MCP tool via Smithery.\n\n### Details:\n*   **\ud83d\udd17 Connection:** Uses the 'smithery brave search' credential.\n*   **\ud83c\udfaf Purpose:** Performs general web searches (articles, news, etc.).\n*   **\ud83e\udd16 AI Interaction:**\n    *   Guided by the AI Agent's system prompt for general queries.\n    *   AI generates JSON for parameters:\n        *   `query` (string, **required**)\n        *   `count` (number, optional, max 20)\n        *   `offset` (number, optional, max 9)\n    *   *Example JSON:* `{\"query\": \"latest AI news\", \"count\": 5}`\n*   **\ud83d\udce4 Output:** Web search results to the AI Agent."
      },
      "typeVersion": 1
    },
    {
      "id": "39f4dff5-2086-4663-9238-e0749f74cfe4",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        640
      ],
      "parameters": {
        "color": 6,
        "width": 520,
        "height": 420,
        "content": "## \ud83d\udee0\ufe0f Tool: brave_local_search (MCP Client)\nCalls the external **Brave Local Search** MCP tool via Smithery.\n\n### Details:\n*   **\ud83d\udd17 Connection:** Uses the 'smithery brave search' credential.\n*   **\ud83c\udfaf Purpose:** Finds local businesses, services. *May fall back to web search.*\n*   **\ud83e\udd16 AI Interaction:**\n    *   Guided by system prompt for queries with local intent.\n    *   AI generates JSON for parameters:\n        *   `query` (string, **required**)\n        *   `count` (number, optional, max 20)\n    *   *Example JSON:* `{\"query\": \"pizza near me\", \"count\": 3}`\n*   **\ud83d\udce4 Output:** Local search results (or web results if fallback) to AI Agent."
      },
      "typeVersion": 1
    },
    {
      "id": "f5a49518-9373-4791-ac04-5ee8c2956c7f",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        -1580
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 660,
        "content": "## \ud83d\udca1 n8n AI Agent as an MCP Service\n### Brave Search Example \ud83d\udd0e\n**\ud83c\udfaf What This Sub-Workflow Does:**\nTransforms an AI agent specialized in **Brave Search** into a callable \"skill\" for the main MCP server. It enables natural language queries for web and local search.\n\n**\ud83d\udd04 How It Works (Internally):**\n1.  Receives `query` from the main workflow's `call_brave_search_agent` tool.\n2.  The **`Brave Search AI Agent`** node (Gemini) orchestrates the task.\n3.  Uses connected MCP Client tools to call Smithery's Brave Search:\n    *   `brave_web_search` \ud83c\udf0d\n    *   `brave_local_search` \ud83d\udccd\n4.  Utilizes `Simple Memory` for conversational context.\n\n**\ud83c\udfc6 Why This Pattern is Useful (with Smithery):**\n*   **Client Simplicity:** Main MCP clients call just *one tool* (`call_brave_search_agent`).\n*   **Token Efficiency:** Complex prompting for Brave tools happens *here*, not on the client-side.\n*   **Centralized Logic:** Update Brave search strategies here without affecting clients.\n*   **Agent Specialization:** This agent focuses *only* on Brave Search, making it modular.\n\n**(See Main Workflow for client connection examples.)**"
      },
      "typeVersion": 1
    },
    {
      "id": "4dbcdda3-c1c6-4e7b-a58c-dd7216934f13",
      "name": "Brave Search MCP Server Trigger",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        120,
        -820
      ],
      "parameters": {
        "path": "cc8cc827-3e72-4029-8a9d-76519d1c136d"
      },
      "typeVersion": 1
    },
    {
      "id": "64cd0750-4f06-49ce-93f3-4fd97e37a94f",
      "name": "call_brave_search_agent",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        280,
        -460
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "QclY1XQ8GEstkvk7",
          "cachedResultName": "Brave Search Smithery AI Agent MCP Server"
        },
        "description": "=To perform web and local searches using the Brave Search MCP and provide relevant results based on user queries. It should intelligently decide when to use web search versus local search.",
        "workflowInputs": {
          "value": {
            "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', `The primary natural language query from the user for searching.`, 'string') }}"
          },
          "schema": [
            {
              "id": "query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b58d3462-db63-4007-8faa-83fafac2e2fe",
      "name": "brave_web_search",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        1280,
        480
      ],
      "parameters": {
        "toolName": "brave_web_search",
        "operation": "executeTool",
        "connectionType": "http",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', `Generate a JSON object with the parameters for the 'brave_web_search' tool.\nThe tool expects a JSON object with the following keys:\n- \"query\": (string, **required**) The search terms for the web search.\n- \"count\": (number, optional) The number of results to return per page. Maximum is 20. If not provided, a default value will be used by the service.\n- \"offset\": (number, optional) The pagination offset to retrieve a specific page of results. Maximum is 9. If not provided, the first page is returned.\n\nExample (required only):\n{\"query\": \"latest AI research\"}\n\nExample (with optionals):\n{\"query\": \"popular javascript frameworks\", \"count\": 10, \"offset\": 0}`, 'json') }}",
        "descriptionType": "manual",
        "toolDescription": "Calls the 'brave_web_search' MCP tool to perform a general web search. Useful for finding articles, news, and answers to general knowledge questions. Supports pagination."
      },
      "credentials": {
        "mcpClientHttpApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4578b0da-6a61-4b60-b178-7614139559eb",
      "name": "brave_local_search",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        1840,
        480
      ],
      "parameters": {
        "toolName": "brave_local_search",
        "operation": "executeTool",
        "connectionType": "http",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', `Generate a JSON object with the parameters for the 'brave_local_search' tool.\nThe tool expects a JSON object with the following keys:\n- \"query\": (string, **required**) The search terms for the local search (e.g., \"coffee shop downtown\", \"bookstore [zip code]\").\n- \"count\": (number, optional) The number of local results to return. Maximum is 20. If not provided, a default value will be used by the service.\n\nExample (required only):\n{\"query\": \"restaurants near Eiffel Tower\"}\n\nExample (with optional count):\n{\"query\": \"best parks in Berlin\", \"count\": 5}\n\nNote: This tool does not support an 'offset' parameter for pagination. It may fall back to web search if no local results are found.`, 'json') }}",
        "descriptionType": "manual",
        "toolDescription": "Calls the 'brave_local_search' MCP tool to find local businesses, restaurants, and services. If no local results are found, it may automatically fall back to a web search."
      },
      "credentials": {
        "mcpClientHttpApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4a481f1a-ddb6-4ddc-8c80-789a20369516",
      "name": "Brave Search AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1000,
        80
      ],
      "parameters": {
        "text": "={{ $('Brave Search Workflow Start').item.json.query }}",
        "options": {
          "systemMessage": "You are an AI assistant designed to help users find information using Brave Search. You have access to two tools: 'brave_web_search' for general web queries and 'brave_local_search' for finding local businesses and services.\n\nYour primary goal is to understand the user's query and choose the most appropriate tool to get the best results.\n\nHere's how you should operate:\n1.  Analyze the user's query. Identify if it has a clear local intent (e.g., \"restaurants near me,\" \"hardware store in London,\" \"coffee shop 90210\") or if it's a general web search (e.g., \"latest news on AI,\" \"how to bake bread,\" \"what is quantum physics?\").\n\n2.  If local intent is strong:\n    *   Use the `brave_local_search` tool.\n    *   The `query` parameter for this tool should contain the local search terms (e.g., \"cafe Paris\", \"bookstore Main Street\").\n    *   You can use the optional `count` parameter (number, max 20) to specify how many results to retrieve.\n    *   Be aware that `brave_local_search` might automatically fall back to a web search if no specific local results are found. If this happens, clarify this in your response.\n\n3.  If the query is general or explicitly asks for web information:\n    *   Use the `brave_web_search` tool.\n    *   The `query` parameter for this tool should be the user's search terms.\n    *   You can use the optional `count` parameter (number, max 20) for results per page and `offset` (number, max 9) for pagination if needed for follow-up queries or if the user asks for more.\n\n4.  If the query is ambiguous (could be local or web):\n    *   You can either default to `brave_web_search` for broader coverage or, if confidence is low, ask the user for clarification, for example: \"Are you looking for web results or local businesses for this query?\"\n\n5.  After receiving results from a tool:\n    *   Summarize the key findings for the user.\n    *   Indicate whether the information came primarily from a web search or a local search, especially if a fallback occurred with `brave_local_search`.\n\nCritical points:\n*   Do not use the `offset` parameter with `brave_local_search`.\n*   Ensure parameters passed to tools are correctly formatted. `query` is always a string. `count` and `offset` are numbers.\n*   If a tool call fails or returns no relevant information, inform the user gracefully.\n*   Your final output should be a helpful summary addressing the user's query."
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "f811a9ae-4b05-4409-8f80-56e468c07111",
      "name": "Brave Search Workflow Start",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -20,
        80
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "query"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "0bff9d79-dc48-45e5-b5c4-a05832999e77",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2060,
        -1280
      ],
      "parameters": {
        "width": 860,
        "height": 400,
        "content": "## \ud83e\uddea Testing this MCP Endpoint\nYou can test this agent externally using tools like Postman, curl, or an MCP client.\n\n### Request Details:\n*   **Method:** `POST`\n*   **URL:** `https://YOUR_N8N_INSTANCE/mcp/cc8cc827-3e72-4029-8a9d-76519d1c136d/sse`\n    *(Replace with your full URL from the MCP Server Trigger node)*\n*   **Headers:** `Content-Type: application/json`\n*   **Body Example:**\n    ```json\n    {\n      \"input\": {\n        \"query\": \"your test query here\"\n      },\n      \"options\": {} // Optional, depending on MCP client\n    }\n    ```"
      },
      "typeVersion": 1
    },
    {
      "id": "69d177f9-777d-4348-897e-5eabc0e314c9",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        540
      ],
      "parameters": {
        "color": 6,
        "width": 480,
        "height": 340,
        "content": "## \u2699\ufe0f Key LLM & Agent Settings\n### Core Configuration:\n*   **\ud83e\udd16 LLM Model:** `models/gemini-2.5-flash-preview-05-20`\n*   **\ud83d\udcdc Agent System Prompt:**\n    *   Defined in the **'Brave Search AI Agent'** node.\n    *   *Crucial for tool selection and response style.*\n*   **\ud83e\udde0 Memory:** `Simple Memory`\n    *   Session Key: `{{ $execution.id }}`\n\n\u2728 *Modifying the System Prompt or LLM can significantly alter agent behavior.*"
      },
      "typeVersion": 1
    },
    {
      "id": "d3b3c2b9-5ddf-4ac1-a2e7-a50f7fdc6da1",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        -280
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 500,
        "content": "## \ud83c\udfaf Sub-Workflow: Brave Search AI Agent Core Logic\n### Purpose:\nTo process a user's search query, intelligently decide between web or local Brave search, execute the search via Smithery MCP tools, and summarize the results.\n\n### Expected Input:\n(From main workflow, via the `query` parameter passed to `call_brave_search_agent`)\n*   A natural language string representing the user's search request.\n    *   *Example 1:* \"restaurants near me\"\n    *   *Example 2:* \"latest AI news\""
      },
      "typeVersion": 1
    },
    {
      "id": "e00f2870-ff34-4d5d-926f-93ed191f7b22",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2060,
        -860
      ],
      "parameters": {
        "width": 860,
        "height": 180,
        "content": "## \ud83d\udee0\ufe0f Troubleshooting Tips (Sub-Workflow)\n1.  **\ud83d\udcdc Agent Logs:** Check execution logs of the **'Brave Search AI Agent'** node for its \"thought process\" and tool calls.\n2.  **\ud83d\udd0e MCP Client Tools:** Verify inputs/outputs of `brave_web_search` & `brave_local_search` nodes.\n3.  **\ud83c\udf10 External Service:** Test the Smithery Brave Search MCP (URL in Sticky Note11) independently if tool calls fail.\n4.  **\ud83d\udd11 Credentials:** Ensure 'smithery brave search' n8n credential is valid.\n5.  **\ud83d\udcac LLM Issues:** For unexpected LLM responses, review/tweak the System Prompt in the AI Agent node."
      },
      "typeVersion": 1
    },
    {
      "id": "3eed4f4b-d7c1-42b8-b6a1-86e005454624",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -1580
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 200,
        "content": "## \ud83d\udcc4 Workflow Information\n*   **Workflow:** Brave Search Smithery AI Agent MCP Server (Main Gateway)\n*   **Version:** 1.0.0\n*   **Last Updated:** 2025-06-01\n*   **\ud83d\udc64 Author:** Jeremy Dawes, Jezweb ([www.jezweb.com.au](https://www.jezweb.com.au/))\n*   **\ud83d\udcdc Description:** Main MCP server exposing the Brave Search AI Agent."
      },
      "typeVersion": 1
    },
    {
      "id": "cb0b44b4-2a47-4908-9ec3-81d6736b27d5",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -1360
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 200,
        "content": "## \u2705 TODO / Future Enhancements\n*   [ ] Add more detailed error handling for specific tool failures.\n*   [ ] Explore caching results for common queries.\n*   [ ] Refine system prompt for ambiguous local vs. web search cases.\n*   [ ] Consider adding freshness parameters to `brave_web_search` if needed."
      },
      "typeVersion": 1
    },
    {
      "id": "56163ca6-2bad-495c-b486-54f36a3b4e75",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3000,
        -800
      ],
      "parameters": {
        "width": 990,
        "height": 1120,
        "content": "## Example prompt and response in Roo Code\n\n![Source example](https://www.jezweb.com.au/wp-content/uploads/2025/06/brave-search-mcp-server-agent-roo-code.png#full-width)\n\n### Much less context wasted on extra information fromt he Brave Search MCP server output!"
      },
      "typeVersion": 1
    },
    {
      "id": "b268e31a-72f8-4ed5-b9da-55bfcae49b2d",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4040,
        -780
      ],
      "parameters": {
        "width": 1460,
        "height": 1320,
        "content": "## Example raw output that Roo Code would receive direct from the Brave Search MCP\n\n![Example raw output that Roo Code would receive direct from the Brave Search MCP](https://www.jezweb.com.au/wp-content/uploads/2025/06/brave-search-example-raw-result.png#full-width)"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6fb7ce8c-5a65-4e4e-9af7-cadc36bf31ae",
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Brave Search AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "brave_web_search": {
      "ai_tool": [
        [
          {
            "node": "Brave Search AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "brave_local_search": {
      "ai_tool": [
        [
          {
            "node": "Brave Search AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "call_brave_search_agent": {
      "ai_tool": [
        [
          {
            "node": "Brave Search MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Brave Search AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Brave Search Workflow Start": {
      "main": [
        [
          {
            "node": "Brave Search AI Agent",
            "type": "main",
            "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

This n8n workflow implements an AI-powered agent that intelligently uses the Brave Search API (via an external MCP service like Smithery) to perform both web and local searches. It understands natural language queries, selects the appropriate search tool, and exposes this…

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

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

Google Gemini Chat, Memory Buffer Window, N8N Nodes Mcp +6
AI & RAG

This n8n workflow implements an AI-powered "Local Event Finder" agent. It takes user criteria (like event type, city, date, and interests), uses a suite of search tools (Brave Web Search, Brave Local

Google Gemini Chat, Memory Buffer Window, N8N Nodes Mcp +6
AI & RAG

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

Google Gemini Chat, N8N Nodes Mcp, Mcp Trigger +4
AI & RAG

The AI-Powered Shopify SEO Content Automation is an enterprise-grade workflow that transforms product content creation for e-commerce stores. This sophisticated multi-agent system integrates GPT-4o, C

Perplexity Tool, Memory Buffer Window, Agent +15
AI & RAG

How it Works

Memory Buffer Window, Agent, Output Parser Structured +9