Brave Search MCP: Web Search for Your Agent
Brave maintains its own MCP server for the Brave Search API, with tools for web, local, image, video and news search, a summarizer and LLM context. What each tool does, where the API key goes, how to set it up in Claude Code, Claude Desktop and VS Code, and when Brave, Perplexity or Firecrawl is the better fit.
6 min read
Brave Search MCP is the MCP server Brave publishes for its Search API. It gives an AI agent tools to search the web, news, images, videos and local businesses from Brave’s own index, plus a summarizer and a tool that returns pre-extracted page content for grounding. You run it yourself: the npm package @brave/brave-search-mcp-server starts over stdio by default, or as a local HTTP server, and it needs a Brave Search API key in an environment variable. It returns search results, not finished answers, which makes it a plain, predictable web search tool for an agent that will read and decide for itself.
Which server is the official one
Older guides point to @modelcontextprotocol/server-brave-search, one of the early reference servers. That code now sits in the MCP project’s archived servers repository (opens in a new tab), and the npm package is marked deprecated. The maintained server is Brave’s own brave-search-mcp-server (opens in a new tab), MIT-licensed, published as @brave/brave-search-mcp-server and as the Docker image mcp/brave-search. If a config file you inherited still names the old package, replace it.
Version 2 changed two things that break older setups. The default transport is now stdio, so a setup that relied on HTTP must pass --transport http or set BRAVE_MCP_TRANSPORT=http. And image search no longer returns base64 image data, only URLs and metadata, which the README says had slowed responses and filled the context.
The tools, as documented today
brave_web_search: the general search. Options include country, language, result count (up to 20), safe search, a freshness window, Goggles for custom re-ranking, andsummary: trueto request a summary key.brave_local_search: businesses and places with ratings, hours and descriptions. The README says full local results need a Pro plan and that the tool falls back to web search otherwise.brave_place_search: points of interest around a location or a pair of coordinates, with address, hours, contact details and categories.brave_image_search,brave_video_searchandbrave_news_search: media and news, with news defaulting to the last 24 hours.brave_summarizer: an AI summary of a web search. It works in two steps: a web search withsummary: truereturns a key, and this tool turns the key into the summary, optionally with inline source references.brave_llm_context: pre-extracted, relevance-ranked content from matching pages, such as text chunks, tables and code, with limits on tokens, URLs and snippets. It is the tool for “read what the pages say”, not just “find the pages”.
Eight tools is a fair amount of context for a model to read on every turn. Set BRAVE_MCP_ENABLED_TOOLS to a space-separated list, such as brave_web_search brave_news_search, to offer only what the job needs, or BRAVE_MCP_DISABLED_TOOLS to drop a few. MCP token usage covers why a shorter tool list helps.
Prompts that fit the tools
- Current facts: “Search the news from the past week for the release notes of our database driver and list any breaking changes, with links.” That uses
brave_news_searchwith its default freshness. - Grounding before an answer: “Use LLM context for ‘NIST secure software development framework’ and summarize the practices it lists, citing each page.” The agent reads extracts instead of guessing from titles.
- Local work: “Find three print shops open on Saturday near Austin, Texas, with their hours.” That is
brave_place_search, or local search on a plan that includes it.
Name the tool in the prompt when the choice matters. Otherwise the model picks from the tool descriptions on its own.
The API key
Sign up for the Brave Search API (opens in a new tab), choose a plan and create a key in the developer dashboard. The README names two plan families: Search, for raw results and LLM context, and Answers, for summarized answers. The server reads the key from BRAVE_API_KEY, or from a file named in BRAVE_API_KEY_FILE, which takes precedence and suits Docker secrets and other mounted-secret setups.
- Keep the key in the client’s environment settings, never in a file you commit or in the chat with the agent.
- Give automated jobs their own key, so you can see what each one uses and revoke one without touching the rest.
- In VS Code, use an input prompt so the key is asked for once and stored by the editor rather than written into
mcp.json.
Setup
In Claude Code, add the npm package as a local stdio server. The command shape follows Claude Code’s MCP documentation (opens in a new tab); the single quotes keep the key itself out of the saved configuration.
export BRAVE_API_KEY="your_key_here"
claude mcp add brave-search --env 'BRAVE_API_KEY=${BRAVE_API_KEY}' \
-- npx -y @brave/brave-search-mcp-serverFor Claude Desktop, Cursor and most other clients, the same package goes in the mcpServers block of the client’s config file. Claude Desktop starts local servers over stdio, which is the default, so no transport flag is needed.
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": ["-y", "@brave/brave-search-mcp-server"],
"env": { "BRAVE_API_KEY": "YOUR_API_KEY_HERE" }
}
}
}VS Code uses a servers block with an inputs entry that prompts for the key; the README has one-click install buttons for both the npm and Docker versions, and the VS Code mcp.json guide explains where the file lives. Brave’s README documents running the server yourself; it does not list a hosted endpoint.
Running it over HTTP
With --transport http the server listens at http://127.0.0.1:8080/mcp. It binds to loopback by default, and the README warns that the HTTP endpoint has no authentication, so setting the host to 0.0.0.0 belongs only on a trusted network. It rejects browser requests from unknown origins to guard against DNS rebinding; BRAVE_MCP_ALLOWED_ORIGINS and BRAVE_MCP_ALLOWED_HOSTS widen that when you need to. If a whole team needs the server, put it behind your own sign-in first; remote vs local MCP servers covers the trade-offs.
Brave, Perplexity or Firecrawl?
All three put the web in front of an agent, but each hands back something different:
- Brave Search MCP returns search results from Brave’s independent index: links, snippets, news, images and places, plus page extracts through LLM context. Choose it when the agent should find sources and read them itself, and when you want ordinary search filters such as country, freshness and safe search.
- Perplexity MCP returns answers: a cited response, a step-by-step analysis or a long research report, with a plain search tool beside them. Choose it when you want the synthesis done for you and will check the citations.
- Firecrawl MCP returns whole pages and sites as clean Markdown or JSON: scrape, map and crawl. Choose it when you already know the URLs, or need a site’s full content rather than a list of results.
They combine well. A common pattern is Brave to find the right pages and Firecrawl to read them in full. Whichever you use, every result is text someone else wrote and it lands in your model’s context, so the precautions in indirect prompt injection apply to all three.
Keeping search results useful
Search helps an agent most when it feeds work someone tracks. A prompt like “search the news from the past week for security advisories about the libraries in package.json, and list each with its link” produces findings; with fenbs connected as a second MCP server at https://fenbs.ai/api/mcp, the agent can search the board first and file each new one as a bug in To Do, with the link in the note and a priority from 1 to 10. History records the change under the assistant’s name. If a person decides the agent may search but never publish anything it finds, record that as a rule on the Decisions and rules page, which every connected assistant reads first. fenbs does not search the web itself; that stays with Brave.
Related
Answers instead of results: Perplexity MCP. Whole pages and crawls: Firecrawl MCP. The checklist before adding any server: MCP security best practices. Connecting fenbs: the MCP docs.