Sponsored by Deepsite.site

Brave Search

Created By
Brave5 months ago
An MCP server implementation that integrates the Brave Search API, providing comprehensive search capabilities including web search, local business search, image search, video search, news search, and AI-powered summarization. This project supports both HTTP and STDIO transports, with HTTP as the default mode.
Content

Brave Search MCP Server

An MCP server implementation that integrates the Brave Search API, providing comprehensive search capabilities including web search, local business search, image search, video search, news search, and AI-powered summarization. This project supports both HTTP and STDIO transports, with HTTP as the default mode.

Tools

Performs comprehensive web searches with rich result types and advanced filtering options.

Parameters:

  • query (string, required): Search terms (max 400 chars, 50 words)
  • country (string, optional): Country code (default: "US")
  • search_lang (string, optional): Search language (default: "en")
  • ui_lang (string, optional): UI language (default: "en-US")
  • count (number, optional): Results per page (1-20, default: 10)
  • offset (number, optional): Pagination offset (max 9, default: 0)
  • safesearch (string, optional): Content filtering ("off", "moderate", "strict", default: "moderate")
  • freshness (string, optional): Time filter ("pd", "pw", "pm", "py", or date range)
  • text_decorations (boolean, optional): Include highlighting markers (default: true)
  • spellcheck (boolean, optional): Enable spell checking (default: true)
  • result_filter (array, optional): Filter result types (default: ["web", "query"])
  • goggles (array, optional): Custom re-ranking definitions
  • units (string, optional): Measurement units ("metric" or "imperial")
  • extra_snippets (boolean, optional): Get additional excerpts (Pro plans only)
  • summary (boolean, optional): Enable summary key generation for AI summarization

Searches for local businesses and places with detailed information including ratings, hours, and AI-generated descriptions.

Parameters:

  • Same as brave_web_search with automatic location filtering
  • Automatically includes "web" and "locations" in result_filter

Note: Requires Pro plan for full local search capabilities. Falls back to web search otherwise.

Searches for videos with comprehensive metadata and thumbnail information.

Parameters:

  • query (string, required): Search terms (max 400 chars, 50 words)
  • country (string, optional): Country code (default: "US")
  • search_lang (string, optional): Search language (default: "en")
  • ui_lang (string, optional): UI language (default: "en-US")
  • count (number, optional): Results per page (1-50, default: 20)
  • offset (number, optional): Pagination offset (max 9, default: 0)
  • spellcheck (boolean, optional): Enable spell checking (default: true)
  • safesearch (string, optional): Content filtering ("off", "moderate", "strict", default: "moderate")
  • freshness (string, optional): Time filter ("pd", "pw", "pm", "py", or date range)

Searches for images with automatic fetching and base64 encoding for direct display.

Parameters:

  • query (string, required): Search terms (max 400 chars, 50 words)
  • country (string, optional): Country code (default: "US")
  • search_lang (string, optional): Search language (default: "en")
  • count (number, optional): Results per page (1-200, default: 50)
  • safesearch (string, optional): Content filtering ("off", "strict", default: "strict")
  • spellcheck (boolean, optional): Enable spell checking (default: true)

Searches for current news articles with freshness controls and breaking news indicators.

Parameters:

  • query (string, required): Search terms (max 400 chars, 50 words)
  • country (string, optional): Country code (default: "US")
  • search_lang (string, optional): Search language (default: "en")
  • ui_lang (string, optional): UI language (default: "en-US")
  • count (number, optional): Results per page (1-50, default: 20)
  • offset (number, optional): Pagination offset (max 9, default: 0)
  • spellcheck (boolean, optional): Enable spell checking (default: true)
  • safesearch (string, optional): Content filtering ("off", "moderate", "strict", default: "moderate")
  • freshness (string, optional): Time filter (default: "pd" for last 24 hours)
  • extra_snippets (boolean, optional): Get additional excerpts (Pro plans only)
  • goggles (array, optional): Custom re-ranking definitions

Summarizer Search (brave_summarizer)

