Brave Search MCP server

Integrates with Brave Search API to enable web searches and local business lookups via natural language queries.
Back to servers
Provider
Arben Ademi
Release date
Jan 27, 2025
Language
Python
Stats
11 stars

This MCP server integrates Brave Search capabilities with AI assistants like Claude through the Model Context Protocol. It enables your AI assistant to perform web searches and find local businesses directly using Brave's search engine.

Prerequisites

  • Python 3.11+
  • uv - A fast Python package installer and resolver

Installation

Installing via Smithery

To install Brave Search MCP server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @arben-adm/brave-mcp-search --client claude

Manual Installation

  1. Clone the repository:

    git clone https://github.com/your-username/brave-search-mcp.git
    cd brave-search-mcp
    
  2. Create a virtual environment and install dependencies using uv:

    uv venv
    source .venv/bin/activate  # On Windows, use: .venv\Scripts\activate
    uv pip install -r requirements.txt
    
  3. Set up your Brave Search API key:

    export BRAVE_API_KEY=your_api_key_here
    

    On Windows, use: set BRAVE_API_KEY=your_api_key_here

Usage

Configuration

Configure your MCP settings file (e.g., claude_desktop_config.json) to include the Brave Search MCP server:

{
  "mcpServers": {
    "brave-search": {
      "command": "uv",
      "args": [
        "--directory",
        "path-to\\mcp-python\\brave-mcp-search\\src",
        "run",
        "server.py"
      ],
      "env": {
        "BRAVE_API_KEY": "YOUR_BRAVE_API_KEY_HERE"
      }
    }
  }
}

Replace YOUR_BRAVE_API_KEY_HERE with your actual Brave API key.

Running the Server

  1. Start the Brave Search MCP server by running your MCP-compatible AI assistant with the updated configuration.
  2. The server will be ready to accept requests from MCP clients.
  3. You can now use Brave Search functionality in your AI assistant by invoking the available tools.

Available Tools

The server provides two main tools:

  • brave_web_search: Performs a web search using the Brave Search API
  • brave_local_search: Searches for local businesses and places

Using the Search Tools

When interacting with your AI assistant (like Claude), you can prompt it to use these tools by asking for information that would require a web search or local business search. The assistant will automatically invoke the appropriate tool based on your query.

For example:

  • "Can you search for recent news about renewable energy?"
  • "Find pizza restaurants near downtown Seattle"

The AI assistant will use the Brave Search tools to retrieve and present the requested information.

Troubleshooting

If you encounter issues:

  • Ensure your Brave API key is correctly set
  • Check that all dependencies are installed
  • Verify you're using a compatible Python version (3.11+)
  • If you make changes to the code, restart the server

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later