Brave 搜索官方
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"brave-search": {
"args": [
"-y",
"@brave/brave-search-mcp-server"
],
"command": "npx"
}
}
}
该服务需要配置环境变量:BRAVE_API_KEY
可用工具 (6 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
brave_web_search 15 个参数 需填 1 项
Performs web searches using the Brave Search API and returns comprehensive search results with rich metadata. When to use: - General web searches for information, facts, or current topics - Location-based queries (restaurants, businesses, points of interest) - News searches for recent events or breaking stories - Finding videos, discussions, or FAQ content - Research requiring diverse result types (web pages, images, reviews, etc.) Returns a JSON list of web results with title, description, and URL. When the "results_filter" parameter is empty, JSON results may also contain FAQ, Discussions, News, and Video results.
必填参数:query
brave_local_search 15 个参数 需填 1 项
Brave Local Search API provides enrichments for location search results. Access to this API is available only through the Brave Search API Pro plans; confirm the user's plan before using this tool (if the user does not have a Pro plan, use the brave_web_search tool). Searches for local businesses and places using Brave's Local Search API. Best for queries related to physical locations, businesses, restaurants, services, etc. Returns detailed information including: - Business names and addresses - Ratings and review counts - Phone numbers and opening hours Use this when the query implies 'near me', 'in my area', or mentions specific locations (e.g., 'in San Francisco'). This tool automatically falls back to brave_web_search if no local results are found.
必填参数:query
brave_video_search 9 个参数 需填 1 项
Searches for videos using Brave's Video Search API and returns structured video results with metadata. When to use: - When you need to find videos related to a specific topic, keyword, or query. - Useful for discovering video content, getting video metadata, or finding videos from specific creators/publishers. Returns a JSON list of video-related results with title, url, description, duration, and thumbnail_url.
必填参数:query
brave_image_search 6 个参数 需填 1 项
Performs an image search using the Brave Search API. Helpful for when you need pictures of people, places, things, graphic design ideas, art inspiration, and more. When relaying results in a markdown environment, it may be helpful to include images in the results (e.g., ).
必填参数:query
brave_news_search 11 个参数 需填 1 项
This tool searches for news articles using Brave's News Search API based on the user's query. Use it when you need current news information, breaking news updates, or articles about specific topics, events, or entities. When to use: - Finding recent news articles on specific topics - Getting breaking news updates - Researching current events or trending stories - Gathering news sources and headlines for analysis Returns a JSON list of news-related results with title, url, and description. Some results may contain snippets of text from the article. When relaying results in markdown-supporting environments, always cite sources with hyperlinks. Examples: - "According to [Reuters](https://www.reuters.com/technology/china-bans/), China bans uncertified and recalled power banks on planes". - "The [New York Times](https://www.nytimes.com/2025/06/27/us/technology/ev-sales.html) reports that Tesla's EV sales have increased by 20%". - "According to [BBC News](https://www.bbc.com/news/world-europe-65910000), the UK government has announced a new policy to support renewable energy".
必填参数:query
brave_summarizer 3 个参数 需填 1 项
Retrieves AI-generated summaries of web search results using Brave's Summarizer API. This tool processes search results to create concise, coherent summaries of information gathered from multiple sources. When to use: - When you need a concise overview of complex topics from multiple sources - For quick fact-checking or getting key points without reading full articles - When providing users with summarized information that synthesizes various perspectives - For research tasks requiring distilled information from web searches Returns a text summary that consolidates information from the search results. Optional features include inline references to source URLs and additional entity information. Requirements: Must first perform a web search using brave_web_search with summary=true parameter. Requires a Pro AI subscription to access the summarizer functionality.
必填参数:key
服务介绍
概述
这是 Brave Search 的 MCP(Model Context Protocol)服务器实现,封装了 Brave Search API,提供统一的搜索能力(网页、图片、视频、本地商家、新闻)以及基于 Brave 的 AI 摘要接口。
支持两种传输模式:STDIO(默认)和 HTTP。
主要功能 / 工具
- brave_web_search:通用网页搜索,支持丰富结果类型、过滤、排序与摘要开关(可生成 summary key)。
- brave_local_search:本地商家/地点搜索,返回评分、营业时间、AI 描述等(完整版需 Pro)。
- brave_video_search:视频搜索,含元数据与缩略图信息。
- brave_image_search:图片搜索(2.x 版本不再返回 base64 数据,只返回与 Brave API 更一致的对象)。
- brave_news_search:新闻搜索,支持新鲜度控制与突发新闻标识。
- brave_summarizer:使用 web_search 返回的 summary key 生成 AI 摘要(需先在 web_search 中开启 summary: true)。
重要迁移说明(1.x → 2.x)
默认传输改为 STDIO(若要 HTTP,需设置 BRAVE_MCP_TRANSPORT=http 或运行时参数 --transport http)。
image 搜索不再返回 base64 编码图片(减少延迟与上下文占用)。
配置与运行
需 Brave Search API Key(在 Brave Search API 控制面板生成)。
主要环境变量:
- BRAVE_API_KEY(必需)
- BRAVE_MCP_TRANSPORT(stdio|http,默认 stdio)
- BRAVE_MCP_PORT(HTTP 模式端口,默认 8080)
- BRAVE_MCP_HOST(HTTP 模式 host,默认 0.0.0.0)
- BRAVE_MCP_LOG_LEVEL(日志级别,默认 info)
- BRAVE_MCP_ENABLED_TOOLS / BRAVE_MCP_DISABLED_TOOLS(白名单/黑名单)
命令行选项也支持上述配置(如 --transport、--port、--brave-api-key 等)。
使用与安装
可用方式:NPM/NPX、Docker、通过 Smithery 一键安装,或集成到 Claude Desktop / VS Code。
快速运行示例:
- NPX: npx -y @brave/brave-search-mcp-server
- Docker: docker run -i --rm -e BRAVE_API_KEY mcp/brave-search
支持与 MCP Inspector、Claude Desktop 的集成与本地开发调试。
开发与构建
要求 Node.js 22+,npm。
本地构建: npm install && npm run build
提供开发脚本(watch、format、inspector、smithery:dev 等)。
支持 Docker 镜像构建与 docker-compose 开发环境。
限制与参数示例
查询长度限制(最多 400 字符 / 50 单词)。
分页、数量限制:不同工具有各自 count/offset 范围(例如 web count 1–20,video count 1–50,image count 1–200)。
safesearch 可选: off / moderate / strict。
Pro 计划解锁的功能:本地搜索完整能力、额外摘录(extra_snippets)、AI 摘要等。