@vjlanguage/server-brave-search
v0.6.8
Published
MCP server for Brave Search API integration, and support both HTTP and SOCKS proxy
Readme
Brave Search MCP Server
An MCP server implementation that integrates the Brave Search API, providing both web and local search capabilities, and support both HTTP and SOCKS proxy.
Features
- Web Search: General queries, news, articles, with pagination and freshness controls
- Local Search: Find businesses, restaurants, and services with detailed information
- Flexible Filtering: Control result types, safety levels, and content freshness
- Smart Fallbacks: Local search automatically falls back to web when no results are found
- Rate Limiting: Built-in rate limiting (1 request/second, 15,000 requests/month)
Tools
brave_web_search
- Execute web searches with pagination and filtering
- Inputs:
query(string): Search terms (max 400 characters, 50 words)count(number, optional): Results per page (1-20, default 10)offset(number, optional): Pagination offset (0-9, default 0)
brave_local_search
- Search for local businesses and services
- Inputs:
query(string): Local search termscount(number, optional): Number of results (1-20, default 5)
- Returns detailed information including:
- Business name and address
- Ratings and review count
- Phone number and opening hours
- Price range and description
- Automatically falls back to web search if no local results found
Configuration
Getting an API Key
- Sign up for a Brave Search API account
- Choose a plan (Free tier available with 2,000 queries/month)
- Generate your API key from the developer dashboard
Environment Variables
Required
BRAVE_API_KEY: Your Brave Search API keyexport BRAVE_API_KEY="your-api-key-here"
Optional
BRAVE_PROXY_URL: Proxy server URL for API requests# HTTP proxy export BRAVE_PROXY_URL="http://username:password@proxy-host:port" # HTTPS proxy export BRAVE_PROXY_URL="https://username:password@proxy-host:port" # SOCKS proxy export BRAVE_PROXY_URL="socks://username:password@proxy-host:port" # SOCKS5 proxy export BRAVE_PROXY_URL="socks5://username:password@proxy-host:port"
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
Docker
{
"mcpServers": {
"brave-search": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"BRAVE_API_KEY",
"-e",
"BRAVE_PROXY_URL",
"mcp/brave-search"
],
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE",
"BRAVE_PROXY_URL": "YOUR_PROXY_URL_HERE"
}
}
}
}NPX
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": [
"-y",
"@vjlanguage/server-brave-search"
],
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE",
"BRAVE_PROXY_URL": "YOUR_PROXY_URL_HERE"
}
}
}
}Build
Docker build:
docker build -t mcp/brave-search:latest -f src/brave-search/Dockerfile .License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Brave Search MCP 服务器
这是一个集成了 Brave Search API 的 MCP 服务器实现,提供网页搜索和本地搜索功能,并支持 HTTP 和 SOCKS 代理。
功能特点
- 网页搜索:支持通用查询、新闻、文章,具有分页和内容新鲜度控制功能
- 本地搜索:查找商家、餐厅和服务,提供详细信息
- 灵活过滤:控制结果类型、安全级别和内容新鲜度
- 智能回退:当本地搜索无结果时自动切换到网页搜索
- 速率限制:内置速率限制(每秒1次请求,每月15,000次请求)
工具
brave_web_search
- 执行网页搜索,支持分页和过滤
- 输入参数:
query(字符串):搜索关键词(最多400个字符,50个单词)count(数字,可选):每页结果数量(1-20,默认10)offset(数字,可选):分页偏移量(0-9,默认0)
brave_local_search
- 搜索本地商家和服务
- 输入参数:
query(字符串):本地搜索关键词count(数字,可选):结果数量(1-20,默认5)
- 返回详细信息包括:
- 商家名称和地址
- 评分和评论数量
- 电话号码和营业时间
- 价格区间和描述
- 无结果时自动切换到网页搜索
配置
获取 API 密钥
- 注册 Brave Search API 账号
- 选择套餐(免费版每月可使用2,000次查询)
- 在开发者控制台生成 API 密钥
环境变量
必需
BRAVE_API_KEY:您的 Brave Search API 密钥export BRAVE_API_KEY="your-api-key-here"
可选
BRAVE_PROXY_URL:API 请求的代理服务器 URL# HTTP 代理 export BRAVE_PROXY_URL="http://username:password@proxy-host:port" # HTTPS 代理 export BRAVE_PROXY_URL="https://username:password@proxy-host:port" # SOCKS 代理 export BRAVE_PROXY_URL="socks://username:password@proxy-host:port" # SOCKS5 代理 export BRAVE_PROXY_URL="socks5://username:password@proxy-host:port"
Claude Desktop 使用配置
将以下内容添加到您的 claude_desktop_config.json 中:
Docker
{
"mcpServers": {
"brave-search": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"BRAVE_API_KEY",
"-e",
"BRAVE_PROXY_URL",
"mcp/brave-search"
],
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE",
"BRAVE_PROXY_URL": "YOUR_PROXY_URL_HERE"
}
}
}
}NPX
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": [
"-y",
"@vjlanguage/server-brave-search"
],
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE",
"BRAVE_PROXY_URL": "YOUR_PROXY_URL_HERE"
}
}
}
}构建
Docker 构建命令:
docker build -t mcp/brave-search:latest -f src/brave-search/Dockerfile .许可证
本 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发本软件,但需遵守 MIT 许可证的条款和条件。详细信息请参阅项目仓库中的 LICENSE 文件。
