Skip to main content

Intelligent web & local search with Brave Search API and Google Gemini MCP Server

Workflow preview

Workflow preview
100%
Intelligent web & local search with Brave Search API and Google Gemini MCP Server preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Summary 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 understa...

Best for

  • Engineering automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.mcptrigger, @n8n/n8n-nodes-langchain.toolworkflow, n8n-nodes-mcp.mcpclienttool, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.executeworkflowtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jez.

Original n8n.io source

1.1 Workflow description

Title
Intelligent web & local search with Brave Search API and Google Gemini MCP Server
Workflow name
Intelligent web & local search with Brave Search API and Google Gemini MCP Server

Summary

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 enhanced capability as a single, callable MCP tool.

Key Features

  • πŸ€– Intelligent Tool Selection: AI agent decides between Brave's web search and local search tools based on user query context.
  • 🌐 MCP Microservice: Exposes complex search logic as a single, easy-to-integrate MCP tool (call_brave_search_agent).
  • 🧠 Powered by Google Gemini: Utilizes the gemini-2.5-flash-preview-05-20 LLM for advanced reasoning.
  • πŸ—£οΈ Conversational Memory: Remembers context within a single execution flow.
  • πŸ“ Customizable System Prompt: Tailor the AI's behavior and responses.
  • 🧩 Modular Design: Connects to external Brave Search MCP tools (e.g., from Smithery).

Benefits

  • πŸ”Œ Simplified Integration: Easily add advanced, AI-driven search capabilities to other applications or agent systems.
  • πŸ’Έ Reduced Client-Side LLM Costs: Offloads complex prompting and tool orchestration to n8n, minimizing token usage for client-side LLMs.
  • πŸ”§ Centralized Logic: Manage and update search strategies and AI behavior in one place.
  • πŸš€ Extensible: Can be adapted to use other search tools or incorporate more complex decision-making.

Nodes Used

  • @n8n/n8n-nodes-langchain.mcpTrigger (MCP Server Trigger)
  • @n8n/n8n-nodes-langchain.toolWorkflow
  • @n8n/n8n-nodes-langchain.agent (AI Agent)
  • @n8n/n8n-nodes-langchain.lmChatGoogleGemini (Google Gemini Chat Model)
  • n8n-nodes-mcp.mcpClientTool (MCP Client Tool - for Brave Search)
  • @n8n/n8n-nodes-langchain.memoryBufferWindow (Simple Memory)
  • n8n-nodes-base.executeWorkflowTrigger (Workflow Start - for direct execution/testing)

Prerequisites

  • An active n8n instance (v1.22.5+ recommended).
  • A Google AI API key for using the Gemini LLM.
  • Access to an external MCP service that provides Brave Search tools (e.g., a Smithery account configured with their Brave Search MCP). This includes the MCP endpoint URL and any necessary authentication (like an API key for Smithery).

Setup Instructions

  1. Import Workflow: Download the Brave_Search_Smithery_AI_Agent_MCP_Server.json file and import it into your n8n instance.
  2. Configure LLM Credential:
    • Locate the 'Google Gemini Chat Model' node.
    • Select or create an n8n credential for "Google Palm API" (used for Gemini), providing your Google AI API key.
  3. Configure Brave Search MCP Credential:
    • Locate the 'brave_web_search' and 'brave_local_search' (MCP Client) nodes.
    • Create a new n8n credential of type "MCP Client HTTP API".
      • Name: e.g., Smithery Brave Search Access
      • Base URL: Enter the URL of your Brave Search MCP endpoint from your provider (e.g., https://server.smithery.ai/@YOUR_PROFILE/brave-search/mcp).
      • Authentication: If your MCP provider requires an API key, select "Header Auth". Add a header with the name (e.g., X-API-Key) and value provided by your MCP service.
    • Assign this newly created credential to both the 'brave_web_search' and 'brave_local_search' nodes.
  4. Note MCP Trigger Path:
    • Open the 'Brave Search MCP Server Trigger' node.
    • Copy its unique 'Path' (e.g., /cc8cc827-3e72-4029-8a9d-76519d1c136d). You will combine this with your n8n instance's base URL to get the full endpoint URL for clients.

How to Use

This workflow exposes an MCP tool named call_brave_search_agent. External clients can call this tool via the URL derived from the 'Brave Search MCP Server Trigger'.

Example Client MCP Configuration (e.g., for Roo Code):

"n8n-brave-search-agent": {
  "url": "https://YOUR_N8N_INSTANCE/mcp/cc8cc827-3e72-4029-8a9d-76519d1c136d/sse",
  "alwaysAllow": [
    "call_brave_search_agent"
  ]
}

Replace YOUR_N8N_INSTANCE with your n8n's public URL and ensure the path matches your trigger node.

Example Request: Send a POST request to the trigger URL with a JSON body:

{
  "input": { "query": "best coffee shops in London" }
}

The agent will stream its response, including the summarized search results.

Customization

  • AI Behavior: Modify the System Prompt within the 'Brave Search AI Agent' node to fine-tune its decision-making, response style, or how it uses the search tools.
  • LLM Choice: Replace the 'Google Gemini Chat Model' node with any other compatible LLM node supported by n8n.
  • Search Tools: Adapt the workflow to use different or additional search tools by modifying the MCP Client nodes and updating the AI Agent's system prompt and tool definitions.

Further Information

Author

Jeremy Dawes (Jezweb)

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 2 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 3 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Brave Search MCP Server Trigger

Type / Role
@n8n/n8n-nodes-langchain.mcpTrigger - mcpTrigger
Config choices
Version 1

Block 14 - call_brave_search_agent

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.2

Block 15 - brave_web_search

Type / Role
n8n-nodes-mcp.mcpClientTool - mcpClientTool
Config choices
Version 1

Block 16 - brave_local_search

Type / Role
n8n-nodes-mcp.mcpClientTool - mcpClientTool
Config choices
Version 1

Block 17 - Brave Search AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 18 - Brave Search Workflow Start

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 19 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note12

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note13

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note14

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note15

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note16

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 26 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Intelligent web & local search with Brave Search API and Google Gemini MCP Server
Complexity advanced
Nodes 26
Categories Engineering, AI RAG
Author Jez
Published 01 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4559/4559.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Intelligent web & local search with Brave Search API and Google Gemini MCP Server do?

Summary 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 understa...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI RAG use case.