Brave Search MCP
Brave Search MCP Server integrates Brave Search API for web, image, video, news, and AI summarization. It supports STDIO and HTTP transports for comprehensive search capabilities.
How to Install and Use Brave Search MCP
Brave Search MCP is a server that connects to the Brave Search API, letting you perform different searches like web, video, image, news, and even AI summaries. This guide will walk you through how to install and use the Brave Search MCP server with simple steps and example code from the official documentation.
Getting an API Key
Before installing Brave Search MCP, you must get an API key from Brave. This is required for the server to work.
Here’s a quick way to do it:
- Go to the Brave Search API account page and sign up.
- Pick a plan:
- Free: 2,000 queries per month, basic web search.
- Pro: Extra features like local search and AI summaries.
- From the developer dashboard, create your API key.
Keep your API key ready as you will need it in the next steps.
Installing Brave Search MCP
You can install Brave Search MCP in different ways. Here are two simple methods using Docker or NPX. Both use your API key to connect.
Using Docker
If you have Docker installed, run this command in your terminal:
docker run -i --rm -e BRAVE_API_KEY="YOUR_API_KEY_HERE" docker.io/mcp/brave-search
Replace "YOUR_API_KEY_HERE" with your actual API key. This command runs the Brave Search MCP server inside a Docker container.
Using NPX
If you prefer Node.js without Docker, use NPX:
npx -y @brave/brave-search-mcp-server --transport http
Make sure to set your API key as an environment variable:
export BRAVE_API_KEY="YOUR_API_KEY_HERE" # For Linux/macOS
set BRAVE_API_KEY=YOUR_API_KEY_HERE # For Windows Command Prompt
This launches the server with HTTP transport.
Starting the Server Locally
For a manual setup, you can clone the source code, install dependencies, and build it yourself. This method is useful if you want to develop or customize Brave Search MCP.
Here’s how:
- Clone the repository:
git clone https://github.com/brave/brave-search-mcp-server.git
cd brave-search-mcp-server
- Install dependencies:
npm install
- Build the server:
npm run build
- Run the server (default STDIO transport):
node dist/index.js --brave-api-key YOUR_API_KEY_HERE
Using Brave Search MCP with Other Tools
Brave Search MCP supports several transports and tools. You can control how it runs by setting environment variables or command options.
For example, to change the transport mode to STDIO, run:
node dist/index.js --transport stdio --brave-api-key YOUR_API_KEY_HERE
Or export the environment variable before running:
export BRAVE_MCP_TRANSPORT=stdio
Conclusion
Installing Brave Search MCP is easy once you get your Brave Search API key. You can quickly start with Docker or NPX, or go deeper by building from the source. Use your API key in the environment or command, then run the server.
Here’s a quick recap command you might copy and use:
Using Docker:
docker run -i --rm -e BRAVE_API_KEY="YOUR_API_KEY_HERE" docker.io/mcp/brave-search
Using NPX:
export BRAVE_API_KEY="YOUR_API_KEY_HERE"
npx -y @brave/brave-search-mcp-server --transport http
This will get you up and running with Brave Search MCP for your search needs!