korchasa/brave-search-mcp
If you are the rightful owner of brave-search-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This is an MCP server for integrating with the Brave Search API, offering web and location search capabilities.
Brave Search MCP Server
MCP server for integration with the Brave Search API, providing web search and location search.
The project is based on @modelcontextprotocol/server-brave-search. Compared to the original, the following features have been added:
- More complete description of tool arguments
- Environment variables for geolocation configuration via
X-Loc-*
headers - Search parameters
freshness
,search_lang
Installation
npm install
npm run build
Configuration
Required Environment Variables
BRAVE_API_KEY
- API key for Brave Search API (can be obtained here)
Optional Environment Variables for Geolocation
To improve search results, you can configure location information using the following environment variables:
BRAVE_LOC_LAT
- Latitude in degrees (from -90.0 to +90.0)BRAVE_LOC_LONG
- Longitude in degrees (from -180.0 to +180.0)BRAVE_LOC_TIMEZONE
- Time zone in IANA format (e.g.,America/New_York
)BRAVE_LOC_CITY
- City nameBRAVE_LOC_STATE
- State/region code (up to 3 characters, according to ISO 3166-2)BRAVE_LOC_STATE_NAME
- State/region nameBRAVE_LOC_COUNTRY
- Two-letter country code (according to ISO 3166-1 alpha-2)BRAVE_LOC_POSTAL_CODE
- Postal code
Configuration Example
export BRAVE_API_KEY="your-api-key-here"
export BRAVE_LOC_LAT="40.7128"
export BRAVE_LOC_LONG="-74.0060"
export BRAVE_LOC_TIMEZONE="America/New_York"
export BRAVE_LOC_CITY="New York"
export BRAVE_LOC_STATE="NY"
export BRAVE_LOC_STATE_NAME="New York"
export BRAVE_LOC_COUNTRY="US"
export BRAVE_LOC_POSTAL_CODE="10001"
Usage
npm start
Available Tools
brave_web_search
Performs web search using Brave Search API.
Parameters:
query
(required) - Search query (maximum 400 characters, 50 words)count
(optional) - Number of results (1-20, default 10)offset
(optional) - Offset for pagination (maximum 9, default 0)search_lang
(optional) - Search language in two-letter code format (e.g., 'en')freshness
(optional) - Time filter by discovery ('pd', 'pw', 'pm', 'py' or 'YYYY-MM-DDtoYYYY-MM-DD')
brave_local_search
Searches for local businesses and places using Local Search API.
Parameters:
query
(required) - Local search query (e.g., 'pizza near Central Park')count
(optional) - Number of results (1-20, default 5)
Geolocation Information
X-Loc-*
headers are automatically added to all requests to Brave Search API based on configured environment variables. This helps to:
- Improve search result relevance
- Provide more accurate local results
- Get region-specific results
According to Brave Search API documentation, sending more information in headers improves the quality of search results.