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.
claude_desktop_config.json{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-brave-search"
],
"env": {
"BRAVE_API_KEY": "BSAxxxxxxxxxxxxxxxxxxxx"
}
}
}
}Generate & Test Brave Search MCP Server Config
One-click export with environment variables & path locators for Claude Desktop, Cursor, Windsurf, and OpenAI Codex CLI.
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
- ▸Visit brave.com/search/api (opens in a new tab).
- ▸Sign up for a free developer account.
- ▸Create a new API key and copy it.
Configuration Setup
Add the following to your MCP client config:
{
"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
Add this server to the OpenAI Codex CLI:
codex mcp add --name brave-search-mcp-server --command "npx" --args "-y @modelcontextprotocol/server-brave-search@0.6.2"The version above is pinned to the release this guide was verified against. Check for a newer one before upgrading:
npm view @modelcontextprotocol/server-brave-search versionReference: Configuring MCP servers with OpenAI Codex.
Weekly Protocol Diffs & Verified Drops
New server guides, benchmarks, and security audits. No spam. Unsubscribe anytime.
Zero marketing spam. 1-click unsubscribe anytime.
Build your full agent toolstack in the Visual Generator
Combine Brave Search with databases, search APIs, and memory graphs in a single configuration file.
Did this setup guide work with your AI host?
Help test this configuration across Claude, Cursor, and Codex CLI. Be the first to report:
How to Set Up the Brave Search MCP Server for Web Research FAQ
What is the 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.
How do I configure How to Set Up the Brave Search MCP Server for Web Research in Claude Desktop or Cursor?
You can copy the configuration JSON from our guide or launch the interactive MCP Codex Config Generator at https://mcp-codex.com/generator to export valid configs in 1 click.
Can I use How to Set Up the Brave Search MCP Server for Web Research with the OpenAI Codex CLI?
Yes, OpenAI Codex CLI supports Model Context Protocol. You can add it directly to ~/.codex/config.toml or pass arguments to codex mcp add.
Specializing in Model Context Protocol (MCP) integrations, autonomous AI agent orchestration, and distributed developer toolchains. Researches and benchmarks production MCP client-server architectures across OpenAI Codex, Claude, and Cursor.
Related Guides
HubSpot and Zendesk MCP Integration Guide
Connect HubSpot CRM contacts and Zendesk tickets to Model Context Protocol agents: Automated ticket triage, contact enrichment, and safe draft workflows.
APIsAlpaca Finance API MCP Server Guide
Connect Alpaca Finance API to Model Context Protocol: Stream real-time market data, execute paper trades safely, and enforce autonomous budget guardrails.
APIsAccepting Stripe's Machine Payments Protocol (MPP) in Your MCP Server
Charge agents per tool call with MPP: an MCP tool that returns a payment link, an endpoint that answers 402 with a challenge, and Shared Payment Token verification.