Brave Search MCP

Brave Search MCP

Brave Search MCP

Category
访问服务器

README

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

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

  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

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选