Integrate Brave Search API with MCP server for web and local search solutions customizable with proxy and filtering options
The Brave Search MCP Server is an advanced implementation that integrates the powerful Brave Search API, providing both web and local search capabilities to AI applications via the Model Context Protocol (MCP). This server stands out by leveraging node-fetch-native
for robust data fetching compared to its fork from the Model Context Protocol servers. Additionally, it offers flexible configuration options, including environment variables like http_proxy
, https_proxy
, and BRAVE_SEARCH_PROXY
, ensuring seamless integration with various network setups.
The Brave Search MCP Server supports general web search queries, allowing AI applications to find news, articles, and more. This feature includes pagination controls and freshness filters, enabling precise tuning of results to ensure users receive up-to-date information relevant to their needs.
Local businesses, restaurants, and services can be efficiently searched using the local module. When no specific local results are found, the server intelligently falls back to web search—this smart fallback ensures comprehensive coverage without compromising on user experience.
Users (or AI applications) benefit from sophisticated filtering controls that tweak result types, safety levels, and content freshness. This granularity empowers both developers and end-users to tailor searches according to specific needs or compliance standards.
The core of the implementation focuses on adhering strictly to the Model Context Protocol (MCP) to ensure seamless interoperability with various MCP clients such as Claude Desktop, Continue, and Cursor. The protocol ensures that data is structured and communicated in a way that maximizes efficiency and maintains security.
graph TD
A[AI Application] -->|MCP Client| B[MCP Server]
B --> C[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
graph LR
subgraph Search
webSearch[Web Search Service]
localSearch(Local Search Service)
end
subgraph Server
mcpServer[BRAVE Search MCP Server]
end
subgraph Tools
dataSource[Data Source/Tool]
end
Search.mcpServer
Search.webSearch --> |HTTP| mcpServer
Search.localSearch --> |HTTP| mcpServer
mcpServer --> C[dataSource]
To get started quickly, you can use Docker to install and run the server. Add the following configuration to your claude_desktop_config.json
or .vscode/mcp.json
file:
{
"mcpServers": {
"brave-search": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"BRAVE_API_KEY",
"mcp/brave-search"
],
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE",
"BRAVE_SEARCH_PROXY": "https://example.com:10890" // Optional, remove if not needed
}
}
}
}
For developers preferring a non-Docker method, the @kwp-lab/mcp-brave-search
npm package can be utilized. Include it in your VS Code settings file like so:
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE",
"BRAVE_SEARCH_PROXY": "https://example.com:10890" // Optional, remove if not needed
}
}
}
}
A user might have an AI application that curates personalized news based on their interests. By integrating the Brave Search MCP Server, the application can dynamically update its database with fresh news articles while respecting the user's preferences. This real-time update mechanism ensures users always receive relevant and timely information.
For a food delivery service integrated with AI technology, the server can enhance ordering processes by providing accurate local restaurant options. If no nearby restaurants are available, the MCP server intelligently suggests alternative options from web searches, ensuring a seamless user experience even when faced with local data limitations.
The Brave Search MCP Server is compatible with several prominent MCP clients:
This broad compatibility ensures that the server can be integrated into a diverse array of AI application workflows, enhancing their functionality and user engagement.
Below is a matrix detailing the MCP clients' compatibility with different features:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
Here’s an example of how to configure the Brave Search MCP Server with robust environment variables:
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": ["-y", "@kwp-lab/mcp-brave-search"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
To ensure the server’s security, always use secure connections and implement rate limiting. Additionally, regularly update dependencies and monitor logs for any unusual activity.
Q: Can I use Brave Search MCP Server with Continue?
Q: How do I switch between local and web search results in the server configuration?
Q: What happens if no local data is available, and how does the server manage it?
Q: How do I ensure the server's dependencies are up-to-date for optimal performance?
npm
).Q: Can I customize the search results further beyond the provided filters?
Contributors are welcome to join in enhancing this MCP server. Pull requests are encouraged for bug fixes, performance improvements, and feature additions. Detailed guidelines on setting up a development environment and contributing can be found in the project’s repository.
For those interested in learning more about Model Context Protocol (MCP), various resources such as official documentation, community forums, and relevant blog posts provide valuable insights. Additionally, exploring MCP client-specific repositories offers further integration capabilities.
This document provides a robust overview of the Brave Search MCP Server’s features, capabilities, and integrations, ensuring developers and AI application builders can effectively utilize this tool in their workflows.
Explore community contributions to MCP including clients, servers, and projects for seamless integration
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Python MCP client for testing servers avoid message limits and customize with API key
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Powerful GitLab MCP Server enables AI integration for project management, issues, files, and collaboration automation
SingleStore MCP Server for database querying schema description ER diagram generation SSL support and TypeScript safety