OmniscioGuidesBrave Search MCP server
Brave Search in Claude Code: adding the MCP server
MCP is the Model Context Protocol, the standard that lets Claude Code call an outside service's tools. Brave publishes a server over its Search API, which turns "look this up" into a tool call rather than a page fetch Claude has to scrape.
It is a small setup — one package, one key — and its errors point the wrong way: a missing key stops the server at startup, while a key that is present but wrong starts cleanly and fails only when a search runs.
Sources read November 25, 2026. By the Omniscio team. Updated .
Which Brave server
This is Brave's own server, published as @brave/brave-search-mcp-server and documented in the brave/brave-search-mcp-server repository.
It runs on your machine as a local process, and Claude Code talks to it over stdio — plain standard input and output, the transport MCP uses for local servers. Brave changed that default in version 2, so older examples and newer ones are not the same command; naming the transport is correct on either, which is why the command below carries --transport stdio.
What Claude Code can do with it
The server exposes one tool per kind of result rather than a single search:
brave_web_searchfor ordinary results, with filters for country, language, freshness, safe search, and up to 20 results per search.brave_news_searchfor current articles,brave_video_searchandbrave_image_searchfor media, andbrave_local_searchandbrave_place_searchfor businesses and places.brave_answers, which writes an answer from the search results instead of handing back links — citations are opt-in — andbrave_llm_context, which returns page content cut down to a set number of tokens.
One migration note is worth having before you read older examples. brave_summarizer is deprecated but still runs for existing Pro AI subscribers; its replacement, brave_answers, returns the answer in a single call instead of the summarizer's two — one to get a summary key, one to poll it.
The command
Brave's install block is a JSON snippet with the package, its arguments and the key in env. Expressed as a Claude Code command, and run in your terminal rather than inside a session, that is:
claude mcp add brave-search \
--env BRAVE_API_KEY=your-key \
-- npx -y @brave/brave-search-mcp-server --transport stdioThe name comes first, the environment flag next, and everything after the double dash is the server's own command line — Claude Code passes it to the process untouched instead of parsing it as its own options.
If you would rather not put the key in the environment, the server also accepts a file: set BRAVE_API_KEY_FILE to a path, and the server reads the key from there. Brave notes that this takes precedence over BRAVE_API_KEY, which makes it the option for a Docker secret or a key you rotate on disk.
The .mcp.json equivalent
This is Brave's own NPX block, unchanged apart from the placeholder:
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": ["-y", "@brave/brave-search-mcp-server", "--transport", "stdio"],
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}It is a local server, so the entry carries command and args rather than a url. The name inside it, brave-search, is also the name to use in the in-session /mcp panel and with claude mcp get, which prints that server's configuration.
A .mcp.json at the project root is project scope and gets committed, so a literal key in this file is a key in your history. Claude Code expands environment variables in that file, so the committed form can carry "BRAVE_API_KEY": "${BRAVE_API_KEY}" and read the real value from each person's environment.
Which scope to use
Local is the default: the entry lives in your own configuration and loads only in the project where you added it. --scope project writes .mcp.json at the repository root and shares it, and --scope user makes it available in every project.
Search is the one server in this series where user scope is usually the right answer: the tool has nothing to do with a particular repository, and you want it in every session you open rather than once per project.
The auth step
There is no OAuth flow. Brave's documented steps are to sign up for a Search API account, choose a plan, and generate a key from its developer dashboard.
The plan you choose decides which tools work: the Search plan covers the result tools, while local search's full capabilities need Pro, brave_answers needs an Answers plan, and extra_snippets is marked Pro only. A tool that runs but returns much less than you expect is usually a plan limit rather than a broken server.
If you would rather not put the key in the environment at all, BRAVE_API_KEY_FILE takes a path and the server reads the key from the file; Brave documents it for Docker secrets and mounted-secret setups.
Confirm it connected
claude mcp list
claude mcp get brave-searchThe list prints a health status beside each server, such as ✔ Connected, ! Needs authentication or ✘ Failed to connect. This server has no sign-in step, so a connected status means the process started — it says nothing about the key being accepted. A project-scope .mcp.json server reads ⏸ Pending approval until you approve it in an interactive session.
That is why the real check is a search. Ask for something with a stable answer you can repeat in a browser, and read the results rather than the status line. After that, a search is one more thing you can ask for by name.
The failure people hit
The common one is a key that is missing, empty or wrong, and the three behave differently. A missing or empty key stops the server at startup with an error naming the ways to supply one, so claude mcp list shows ✘ Failed to connect. A wrong key starts fine and then every search fails with the status Brave returned, typically 401 Unauthorized, which reaches Claude as a tool error.
The next is a tool that works but returns less than expected: local search falling back to web results without Pro, answers refusing without an Answers plan, extra snippets absent. Brave documents each of those limits next to the tool rather than in an error table.
The third is an older tutorial's summarizer flow. brave_summarizer still exists for existing Pro AI subscribers, but it needs a summary key from a first call and a second call to poll — a shape that looks broken next to the single-call answers tool.
The general messages are collected in the MCP errors guide, and the flags and scopes in Add an MCP server to Claude Code.
Sources
Every line on this page rests on one of these. The date beside each one is the day we read it.
- brave/brave-search-mcp-server README, for the package and its arguments, the stdio default, the NPX block, the environment variables, the API key steps and plan choice, the tool list and each tool's plan limits, the summarizer deprecation, and the answers migration. Read November 25, 2026.
- brave-search-mcp-server: src/config.ts, for the startup check that rejects a missing or empty key and the error it prints, and src/BraveAPI/index.ts for what a rejected request throws. Read November 25, 2026.
- Anthropic: Connect Claude Code to tools via MCP, for the command shape, the
--envpair rule, the double dash, the scope table, the health statuses and the pending-approval state. Read November 25, 2026.
Common questions
What is the command to add the Brave Search MCP server to Claude Code?
claude mcp add brave-search --env BRAVE_API_KEY=your-key -- npx -y @brave/brave-search-mcp-server --transport stdio. The package, the arguments and the variable are Brave's own.
Do I have to pay for the Brave Search API?
You need a plan to get a key, and which one decides which tools work: the Search plan covers the result tools, full local search needs Pro, Answers needs an Answers plan, and extra snippets are Pro only.
Why do my searches fail?
Usually the key. A missing or empty BRAVE_API_KEY stops the server at startup, which shows as a failed connection; a wrong key connects and then fails each search with the status Brave returned, such as 401 Unauthorized. Check the key against Brave's dashboard before suspecting the MCP setup.
Does it run locally or as a hosted server?
Locally. The package runs on your machine over stdio and calls Brave's API with your key, which is why the add command ends in a command rather than a URL.
Which tools does it add?
Web, local, place, video, image and news search, plus a grounded answers tool and an LLM context tool that returns page content trimmed to a token budget.
Every session, one window
Omniscio runs several agent sessions side by side in one window, each with its own context and its own diff view. Any model, any harness — Claude Code, Codex, OpenCode, Devin, Pi, and Hermes all supported.