AI Agent 4 min read

Set Up Brave Search MCP in Claude Desktop

Connect Brave Search to Claude Desktop over local stdio. Check your MCP configuration, verify one search in the app, and locate setup errors.

(Updated: ) • 622 words

Claude Desktop can launch Brave Search as a local MCP server. Add the server to claude_desktop_config.json, restart Claude Desktop, and check the tool call from a public search. A server can appear in the app before it has made a successful API request, so check startup and search separately.

Add Brave Search to Claude Desktop

Use a Brave Search API key from a Search subscription. Install Node.js with npx on the machine that runs Claude Desktop. In Claude Desktop, open Settings, choose Developer, then use Edit Config to open the file the app reads.

Add the brave-search entry under mcpServers. If that object already exists, keep its other entries and add Brave Search alongside them. Replace the placeholder on your machine and keep the configured file out of version control.

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

Save the file, quit Claude Desktop fully, and reopen it. The application starts the server as a child process and exchanges MCP messages with it over standard input and output.

Check the configuration before reopening the app

A syntax check is useful when you have added a server to an existing file. Save this checker as check-claude-config.cjs and run node check-claude-config.cjs "path/to/claude_desktop_config.json", using the path opened by Edit Config.

const fs = require("node:fs");

function fail(message) {
  console.error(message);
  process.exit(2);
}

const configPath = process.argv[2];
if (!configPath) fail("Pass the path to claude_desktop_config.json.");

let config;
try {
  config = JSON.parse(fs.readFileSync(configPath, "utf8"));
} catch {
  fail("Could not read the file or parse it as JSON.");
}

const server = config?.mcpServers?.["brave-search"];
const args = ["-y", "@brave/brave-search-mcp-server", "--transport", "stdio"];
if (server?.command !== "npx" || JSON.stringify(server.args) !== JSON.stringify(args)) {
  fail("The brave-search entry does not match this local stdio example.");
}

const key = server.env?.BRAVE_API_KEY;
if (typeof key !== "string" || !key.trim() || key.trim() === "REPLACE_WITH_BRAVE_SEARCH_API_KEY") {
  fail("Set BRAVE_API_KEY in the brave-search entry.");
}
console.log("Local configuration matches the example.");

The checker reads the file locally, verifies the server entry against this example, and checks that the key field has been filled in. It reports the result without printing the key. Use the next step to verify authorization against the API.

Verify one search in Claude Desktop

Look for the Brave search tool in Claude Desktop. In a new conversation, ask Claude to use the Brave tool to find the official Python documentation for the json module and show the source URL. Approve the tool call if the app prompts you.

Open the tool call and look for the actual search response. Check that it includes a source URL, open the result, and see whether the page answers the question. Use the URL shown by the tool call as the evidence for this test.

What you see Where to look next
Brave Search is missing from the tool list. Open Edit Config again and run the local checker on that file. Look for a startup error in Claude Desktop if the file parses, especially if the app cannot start npx.
The tool appears, but the search call returns an API error. Check the error in the tool call, then verify that the configured key belongs to the intended Search subscription.
The tool returns results, but the cited link does not support the answer. Open the result from the tool call. Check the page title and content, then narrow the query if the result is about a different library or version.

If you are calling Brave from your own application and need passages and source metadata, see the Brave LLM Context API walkthrough.

Tags:

AI Agent Tutorial Integration API Development RAG LLM
SearchCans Team

SearchCans Team

SERP API & Reader API Experts

The SearchCans engineering team builds high-performance search APIs serving developers worldwide. We share practical tutorials, best practices, and insights on SERP data, web scraping, RAG pipelines, and AI integration.

Ready to build with SearchCans?

Test SERP API and Reader API with 100 free credits. No credit card required.