Skip to content

Blog

Brave Search MCP setup: API key and first search

Set up Brave Search MCP with npx and stdio. JSON configuration, API key, a first search request and a practical source verification checklist.

Published on · by tracevero · Reading time 4 minutes (701 words)

You want to turn a question into useful web addresses. Start with a specific task, such as finding the official installation instructions for one project. Write down the expected publisher domain before searching. Your first test can then distinguish a working connection, a successful search response and a result that actually answers the question. Keep those three observations separate in your notes so a later retry remains comparable.

Identify the package and search provider

The provider project uses @brave/brave-search-mcp-server, the BRAVE_API_KEY variable and the brave_web_search tool. This example explicitly selects stdio. The local process communicates with the Brave Search API. Explore the Brave search and web data directory. Check each entry’s repository before substituting a similarly named package.

Three separate observations
StepExpected resultYour evidence
StartupTool list appearsClient log without credentials
SearchResponse contains sourcesQuery and result addresses
Source checkOriginal supports the claimURL, passage and retrieval time

Prepare the client configuration

Use this example as a starting point for a client that accepts the mcpServers JSON root. Replace the placeholder only in your local setup and preserve existing server definitions. The executable and its arguments occupy separate fields. VS Code uses a different root: follow the VS Code guide when adapting the configuration, rather than pasting the entire object into a different format.

{
  "mcpServers": {
    "brave-search": {
      "command": "npx",
      "args": [
        "-y",
        "@brave/brave-search-mcp-server",
        "--transport",
        "stdio"
      ],
      "env": {
        "BRAVE_API_KEY": "YOUR_BRAVE_API_KEY"
      }
    }
  }
}

Confirm that npx is available in the environment inherited by the client. Record the client version, operating system and the package version actually launched. This example does not pin a package version, so a later installation may resolve to a different release. After a successful test, record that release before handing the setup to somebody else. Keep credentials out of shared configuration files, screenshots and troubleshooting reports.

Run a bounded search test

Your research check 1. Question Set the scope 2. Search Select a source 3. Check Read the passage
Suggested workflow for your own test, not a measured provider comparison.
  1. Connect the server and inspect the tool list. Read the input schema for brave_web_search.

  2. Search for one specific public provider document. Keep the query unchanged for your first repeat attempt.

  3. Open a returned URL in your browser. Compare publisher, document title and the passage you wanted to find.

  4. Record discrepancies such as outdated instructions, an unrelated repository or a result missing the requested passage.

Result order does not establish factual correctness. For this first comparison, check whether a relevant original source is accessible and contains the information you need. Keep the search response separate from the passage you read. A snippet can help you find a document, but cannot replace checking it. To read an address you already know, continue with the Fetch guide.

Isolate startup failures and rejected requests

If no tool list appears, begin with the executable and the client log. The ENOENT guide covers that path. If the list appears but the search request fails, check the configured credential in your provider account and read the actual error. If the service limits the request, avoid rapid retries. Record the failure and check the allowance that applies to your account before trying again.

For a choice between retrieval methods, read the web search, Fetch and browser comparison. The Tavily guide offers another setup with its own test plan. A different result alone does not establish a general quality ranking. Keep the task, language and retrieval time with the comparison so somebody else can understand what changed.

Do I need an API key?
The local example uses your Brave API key. The placeholder is not a working credential.
Is this Google Search?
The example uses the Brave Search API. Verify the actual provider if your task requires a particular search index.
Has my setup been tested?
No. This guide describes a test for you to run. A registry entry documents source declarations and does not replace that test.
Why is the transport explicit?
The example connects the client to a local process over stdio. A different connection method requires its own configuration.

Provider sources checked on 1 October 2026. The test plans are editorial suggestions.

  1. Brave: MCP server and configuration
    Show retrieval commandcurl -s https://github.com/brave/brave-search-mcp-server

Put it into practice

All posts

tracevero · https://tracevero.com/blog/brave-search-mcp-setup