Sponsored by Deepsite.site

Brave Search MCP Server

Created By
mikechao8 months ago
An MCP Server implementation that integrates the Brave Search API, providing, Web Search, Local Points of Interest Search, Image Search, Video Search and News Search capabilities
Content

Brave Search MCP Server

An MCP Server implementation that integrates the Brave Search API, providing, Web Search, Local Points of Interest Search, Video Search, Image Search and News Search capabilities

Brave Search MCP server

Features

  • Web Search: Perform a regular search on the web
  • Image Search: Search the web for images. Image search results will be available as a Resource
  • News Search: Search the web for news
  • Video Search: Search the web for videos
  • Local Points of Interest Search: Search for local physical locations, businesses, restaurants, services, etc

Tools

  • brave_web_search

    • Execute web searches using Brave's API
    • Inputs:
      • query (string): The term to search the internet for
      • count (number, optional): The number of results to return (max 20, default 10)
      • offset (number, optional, default 0): The offset for pagination
      • freshness (enum, optional): Filters search results by when they were discovered
        • The following values are supported
          • pd: Discovered within the last 24 hours.
          • pw: Discovered within the last 7 Days.
          • pm: Discovered within the last 31 Days.
          • py: Discovered within the last 365 Days
  • brave_image_search

    • Get images from the web relevant to the query
    • Inputs:
      • query (string): The term to search the internet for images of
      • count (number, optional): The number of images to return (max 3, default 1)
  • brave_news_search

    • Searches the web for news
    • Inputs:
      • query (string): The term to search the internet for news articles, trending topics, or recent events
      • count (number, optional): The number of results to return (max 20, default 10)
      • freshness (enum, optional): Filters search results by when they were discovered
        • The following values are supported
          • pd: Discovered within the last 24 hours.
          • pw: Discovered within the last 7 Days.
          • pm: Discovered within the last 31 Days.
          • py: Discovered within the last 365 Days
  • brave_local_search

    • Search for local businesses, services and points of interest
    • REQUIRES subscription to the Pro api plan for location results
    • Falls back to brave_web_search if no location results are found
    • Inputs:
      • query (string): Local search term
      • count (number, optional): The number of results to return (max 20, default 5)
  • brave_video_search

    • Search the web for videos
    • Inputs:
      • query: (string): The term to search for videos
      • count: (number, optional): The number of videos to return (max 20, default 10)
      • freshness (enum, optional): Filters search results by when they were discovered
        • The following values are supported
          • pd: Discovered within the last 24 hours.
          • pw: Discovered within the last 7 Days.
          • pm: Discovered within the last 31 Days.
          • py: Discovered within the last 365 Days

Configuration

Getting an API Key

  1. Sign up for a Brave Search API account
  2. Choose a plan (Free tier available with 2,000 queries/month)
  3. Generate your API key from the developer dashboard

Usage with Claude Desktop

Docker

  1. Clone the repo
  2. Docker build
docker build -t brave-search-mcp:latest -f ./Dockerfile .
  1. Add this to your claude_desktop_config.json:
{
  "mcp-servers": {
    "brave-search": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "BRAVE_API_KEY",
        "brave-search-mcp"
      ],
      "env": {
        "BRAVE_API_KEY": "YOUR API KEY HERE"
      }
    }
  }
}

NPX

Add this to your claude_desktop_config.json:

{
  "mcp-servers": {
    "brave-search": {
      "command": "npx",
      "args": [
        "-y",
        "brave-search-mcp"
      ],
      "env": {
        "BRAVE_API_KEY": "YOUR API KEY HERE"
      }
    }
  }
}

Usage with LibreChat

Add this to librechat.yaml

brave-search:
  command: sh
  args:
    - -c
    - BRAVE_API_KEY=API KEY npx -y brave-search-mcp

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Debugging

  1. Clone the repo

  2. Install Dependencies and build it

npm install
  1. Build the app
npm run build

Use the VS Code Run and Debug Function

⚠ Does not seem to work on Windows 10/11, but works in WSL2

Use the VS Code Run and Debug launcher with fully functional breakpoints in the code:

  1. Locate and select the run debug.
  2. Select the configuration labeled "MCP Server Launcher" in the dropdown.
  3. Select the run/debug button. We can debug the various tools using MCP Inspector and VS Code.

VS Code Debug setup

To set up local debugging with breakpoints:

  1. Store Brave API Key in the VS Code

    • Open the Command Palette (Cmd/Ctrl + Shift + P).
    • Type Preferences: Open User Settings (JSON).
    • Add the following snippet:
    {
      "brave.search.api.key": "your-api-key-here"
    }
    
  2. Create or update .vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "MCP Server Launcher",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}/node_modules/@modelcontextprotocol/inspector/cli/build/cli.js",
      "outFiles": ["${workspaceFolder}/dist/**/*.js"],
      "env": {
        "BRAVE_API_KEY": "${config:brave.search.api.key}",
        "DEBUG": "true"
      },
      "args": ["dist/index.js"],
      "sourceMaps": true,
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "preLaunchTask": "npm: build:watch"
    },
    {
      "type": "node",
      "request": "attach",
      "name": "Attach to Debug Hook Process",
      "port": 9332,
      "skipFiles": ["<node_internals>/**"],
      "sourceMaps": true,
      "outFiles": ["${workspaceFolder}/dist/**/*.js"]
    },
    {
      "type": "node",
      "request": "attach",
      "name": "Attach to REPL Process",
      "port": 9333,
      "skipFiles": ["<node_internals>/**"],
      "sourceMaps": true,
      "outFiles": ["${workspaceFolder}/dist/**/*.js"]
    }
  ],
  "compounds": [
    {
      "name": "Attach to MCP Server",
      "configurations": ["Attach to Debug Hook Process", "Attach to REPL Process"]
    }
  ]
}
  1. Create .vscode/tasks.json:
{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "npm",
      "script": "build:watch",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": ["$tsc"]
    }
  ]
}

Disclaimer

This library is not officially associated with Brave Software. It is a third-party implementation of the Brave Search API with a MCP Server.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

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.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
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.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
Serper MCP ServerA Serper MCP Server
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
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"
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
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.
Amap Maps高德地图官方 MCP Server