brave-mcp-server
Exposes a single MCP tool, web_search, for querying Brave Web Search and returning formatted plain-text results.
Search the web with query operators such as
site:,ext:,intitle:, exact phrases, and exclusions.Control result count and paginate using
countandoffset.Filter by freshness, country/region, and language.
Restrict results to specific types via
result_filter, such as web, news, discussions, FAQ, infobox, videos, locations, or query.Apply custom ranking rules with
goggles.Configure safe search, extra snippets, and text decoration/highlighting.
Returns grouped plain-text results with titles, links, age/source, and cleaned snippets.
Runs over stdio through an MCP client or
npx; requiresBRAVE_API_KEYorBRAVE_SEARCH_API_KEY.
Provides web search capabilities through the Brave Search API, including filters for freshness, country, language, safe search, result types, and pagination.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@brave-mcp-server search the web for recent developments in fusion energy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
brave-search-mcp
Brave Search API 的 MCP 服务器。把 Brave 的
Web Search 端点(GET /res/v1/web/search)暴露成单个 web_search 工具,供
Claude Code 等 MCP 客户端调用。npm 包名叫
@jujijigo/brave-search-mcp。
服务器用 stdio 传输,stdout 只写 JSON-RPC,日志走 stderr。由 npx 按需拉起,
不需要预先安装。
使用
配置
在 MCP 客户端的配置文件里加一条即可。Claude Code 写在 ~/.claude.json 顶层的
mcpServers 里:
{
"mcpServers": {
"brave-search": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@jujijigo/brave-search-mcp@latest"],
"env": {
"BRAVE_API_KEY": "你的订阅令牌"
}
}
}
}改完重启客户端生效。
Claude Code 也可以用命令写入同样一段配置:
claude mcp add brave-search --scope user \
-e BRAVE_API_KEY=你的订阅令牌 \
-- npx -y @jujijigo/brave-search-mcp@latest环境变量
变量 | 必填 | 说明 |
| 是 | Brave Search 订阅令牌,也可用 |
| 否 | 上游地址,默认 |
缺少 API key 时服务器会打印一行说明并以退出码 1 结束,而不是带着空 key 去请求。
工具:web_search
参数 | 类型 | 说明 |
| string(必填) | 查询词,支持 |
| integer | 返回条数,默认 10,范围 1–20 |
| integer | 翻页偏移,默认 0,范围 0–9(需配合相同的 |
| string |
|
| string | 2 位国家码( |
| string | 语言码。中文只接受 |
| string |
|
| string[] | 只取某类结果: |
| string | 自定义排序规则,可传 GitHub 托管的 goggle 地址或内联规则 |
| boolean | 每条结果额外返回最多 5 段摘录 |
| boolean | 摘要是否保留 |
响应会按 网页结果 / 新闻 / 论坛讨论 / 常见问题 / 视频 / 地点 / 知识卡片
分块渲染成纯文本:HTML 标签和实体被清洗掉,每条结果固定为
「标题 / 链接 / 时效·来源 / 摘要」的缩进格式。
未暴露的上游参数:ui_lang、units、spellcheck、operators、
enable_rich_callback、include_fetch_metadata——对检索结果影响很小,
或需要二次回调,为了让工具签名保持精简而略去。
Related MCP server: Search MCP
开发
代码结构
文件 | 职责 |
| 可执行入口,只负责启动 |
| JSON-RPC 分发与 stdio 生命周期 |
| 工具声明、参数校验与执行 |
| Brave API 客户端与错误整理 |
| 响应渲染成纯文本 |
本地运行
BRAVE_API_KEY=你的令牌 npm start手动跑一轮协议交互(stdin 每行一条 JSON-RPC 消息):
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"web_search","arguments":{"q":"hello"}}}' \
| BRAVE_API_KEY=你的令牌 node bin/brave-search-mcp.js让客户端跑本地源码
把配置里的 args 指向仓库目录即可:
"args": ["-y", "D:/workspace/brave-search-mcp"]注意别在仓库目录里执行这条 npx——npx 会优先解析当前目录的同名包,报
brave-search-mcp 不是内部或外部命令。从别的目录调用,或者直接用
node bin/brave-search-mcp.js。
License
Available Tools
1 toolweb_searchA
使用 Brave Search 检索互联网,返回标题、链接和摘要。适用于查询当前信息、新闻、文档或任何需要联网才能回答的问题。支持按时效(freshness)、地区(country)、语言(search_lang)过滤,用 result_filter 只取某一类结果,用 goggles 自定义排序。查询语法支持 site:、ext:、intitle:、"精确短语"、-排除词 等运算符。
Inputs: q (required), count, offset, country, +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion between overlapping operations. web_search has a clear, single responsibility.
web_search follows a clean snake_case verb_noun format, which is descriptive and conventional. Although there is no other tool to compare against, the naming is consistent with common MCP conventions.
A single tool is minimal, but for a Brave Search server the scope is appropriately narrow and the tool fully represents the server's purpose. It feels slightly thin compared to typical MCP servers, but it is not inappropriate.
The web_search tool exposes the main Brave Search capabilities including general web queries, freshness/country/language filters, result type filtering, and custom ranking. For a search-only server, there are no obvious missing operations.
Related MCP Connectors
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Web search API and MCP server for developers building AI agents.
Official Exa MCP for web search, content fetching, and multi-step research.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables web search and local business data retrieval through the Brave Search API. Provides tools for web search, local points of interest, and rich search results with customizable parameters.4-
- FlicenseBqualityDmaintenanceEnables web search capabilities through the Brave Search API, including web search, local POI lookups, and rich search results retrieval for MCP-compatible clients.4-
- AlicenseNot gradedqualityDmaintenanceExposes a standardized web search tool via Brave Search for MCP clients like Codex, Claude, and Cursor, returning stable JSON.MIT
- FlicenseNot gradedqualityDmaintenanceEnables web search via Brave Search API with freshness filters, full page content fetching, and usage tracking. Designed for Claude integration.-