Telegram Bot Integration for Brave Search Engine Queries - n8n Workflow

Automate web searches directly from Telegram using this powerful n8n workflow. Integrate the Brave Search API via the specialized MCP n8n node for instant, private search results delivered to your chat.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Users needing instant web search capabilities within Telegram.
Developers utilizing the MCP (Microservice Client Protocol) within n8n.
n8n users looking for advanced community n8n templates and custom n8n node integrations.
Automation specialists who want to build custom chat-based search agents using n8n workflow.

Overview

This solution solves the need for integrating external, high-quality web search context directly within a chat environment. By deploying this specific n8n workflow, you transform a Telegram bot into a sophisticated search agent powered by Brave Search. The key to this functionality is the custom n8n-nodes-mcp n8n node, which securely interfaces with the Brave Search API. This specific n8n template is ideal for users looking to leverage powerful external APIs directly within their automation logic, ensuring highly relevant and privacy-focused search results delivered instantly via a simple Telegram command. Setting up this n8n workflow requires configuring the Brave API key within the MCP credentials.

How it Works

The n8n workflow is initiated by a specific command structure within Telegram.


  1. Trigger: The Get Message n8n trigger waits for new messages in the configured Telegram chat.

  2. Filtering: The Search with Brave? n8n node checks if the message text starts with the specific command /brave . If this condition is met, the flow continues, filtering out irrelevant messages.

  3. Data Cleaning: The text is extracted by the Get Text n8n node and then processed by the Clean query n8n node (a Code node) to remove the initial /brave command, isolating the pure search term.

  4. MCP Integration: The List Brave Tools and Exec Brave tool MCP n8n nodes are called in sequence. These specialized n8n nodes use the provided Brave API key configured in the MCP credential to access the search functionality, executing the search query.

  5. Output: Finally, the Send message Telegram n8n node takes the content of the search results (usually formatted as HTML) and sends it back to the original user's Telegram chat ID, completing the loop of this powerful n8n workflow.

Installation Guide


  1. Prerequisites: You must have a self-hosted n8n instance and install the community n8n node: n8n-nodes-mcp. Obtain a Brave Search API Key and a Telegram Bot Access Token.

  2. Import: Copy the provided n8n workflow JSON and import it into your n8n editor. This ready-made n8n template provides the foundation for your automation.

  3. Telegram Credentials: Set up your Telegram API credentials in the Get Message n8n trigger and Send message n8n node using your Bot Token.

  4. MCP Credentials (Brave): The MCP n8n node requires specific configuration. In the credentials setup for the MCP node, you must define the BRAVEAPIKEY environment variable within the Environment field, setting its value to your acquired Brave Search API Key.

  5. Activation: Ensure the n8n workflow is active and test it by sending /brave your search term to your configured Telegram bot to execute the n8n node logic.

Node Details

Get Message (Telegram Trigger n8n trigger):
Function: Initiates the n8n workflow upon receiving a new Telegram message, acting as the starting point (n8n trigger).
Key Configuration: Listens for message updates.
Search with Brave? (If n8n node):
Function: Filters incoming messages, ensuring the flow continues only if the message starts with the /brave command, a core logic piece of this n8n workflow.
Key Configuration: Checks if $json.message.text starts with /brave .
Clean query (Code n8n node):
Function: Uses custom JavaScript to process the message text, stripping the /brave command to prepare the clean search query for the Brave API.
Key Configuration: Defines a new JSON field query derived from the original text.
Exec Brave tool (mcpClient n8n node):
Function: Executes the actual Brave search function using the MCP protocol and the cleaned search query, relying on the appropriate MCP n8n node configuration.
Key Configuration: Passes the cleaned query from the Clean query n8n node to the toolParameters.
Send message (Telegram n8n node):
Function: Sends the compiled Brave search results back to the user via Telegram.
* Key Configuration: text is dynamically populated by the search result content ($json.result.content[0].text).

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza

Featured*