使用说明
Brave Search MCP服务器
A. 模型上下文协议 (MCP)服务器,使用 勇敢搜索API.从任何支持安全搜索、新鲜度过滤器和国家特定结果的MCP客户端搜索网络。
安装
安装时使用 篮子:
mpak install @nimblebraininc/brave-search
配置
从获取API密钥 勇敢搜索API,然后配置:
mpak config set @nimblebraininc/brave-search api_key YOUR_API_KEY
克劳德代码
claude mcp add brave-search -- mpak run @nimblebraininc/brave-search
克劳德桌面
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"brave-search": {
"command": "mpak",
"args": ["run", "@nimblebraininc/brave-search"]
}
}
}
看 mpak注册表页 获取完整安装选项。
工具
网络搜索
使用Brave Search搜索网络。返回包含标题、URL、描述和年龄的相关网页。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
query |
string |
是 | 搜索关键字或自然语言问题 |
count |
integer |
否 | 要返回的结果数,最多20个(默认值: 10) |
safesearch |
string |
否 | 筛选器级别: "off", "moderate", "strict" (默认值: "moderate") |
freshness |
string |
否 | 时间过滤器: "pd" (天), "pw" (周), "pm" (月), "py" (年) |
country |
string |
无 | 2个字母的国家代码(默认值: "us") |
示例调用:
{
"name": "web_search",
"arguments": {
"query": "Model Context Protocol",
"count": 5,
"freshness": "pw"
}
}
示例响应:
{
"query": "Model Context Protocol",
"results": [
{
"position": 1,
"title": "Model Context Protocol",
"url": "https://modelcontextprotocol.io",
"description": "The Model Context Protocol is an open standard...",
"age": "3 days ago"
}
],
"total_results": 5
}
快速开始
本地开发
git clone https://github.com/NimbleBrainInc/mcp-brave-search.git
cd mcp-brave-search
# Install dependencies
uv sync
# Set API key
cp .env.example .env
# Edit .env with your API key
# Run the server (stdio mode)
uv run python -m mcp_brave_search.server
服务器支持HTTP传输:
- 健康检查:
GET /health - MCP端点:
POST /mcp
发展
# Install with dev dependencies
uv sync --group dev
# Run all checks (format, lint, typecheck, unit tests)
make check
# Run unit tests
make test
# Run with coverage
make test-cov
关于
Brave Search MCP服务器发布于 mpak注册表 并由 敏捷大脑.mpak是一个开放的注册表 模型上下文协议 服务器。
许可证
麻省理工学院