Spin up the Brave Search MCP server as a Meshagent service in the cloud, then interact with it using a chatbot—all in just a few commands!

Prerequisites

Required Environment Variables

  • BRAVE_API_KEY: Your Brave Search API key (get one from Brave)

Steps

  1. Install Meshagent with all dependencies:

    pip install "meshagent[all]"
    
  2. Sign up and authenticate your Meshagent CLI:

    Follow the instructions at: https://docs.meshagent.com/cli/getting_started

  3. Start the Brave Search MCP Server as a Meshagent service in a room:

    meshagent service test \
      --room=test \
      --role=agent \
      --image=meshagent/mcp-brave-search:latest \
      --env MESHAGENT_PORT=8001 \
      --env BRAVE_API_KEY=YOUR_API_KEY_HERE \
      --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" \
      --name=mcp-brave-search-service
    
    • This command launches the MCP server in a Meshagent room called test.
    • Replace YOUR_API_KEY_HERE with your own Brave API key.
    • Rooms close automatically if inactive.
  4. Join your agent to the room and use the Brave Search toolkit:

    meshagent chatbot join \
      --room=test \
      --agent-name=sample \
      --name=sample \
      --toolkit=mcp-brave-search
    
    • This starts a chatbot in the same room using the Brave Search toolkit.
    • You can add multiple toolkits and more agents as desired.
    • A link to the room will be provided—visit it in your browser to interact live!

Tools Available

The Brave Search MCP server offers the following standardized tools inside Meshagent Rooms:

Tools Summary

ToolShort Description
brave_local_searchSearches for local businesses and places using Brave’s Local Search API.
brave_web_searchPerforms a web search using the Brave Search API, ideal for general queries, news, articles, and online content.

Tools Details

Search for local businesses and places using Brave’s Local Search API. Best for queries about physical locations, businesses, restaurants, services, etc. Returns information such as:

  • Business names and addresses
  • Ratings and review counts
  • Phone numbers and opening hours

Use when queries imply “near me” or mention specific locations. Automatically falls back to web search if no local results are found.

ParameterTypeDescription
querystringLocal search query (e.g., ‘pizza near Central Park’)
countnumberOptional. Number of results (1-20, default 5)

Perform a web search using the Brave Search API, suited for general queries, news, articles, and broad information gathering. Useful for latest events or when diverse web sources are required. Supports pagination and content filtering.

ParameterTypeDescription
querystringSearch query (max 400 chars, 50 words)
countnumberOptional. Number of results (1-20, default 10)
offsetnumberOptional. Pagination offset (max 9, default 0)

Meshagent and MCP Tool Resources

For more advanced configuration, see the official Meshagent documentation and Brave Search MCP Server repository.