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
Interactive Tool
1-Click Export

Generate & Test Brave Search MCP Server Config

One-click export with environment variables & path locators for Claude Desktop, Cursor, Windsurf, and OpenAI Codex CLI.

Open in Generator

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)

Ready to Deploy?

Build your full agent toolstack in the Visual Generator

Combine Brave Search with databases, search APIs, and memory graphs in a single configuration file.

Customize in Generator

Related Guides