
Brave搜索
STDIO勇者搜索API集成多种搜索功能
勇者搜索API集成多种搜索功能
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_web_search
query
(string): The term to search the internet forcount
(number, optional): The number of results to return (max 20, default 10)offset
(number, optional, default 0): The offset for paginationfreshness
(enum, optional): Filters search results by when they were discovered
brave_image_search
query
(string): The term to search the internet for images ofcount
(number, optional): The number of images to return (max 3, default 1)brave_news_search
query
(string): The term to search the internet for news articles, trending topics, or recent eventscount
(number, optional): The number of results to return (max 20, default 10)freshness
(enum, optional): Filters search results by when they were discovered
brave_local_search
query
(string): Local search termcount
(number, optional): The number of results to return (max 20, default 5)brave_video_search
query
: (string): The term to search for videoscount
: (number, optional): The number of videos to return (max 20, default 10)freshness
(enum, optional): Filters search results by when they were discovered
docker build -t brave-search-mcp:latest -f ./Dockerfile .
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" } } } }
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" } } } }
Add this to librechat.yaml
brave-search: command: sh args: - -c - BRAVE_API_KEY=API KEY npx -y brave-search-mcp
Contributions are welcome! Please feel free to submit a Pull Request.
Clone the repo
Install Dependencies and build it
npm install
npm run build
⚠ 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:
MCP Server Launcher
" in the dropdown.To set up local debugging with breakpoints:
Store Brave API Key in the VS Code
Preferences: Open User Settings (JSON)
.{ "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"] } ] }
.vscode/tasks.json
:{ "version": "2.0.0", "tasks": [ { "type": "npm", "script": "build:watch", "group": { "kind": "build", "isDefault": true }, "problemMatcher": ["$tsc"] } ] }
This library is not officially associated with Brave Software. It is a third-party implementation of the Brave Search API with a MCP Server.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.