An MCP server implementation that integrates the Brave Search API, providing comprehensive search capabilities including web search, local business search, place search, image search, video search, news search, LLM context, and AI-powered summarization. This project supports both STDIO and HTTP transports, with STDIO as the default mode.
Migration
1.x to 2.x
Default transport now STDIO
To follow established MCP conventions, the server now defaults to STDIO. If you would like to continue using HTTP, you will need to set the BRAVE_MCP_TRANSPORT environment variable to , or provide the runtime argument when launching the server.
http
--transport http
Response structure of brave_image_search
Version 1.x of the MCP server would return base64-encoded image data along with image URLs. This dramatically slowed down the response, as well as consumed unnecessarily context in the session. Version 2.x removes the base64-encoded data, and returns a response object that more closely reflects the original Brave Search API response. The updated output schema is defined in src/tools/images/schemas/output.ts.
Tools
Web Search (brave_web_search)
Performs comprehensive web searches with rich result types and advanced filtering options.
Usage: First perform a web search with summary: true, then use the returned summary key with this tool.
Place Search (brave_place_search)
Searches for points of interest (POIs) in a specified geographic area using Brave's Place Search API. Returns rich, structured place data including name, address, opening hours, contact info, ratings, photos, categories, and timezone.
Parameters:
query (string, optional): Query string used to refine the POI search (max 400 chars, 50 words). When omitted, returns general points of interest in the supplied area.
latitude (number, optional): Latitude of the search center (-90 to 90). Typically paired with longitude.
longitude (number, optional): Longitude of the search center (-180 to 180). Typically paired with latitude.
location (string, optional): Location string used as an alternative to latitude/longitude. For US locations prefer the form <city> <state> <country name> (e.g., san francisco ca united states); for non-US locations use <city> <country name> (e.g., tokyo japan).
radius (number, optional): Search radius around the supplied coordinates, in meters. If omitted, the search is performed globally.
count (number, optional): Number of results to return (1-50, default 20).
country (string, optional): Two-letter country code (default US).
search_lang (string, optional): Search language (default en).
ui_lang (string, optional): UI language (default en-US).
units (string, optional): Distance units (metric or imperial, default metric).
Search: The real-time search data your chatbots & agents need to generate answers. Complete search results (URLs, text, news, images, and more), with additional LLM context optimized for AI.
Answers: Summarized, completed answers to any question. Answers grounded on a single search or multiple searches for better accuracy & reduced hallucinations.
The server supports the following environment variables:
BRAVE_API_KEY: Your Brave Search API key (required unless BRAVE_API_KEY_FILE is set)
BRAVE_API_KEY_FILE: Path to a file containing your Brave Search API key. When set, this takes precedence over BRAVE_API_KEY. Useful for Docker secrets and similar mounted-secret setups.
BRAVE_MCP_TRANSPORT: Transport mode ("http" or "stdio", default: "stdio")
BRAVE_MCP_PORT: HTTP server port (default: 8080)
BRAVE_MCP_HOST: HTTP server host (default: "127.0.0.1"). Binds to loopback only by default; set to "0.0.0.0" to expose the server on all interfaces (required inside containers and on Amazon Bedrock AgentCore). Only do this on a trusted network, since the HTTP endpoint is unauthenticated.
BRAVE_MCP_ALLOWED_ORIGINS: Space- or comma-separated list of additional Origin header values permitted for the HTTP transport. Loopback origins are always allowed; browser requests carrying any other Origin are rejected with HTTP 403 to guard against DNS rebinding. Set this when a browser-based client on a real domain needs access.
BRAVE_MCP_ALLOWED_HOSTS: Space- or comma-separated list of hostnames permitted in the Host header of the HTTP transport. Matching is on the hostname only and is case-insensitive; a numeric port in an entry (e.g. mcp.example.com:8080) is accepted but ignored for matching. Optional, opt-in defense-in-depth: when unset (default) the Host header is not validated, so reverse-proxy and custom-domain deployments are unaffected. When set, only loopback hosts and the listed hostnames are accepted; any other Host (including malformed/non-numeric ports) is rejected with HTTP 403.
BRAVE_MCP_ENABLED_TOOLS: When used, specifies a space-separated whitelist for supported tools
BRAVE_MCP_DISABLED_TOOLS: When used, specifies a space-separated blacklist for supported tools
BRAVE_MCP_STATELESS: HTTP stateless mode (default: "false"). Must be "true" on Amazon Bedrock AgentCore, which sends its own Mcp-Session-Id with every request.
Command Line Options
node dist/index.js [options]
Options:
--brave-api-key <string> Brave API key
--brave-api-key-file <string> Path to file containing Brave API key
--transport <stdio|http> Transport type (default: stdio)
--port <number> HTTP server port (default: 8080)
--host <string> HTTP server host (default: 127.0.0.1)
--allowed-origins <origins...> Allowed Origin header values for HTTP transport (DNS rebinding protection)
--allowed-hosts <hosts...> Allowed Host header values for HTTP transport (opt-in DNS rebinding protection)
--logging-level <string> Desired logging level (one of _debug_, _info_, _notice_, _warning_, _error_, _critical_, _alert_, or _emergency_)
--enabled-tools Tools whitelist (only the specified tools will be enabled)
--disabled-tools Tools blacklist (included tools will be disabled)
--stateless <boolean> HTTP Stateless flag
STDIO — the Inspector launches the server itself, so one terminal is enough:
npm run build
npx @modelcontextprotocol/inspector node dist/index.js
HTTP — the Inspector connects to a URL, so the server must already be listening:
## terminal 1
npm run serve:http
## terminal 2
npm run inspector:http
serve:http builds, binds 127.0.0.1:8080, and reads BRAVE_API_KEY from .env.
Available Scripts
npm run build: Build the TypeScript project
npm run watch: Watch for changes and rebuild
npm test: Run the test suite
npm run test:docker: Build the Docker image and test it the way it is deployed: stdio (Docker MCP Catalog, Claude Desktop), HTTP (Docker Hub, compose, ECS), and Amazon Bedrock AgentCore. Requires Docker. To test an existing image instead, run node --import tsx --test src/docker.e2e.ts with BRAVE_MCP_TEST_IMAGE set.
npm run format: Format code with Prettier
npm run format:check: Check code formatting
npm run prepare: Format and build (runs automatically on npm install)
npm run serve:http: Build, then serve over HTTP at http://127.0.0.1:8080/mcp
npm run inspector: Launch an instance of MCP Inspector
npm run inspector:http: Launch MCP Inspector against http://127.0.0.1:8080/mcp
Docker Compose
For local development with Docker:
docker-compose up --build
Set BRAVE_API_KEY (or BRAVE_API_KEY_FILE) in your shell or a .env file before starting the stack. The default docker-compose.yml also accepts BRAVE_API_KEY_FILE when the path is valid inside the container (for example, from a bind mount or Docker secret).
Docker Compose secrets (optional)
To avoid putting the API key in an environment variable, you can use Docker Compose secrets. The server reads the key from the path in BRAVE_API_KEY_FILE, which must exist inside the container.
Start the stack with the optional secrets override:
docker compose -f docker-compose.yml -f docker-compose.secrets.example.yml up --build
The override mounts the secret at /run/secrets/brave_api_key and sets BRAVE_API_KEY_FILE accordingly. See docker-compose.secrets.example.yml for the full configuration.
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
At a glance
Category
Research
Pricing model
Free
Best for
ai-agents, mcp-server, search
What is Brave Search MCP Server? Brave Search MCP Server is a research tool listed on Scriptiii AI Tools. Official Brave MCP server for web, news, image and video search through the Brave Search API. Pricing: Free. Free to use. Best for: ai-agents, mcp-server, search.
Questions & answers
Everything you need to know about Brave Search MCP Server
What is Brave Search MCP Server?
Brave Search MCP Server is a research tool. Official Brave MCP server for web, news, image and video search through the Brave Search API.
What does Brave Search MCP Server cost?
Free. Free to use.
What is Brave Search MCP Server best for?
ai-agents, mcp-server, search. It is filed under Research.