šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
DemoInstallSign in
Socket

brave-search-mcp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brave-search-mcp

MCP Server that uses Brave Search API to search for images, general web search, video, news and points of interest.

0.6.2
latest
Source
npm
Version published
Weekly downloads
166
93.02%
Maintainers
1
Weekly downloads
Ā 
Created
Source

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)
  • 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)
  • 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)

Configuration

Getting an API Key

Usage with Claude Desktop

Docker

  • Clone the repo
  • Docker build
docker build -t brave-search-mcp:latest -f ./Dockerfile .
  • 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

  • Clone the repo

  • Install Dependencies and build it

npm install
  • 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:

  • Locate and select the run debug.
  • Select the configuration labeled "MCP Server Launcher" in the dropdown.
  • 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:

  • 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"
    }
    
  • 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"]
    }
  ]
}
  • 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.

Keywords

brave

FAQs

Package last updated on 22 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts