Brave Search MCP server

Integrates with Brave Search to provide web and local search capabilities with automatic fallback, rate limiting, and SSE transport support for privacy-respecting search operations
Back to servers
Provider
Shoofio
Release date
Mar 25, 2025
Language
TypeScript
Stats
7 stars

This MCP server enables integration with Brave Search API through a streaming interface, providing web and local search capabilities to AI models and applications that support the Model Context Protocol (MCP).

Installation Options

Docker Deployment

Prerequisites: Docker installed and a Brave Search API key

  1. Pull the Docker image:

    docker pull shoofio/brave-search-mcp-sse:latest
    
  2. Run the container:

    docker run -d --rm \
      -p 8080:8080 \
      -e BRAVE_API_KEY="YOUR_API_KEY_HERE" \
      -e PORT="8080" \
      --name brave-search-server \
      shoofio/brave-search-mcp-sse:latest
    

Kubernetes Deployment with Helm

Prerequisites: kubectl configured, Helm installed, and a Brave Search API key

  1. Add the Helm repository:

    helm repo add brave-search-mcp-sse https://shoofio.github.io/brave-search-mcp-sse/
    helm repo update
    
  2. Create a Kubernetes secret for your API key:

    kubectl create secret generic brave-search-secret \
      --from-literal=api-key='YOUR_API_KEY_HERE' \
      -n <your-namespace>
    
  3. Install the Helm chart:

    helm install brave-search brave-search-mcp-sse/brave-search-mcp-sse \
      -n <your-namespace> \
      --set braveSearch.existingSecret=brave-search-secret
    

Local Development Setup

Prerequisites: Node.js v22.x+, npm, Git, and a Brave Search API key

  1. Clone the repository and install dependencies:

    git clone <repository_url>
    cd brave-search-mcp-sse
    npm install
    
  2. Create a .env file in the project root:

    BRAVE_API_KEY=YOUR_API_KEY_HERE
    PORT=8080
    
  3. Build and run the server:

    npm run build
    npm start
    

Using the Server

Available Tools

The server exposes two primary search tools:

  1. brave_web_search

    • Performs general web searches
    • Parameters:
      • query (required): The search query
      • count (optional): Number of results (1-20, default 10)
      • offset (optional): Pagination offset (0-9, default 0)
  2. brave_local_search

    • Searches for local businesses and places
    • Parameters:
      • query (required): Local search query (e.g., "pizza near me")
      • count (optional): Maximum results (1-20, default 5)

Configuring Clients

To use this server with MCP clients like Cursor, add this configuration to your client settings:

{
  "mcpServers": {
    "brave-search": {
      "transport": "sse",
      "url": "http://localhost:8080/sse"
    }
  }
}

Notes:

  • Replace the URL with your actual server address
  • If running in Kubernetes, use the appropriate service address or ingress hostname
  • Ensure the URL path ends with /sse

Environment Variables

Configuration options:

  • BRAVE_API_KEY: Required Brave Search API key
  • PORT: Server listening port (default: 8080)
  • LOG_LEVEL: Logging verbosity (e.g., info, debug)

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