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

1,867 views · ⚒️ Engineering

💡 Pro Tip — If you need GitHub data beyond what the REST API gives you, ScraperNode has a repository scraper that extracts metadata at scale without token rate limits.

View All Scrapers

Description

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

Benefits

Nodes Used

Prerequisites

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

Further Information

Author

Jeremy Dawes (Jezweb)

🔗 Nodes Used

Execute Workflow Trigger, AI Agent, Simple Memory, Call n8n Workflow Tool, Google Gemini Chat Model, MCP Server Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup