Overview
Privacy-focused web search for AI agents using Brave Search API.
Setup
Run with npx:
npx -y @modelcontextprotocol/server-brave-searchConfiguration
BRAVE_API_KEY environment variableDocumentation
Brave Search MCP
Overview
Brave Search MCP is a Model Context Protocol server that provides AI agents with access to Brave's privacy-focused web search API. It enables agents to perform real-time web searches, retrieve search results, and access web content — all while maintaining user privacy.
Key Features
🔍 Web Search Capabilities
- Real-Time Search: Query the web for current information
- Privacy-Focused: Brave's search doesn't track user data
- Rich Results: Get titles, snippets, URLs, and more
- Configurable Parameters: Control count, freshness, and more
📊 Search Parameters
{
"q": "search query",
"count": 10,
"offset": 0,
"search_lang": "en",
"ui_lang": "en-US",
"country": "us",
"freshness": "day|week|month|year",
"safe_search": "off|moderate|strict",
"text_format": "raw|html"
}
🛠️ Available Tools
| Tool | Description |
|---|---|
brave_search | Perform a web search and return results |
brave_search_autocomplete | Get search suggestions for a query |
Installation
# Using npx (recommended)
npx -y @modelcontextprotocol/server-brave-search
# With environment variable
BRAVE_API_KEY=your-api-key npx -y @modelcontextprotocol/server-brave-search
Configuration
Required Setup
-
Get a Brave Search API Key:
- Visit Brave Search API
- Sign up for a free tier (2,000 queries/month)
- Or purchase a paid plan for higher limits
-
Set Environment Variable:
export BRAVE_API_KEY=your-api-key-here -
Configure in Claude Desktop:
{ "mcpServers": { "brave-search": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-brave-search"], "env": { "BRAVE_API_KEY": "your-api-key-here" } } } }
Usage Examples
Basic Search
Search for: "latest AI agent frameworks 2025"
The MCP server will return:
- Search result titles
- Snippets/descriptions
- URLs
- Date published
- Related searches
Search with Filters
Find recent articles about MCP servers from the past week
Use the freshness parameter to filter by time:
day- Last 24 hoursweek- Last 7 daysmonth- Last 30 daysyear- Last 365 days
Safe Search
Search with safe search enabled for: "appropriate content query"
Safe search levels:
off- No filteringmoderate- Filter explicit contentstrict- Aggressive filtering
Integration with AI Agents
Claude Desktop
Once configured, Claude can use Brave Search naturally:
Claude: "Let me search for the latest information on that topic..."
[Uses brave_search tool]
Claude: "Based on my search, here's what I found..."
Cursor / Windsurf / Zed
All MCP-compatible editors support Brave Search:
- Open MCP settings
- Add Brave Search server configuration
- Start asking questions that require web search
Custom Agent Integration
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
# Connect to Brave Search MCP
server_params = StdioServerParameters(
command="npx",
args=["-y", "@modelcontextprotocol/server-brave-search"],
env={"BRAVE_API_KEY": "your-key"}
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Initialize
await session.initialize()
# List available tools
tools = await session.list_tools()
# Call search
result = await session.call_tool(
"brave_search",
arguments={"q": "AI agent frameworks"}
)
Pros
- ✅ Privacy-First: Brave doesn't track or profile users
- ✅ Free Tier Available: 2,000 queries/month for free
- ✅ Fast Response: Optimized search infrastructure
- ✅ Rich Results: Detailed search result metadata
- ✅ Easy Setup: Simple npx installation
- ✅ Wide Compatibility: Works with all MCP clients
Cons
- ❌ Rate Limits: Free tier has monthly limits
- ❌ API Key Required: Must sign up for Brave Search
- ❌ Limited to Web Search: No other data sources
- ❌ Search Quality: May not match Google's comprehensiveness
Pricing
| Plan | Queries/Month | Price |
|---|---|---|
| Free | 2,000 | $0 |
| Basic | 10,000 | $15/month |
| Pro | 100,000 | $100/month |
| Enterprise | Custom | Contact sales |
Resources
- GitHub: https://github.com/modelcontextprotocol/servers/tree/main/src/brave-search
- Brave Search API: https://brave.com/search/api/
- MCP Servers Repo: https://github.com/modelcontextprotocol/servers
- Documentation: https://modelcontextprotocol.io/introduction
Comparison
| Feature | Brave Search | Google Search | DuckDuckGo |
|---|---|---|---|
| Privacy | ✅ Excellent | ❌ Tracks users | ✅ Good |
| Free Tier | ✅ 2,000/mo | ❌ Limited | ✅ Unlimited |
| API Quality | ✅ Good | ✅ Excellent | ⚠️ Moderate |
| Setup Ease | ✅ Easy | ⚠️ Complex | ✅ Easy |
| Result Quality | ✅ Good | ✅ Best | ⚠️ Moderate |
Last updated: May 2026
