APIs·
beginner
·8 min read·Apr 4, 2026

How to Set Up the Brave Search MCP Server for Web Research

Enable your AI agent to search the web using Brave Search API through MCP. Perfect for research, fact-checking, and gathering real-time information.

Brave Searchweb searchAPIresearchreal-time data

Set Up the Brave Search MCP Server

The Brave Search MCP server gives AI agents the ability to autonomously search the web. Because most LLMs have a knowledge cutoff date, giving them access to Brave Search allows them to gather real-time news, verify documentation changes, and perform competitive analysis on live data.

Why Brave Search + MCP?

  • Real-time data: Access current information, news, and prices.
  • Privacy-focused: Brave Search doesn't track users or bias results based on profiles.
  • Rich results: Access standard web pages, news articles, videos, and local POIs.
  • Generous Free Tier: Up to 2,000 queries per month at no cost.

Prerequisites & API Keys

  1. Visit brave.com/search/api.
  2. Sign up for a free developer account.
  3. Create a new API key and copy it.

Configuration Setup

Add the following to your MCP client config:

json
{
  "mcpServers": {
    "brave-search": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "BSA_your_api_key_here"
      }
    }
  }
}

Available Tools

  • brave_web_search — General web search supporting standard pagination.
  • brave_local_search — Location-based search for brick-and-mortar businesses and places.

The web search tool supports parameters like:

  • query — The search term.
  • count — Number of results (max 20 per page).
  • offset — Pagination offset.

Example Workflows

  • Real-Time Research: "Search for the latest developments in quantum computing released this week and write a summary."
  • Fact Verification: "Verify the current population of Tokyo against the latest available census data."
  • Local Information: "Find the top 5 highest-rated Italian restaurants near downtown Portland and list their addresses."

Best Practices & Troubleshooting

  • Rate Limiting: The free tier restricts you to 1 query per second. If your agent attempts to fire off 5 parallel searches to build a research paper, the API will reject the requests. Explicitly prompt your agent to perform searches sequentially.
  • Location-Based Searches: When using brave_local_search, the agent sometimes struggles to define bounding boxes. Ensure your prompt provides clear city names or zip codes so the AI can construct the location query accurately.
  • Content Truncation: The Brave API returns snippets of websites, not the entire HTML body. If you need the agent to read the full article, combine the Brave Search MCP server with the Puppeteer MCP server or a Fetch tool.

Using with OpenAI Codex

To use this MCP server with the OpenAI Codex CLI, you can add it to your configuration using the codex mcp add command:

bash
codex mcp add --name brave-search --command "npx @modelcontextprotocol/server-brave-search"

(Note: Depending on the server, you may need to append arguments or use --env flags for environment variables as described in the configuration section above)

Related Guides