Generates AI-powered summaries from web search results using Brave's summarization API.

Parameters:

  • key (string, required): Summary key from web search results (use summary: true in web search)
  • entity_info (boolean, optional): Include entity information (default: false)
  • inline_references (boolean, optional): Add source URL references (default: false)

Usage: First perform a web search with summary: true, then use the returned summary key with this tool.

Configuration

Getting an API Key

  1. Sign up for a Brave Search API account
  2. Choose a plan:
    • Free: 2,000 queries/month, basic web search
    • Pro: Enhanced features including local search, AI summaries, extra snippets
  3. Generate your API key from the developer dashboard

Environment Variables

The server supports the following environment variables:

  • BRAVE_API_KEY: Your Brave Search API key (required)
  • BRAVE_MCP_TRANSPORT: Transport mode ("http" or "stdio", default: "http")
  • BRAVE_MCP_PORT: HTTP server port (default: 8080)
  • BRAVE_MCP_HOST: HTTP server host (default: "0.0.0.0")

Command Line Options

node dist/index.js [options]

Options:
  --brave-api-key <string>    Brave API key
  --transport <stdio|http>    Transport type (default: http)
  --port <number>             HTTP server port (default: 8080)
  --host <string>             HTTP server host (default: 0.0.0.0)

Installation

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

Docker

{
  "mcpServers": {
    "brave-search": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "BRAVE_API_KEY", "mcp/brave-search"],
      "env": {
        "BRAVE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

NPX

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

Usage with VS Code

For quick installation, use the one-click installation buttons below:

Install with NPX in VS Code Install with NPX in VS Code Insiders
Install with Docker in VS Code Install with Docker in VS Code Insiders

For manual installation, add the following to your User Settings (JSON) or .vscode/mcp.json:

Docker

{
  "inputs": [
    {
      "password": true,
      "id": "brave-api-key",
      "type": "promptString",
      "description": "Brave Search API Key",
    }
  ],
  "servers": {
    "brave-search": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "BRAVE_API_KEY", "mcp/brave-search"],
      "env": {
        "BRAVE_API_KEY": "${input:brave-api-key}"
      }
    }
  }
}

NPX

{
  "inputs": [
    {
      "password": true,
      "id": "brave-api-key",
      "type": "promptString",
      "description": "Brave Search API Key",
    }
  ],
  "servers": {
    "brave-search-mcp-server": {
      "command": "npx",
      "args": ["-y", "@brave/brave-search-mcp-server"],
      "env": {
        "BRAVE_API_KEY": "${input:brave-api-key}"
      }
    }
  }
}

Build

Docker

docker build -t mcp/brave-search:latest .

Local Build

npm install
npm run build

Development

Prerequisites

  • Node.js 22.x or higher
  • npm
  • Brave Search API key

Setup

  1. Clone the repository:
git clone https://github.com/brave/brave-search-mcp-server.git
cd brave-search-mcp-server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Testing via Claude Desktop

Add a reference to your local build in claude_desktop_config.json:

{
  "mcpServers": {
    "brave-search-dev": {
      "command": "node",
      "args": ["C:\\GitHub\\brave-search-mcp-server\\dist\\index.js"], // Verify your path
      "env": {
        "BRAVE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Testing via MCP Inspector

  1. Build and start the server:
npm run build
node dist/index.js
  1. In another terminal, start the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.js

For STDIO mode testing, add --transport stdio to the arguments in the Inspector UI.

Available Scripts

  • npm run build: Build the TypeScript project
  • npm run watch: Watch for changes and rebuild
  • npm run format: Format code with Prettier
  • npm run format:check: Check code formatting
  • npm run prepare: Format and build (runs automatically on npm install)

Docker Compose

For local development with Docker:

docker-compose up --build

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Server Config

{
  "mcpServers": {
    "brave-search": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "BRAVE_API_KEY",
        "mcp/brave-search"
      ],
      "env": {
        "BRAVE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
Amap Maps高德地图官方 MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.