# Brave Search MCP Server > **Brave Search MCP Server** is a hosted, multitenant Model Context Protocol (MCP) server run by **MewCP** (https://mewcp.com), giving AI agents managed access to Brave Search. > > MewCP takes care of all MCP infrastructure for you — credential storage, OAuth flows, > token refresh, and production-grade auto-scaling — so your AI agents can connect to > third-party services and run freely without you managing any MCP server yourself. > > To connect your agent to this server you need a MewCP account and two values: > - MEWCP_KEY — your personal API key (dashboard → Developer) > - CREDENTIAL_ID — the stored credential MewCP securely injects per request > > Server page: https://mewcp.com/mcp/brave-search > MewCP docs: https://docs.mewcp.com > Full catalog: https://mewcp.com/llms.txt ## About Search the web, images, videos, news, and local places through Brave's independent index. Get comprehensive web search with FAQ/Discussion/News/Video results, local business and POI lookup, dedicated media and news endpoints, AI-generated summarization, and pre-extracted, relevance-ranked page content for RAG grounding. ## How to connect Server Page URL: https://mewcp.com/mcp/brave-search Gateway URL: https://gateway.mewcp.com/brave-search/mcp Every request to this server requires two headers: Authorization: Bearer — your MewCP API key (dashboard → Developer) x-mewcp-credential-id: — the stored credential ID for this service All connection snippets and ready-to-use code examples are available on the server page and in this document below. --- ## Server documentation **Search the web, images, videos, news, and local places through Brave's independent index — plus AI summarization and RAG-ready context extraction.** A Model Context Protocol (MCP) server that exposes the Brave Search API's search endpoints for web, local, video, image, news, and place search, along with AI summarization and LLM-context extraction. ## Overview The Brave Search MCP Server provides: - Comprehensive web search with rich metadata — results can include FAQ, Discussions, News, and Video items alongside standard web results - Local business and points-of-interest (POI) search with ratings, addresses, phone numbers, hours, and AI descriptions, with a graceful fallback to web results when enriched local data isn't available - Dedicated video, image, and news search endpoints - A structured place-search endpoint for POI data anchored to a location or lat/long coordinates - AI-generated summarization of web search results via Brave's Summarizer API - Pre-extracted, relevance-ranked web content via Brave's LLM Context API — actual page substance (text chunks, tables, code blocks) rather than just links and snippets Perfect for: - AI agents that need general-purpose web search grounded in an independent search index - Local business lookup and "near me" style assistants - News monitoring and current-events tools - Media search integrations (images, videos) - RAG pipelines that need pre-extracted, relevance-ranked web content for grounding - Quickly summarizing a set of search results into an AI-generated answer ## Tools
search_web — General-purpose web search with rich metadata Performs web searches using the Brave Search API and returns comprehensive search results with rich metadata. When to use: - General web searches for information, facts, or current topics - Location-based queries (restaurants, businesses, points of interest) - News searches for recent events or breaking stories - Finding videos, discussions, or FAQ content Returns a JSON list of web results with title, description, and URL. When result_filter is empty, results may also contain FAQ, Discussions, News, and Video items. **Inputs:** ``` - `query` (string, required) — Search query (max 400 chars, 50 words) - `country` (CountryCode, optional, default: "US") — Country for results - `search_lang` (SearchLang, optional, default: "en") — Search language - `ui_lang` (UiLang, optional, default: "en-US") — UI language - `count` (int, optional, default: 10) — Number of web results (1–20) - `offset` (int, optional, default: 0) — Pagination offset (0–9) - `safesearch` (SafeSearch, optional, default: "moderate") — Safe-search level - `freshness` (string, optional) — Time filter: pd (day) pw (week) pm (month) py (year) or YYYY-MM-DDtoYYYY-MM-DD - `text_decorations` (bool, optional, default: true) — Include decoration markers in snippets - `spellcheck` (bool, optional, default: true) — Spellcheck the query - `result_filter` (list of ResultFilter, optional) — Subset of result types to return (default ['web','query']) - `goggles` (list of string, optional) — Goggle HTTPS URLs for custom re-ranking - `units` (Units, optional) — Measurement units - `extra_snippets` (bool, optional) — Up to 5 extra excerpts per result (Pro plan) - `summary` (bool, optional) — Return a summarizer_key to pass to summarize_search_results ``` **Output `data` schema:** ```typescript { results: { summarizer_key: string | null; url: string | null; title: string | null; description: string | null; extra_snippets: string[] | null; question: string | null; answer: string | null; mutated_by_goggles: boolean | null; data: string | null; // discussion body source: Record | null; breaking: boolean | null; is_live: boolean | null; age: string | null; thumbnail_url: string | null; duration: string | null; view_count: number | null; creator: string | null; publisher: string | null; tags: string[] | null; }[]; } ```
search_local — Local business and POI search Searches for local businesses and places via the Brave Search API. Returns ratings, addresses, phone numbers, hours, and AI descriptions. Access to enriched POI data requires a Brave Search API Pro plan; the tool gracefully falls back to web results if local data is unavailable. **Inputs:** ``` - `query` (string, required) — Local search query, e.g. 'pizza near downtown Chicago' - `count` (int, optional, default: 5) — Results to return (1–20) - `country` (CountryCode, optional, default: "US") — Country code ``` **Output `data` schema:** ```typescript { results: { // POI-shaped fields name: string | null; address: string | null; phone: string | null; rating: number | null; review_count: number | null; hours: unknown[] | null; price_range: string | null; categories: string[] | null; url: string | null; description: string | null; // fallback web-result-shaped fields (when local data is unavailable) title: string | null; extra_snippets: string[] | null; }[]; } ```
search_videos — Video search Searches for videos via the Brave Search API. Returns titles, URLs, durations, view counts, creators, and thumbnails. **Inputs:** ``` - `query` (string, required) — Video search query (max 400 chars, 50 words) - `country` (CountryCode, optional, default: "US") — Country for results - `search_lang` (SearchLang, optional, default: "en") — Search language - `ui_lang` (UiLang, optional, default: "en-US") — UI language - `count` (int, optional, default: 10) — Results to return (1–20) - `offset` (int, optional, default: 0) — Pagination offset (0–9) - `safesearch` (SafeSearch, optional, default: "moderate") — Safe-search level - `freshness` (string, optional) — Time filter: pd pw pm py or YYYY-MM-DDtoYYYY-MM-DD - `spellcheck` (bool, optional, default: true) — Spellcheck the query ``` **Output `data` schema:** ```typescript { results: { url: string | null; title: string | null; description: string | null; age: string | null; thumbnail_url: string | null; duration: string | null; view_count: number | null; creator: string | null; publisher: string | null; tags: string[] | null; mutated_by_goggles: boolean | null; }[]; } ```
search_images — Image search Searches for images via the Brave Search API. Returns direct image URLs, source pages, and dimensions. Images are returned as URLs — no base64 encoding. **Inputs:** ``` - `query` (string, required) — Image search query (max 400 chars, 50 words) - `country` (CountryCode, optional, default: "US") — Country for results - `search_lang` (SearchLang, optional, default: "en") — Search language - `count` (int, optional, default: 10) — Results to return (1–20) - `safesearch` (SafeSearch, optional, default: "moderate") — Safe-search level - `spellcheck` (bool, optional, default: true) — Spellcheck the query ``` **Output `data` schema:** ```typescript { results: { url: string | null; source: string | null; title: string | null; width: number | null; height: number | null; format: string | null; }[]; } ```
search_news — News search Searches for current news articles via the Brave Search API. Returns headlines, sources, publication age, and descriptions. **Inputs:** ``` - `query` (string, required) — News search query (max 400 chars, 50 words) - `country` (CountryCode, optional, default: "US") — Country for results - `search_lang` (SearchLang, optional, default: "en") — Search language - `ui_lang` (UiLang, optional, default: "en-US") — UI language - `count` (int, optional, default: 10) — Results to return (1–20) - `offset` (int, optional, default: 0) — Pagination offset (0–9) - `safesearch` (SafeSearch, optional, default: "moderate") — Safe-search level - `freshness` (string, optional) — Time filter: pd pw pm py or YYYY-MM-DDtoYYYY-MM-DD - `extra_snippets` (bool, optional) — Up to 5 extra excerpts per result (Pro plan) - `spellcheck` (bool, optional, default: true) — Spellcheck the query ``` **Output `data` schema:** ```typescript { results: { mutated_by_goggles: boolean | null; source: Record | null; breaking: boolean | null; is_live: boolean | null; age: string | null; url: string | null; title: string | null; description: string | null; extra_snippets: string[] | null; }[]; } ```
search_places — Structured POI / place search Retrieves points of interest (POIs) with structured business data via Brave's dedicated place-search endpoint. Returns addresses, hours, ratings, categories, and contact info. Geographic context is required — provide latitude/longitude or a location string (e.g. 'san francisco ca united states'). Access requires a Brave Search API Pro plan. **Inputs:** ``` - `query` (string, required) — Search query — shapes result type, e.g. 'coffee shops' or 'Eiffel Tower' - `location` (string, optional) — Location context, e.g. 'san francisco ca united states' or 'tokyo japan' - `latitude` (float, optional) — Latitude (-90 to 90) - `longitude` (float, optional) — Longitude (-180 to 180) - `radius` (int, optional) — Proximity bias in metres (not a hard cutoff) - `count` (int, optional, default: 20) — Results to return (1–50) - `country` (CountryCode, optional, default: "US") — Country code - `search_lang` (SearchLang, optional, default: "en") — Search language - `ui_lang` (UiLang, optional, default: "en-US") — UI language - `units` (Units, optional) — Measurement units - `safesearch` (SafeSearch, optional, default: "moderate") — Safe-search level - `spellcheck` (bool, optional, default: true) — Spellcheck the query ``` **Output `data` schema:** ```typescript { results: { name: string | null; address: string | null; phone: string | null; rating: number | null; review_count: number | null; hours: unknown[] | null; price_range: string | null; categories: string[] | null; url: string | null; description: string | null; }[]; } ```
summarize_search_results — AI summary of prior web search results Retrieves an AI-generated summary of web search results using Brave's Summarizer API. Workflow: call search_web with summary=true first, then pass the returned summarizer_key to this tool. Requires a Brave Search API Pro AI subscription. **Inputs:** ``` - `key` (string, required) — Summarizer key from search_web called with summary=true - `entity_info` (bool, optional, default: false) — Include related entity information ``` **Output `data` schema:** ```typescript { text: string; } ```
get_llm_context — Relevance-ranked web content for RAG/grounding Retrieves pre-extracted, relevance-ranked web content using Brave's LLM Context API, optimised for AI agents, LLM grounding, and RAG pipelines. Unlike a web search (links + short descriptions), this tool returns the actual substance of matching pages — text chunks, tables, code blocks — so the model can reason over it directly. When to use: - Grounding answers in fresh, relevant web content (RAG) - Question answering and fact-checking against current sources - Gathering source material without manually fetching pages When relaying results in markdown environments, cite source URLs from the 'sources' map. **Inputs:** ``` - `query` (string, required) — Search query (max 400 chars, 50 words) - `country` (CountryCode, optional, default: "US") — Country for results - `search_lang` (SearchLang, optional, default: "en") — Search language - `count` (int, optional, default: 20) — Number of results to consider (1–50) - `freshness` (string, optional) — Time filter: pd pw pm py or YYYY-MM-DDtoYYYY-MM-DD - `spellcheck` (bool, optional, default: true) — Spellcheck the query - `maximum_number_of_urls` (int, optional) — Max URLs to extract content from (1–50) - `maximum_number_of_tokens` (int, optional) — Total token budget (1024–32768) - `maximum_number_of_snippets` (int, optional) — Max snippets across all URLs (1–256) - `context_threshold_mode` (ContextThresholdMode, optional) — Relevance filtering mode - `maximum_number_of_tokens_per_url` (int, optional) — Per-URL token budget (512–8192) - `maximum_number_of_snippets_per_url` (int, optional) — Per-URL snippet cap (1–100) - `enable_local` (bool, optional) — Enable local recall - `enable_source_metadata` (bool, optional) — Enrich source metadata - `x_loc_lat` (float, optional) — User latitude (-90 to 90) - `x_loc_long` (float, optional) — User longitude (-180 to 180) - `x_loc_city` (string, optional) — User city - `x_loc_country` (string, optional) — User 2-letter country code ``` **Output `data` schema:** ```typescript { // This model declares no fixed fields of its own — the entire response // shape is the passthrough JSON from Brave's LLM Context API. The tool // description references a `sources` map for citing result URLs. [key: string]: unknown; } ```
## API Parameters Reference
Response Envelope Every tool returns the same top-level envelope. Only `data` varies per tool. ```json // Success { "success": true, "statusCode": 200, "retriable": false, "retry_after_seconds": null, "error": null, "data": { ... } } // Error { "success": false, "statusCode": 400, "retriable": false, "retry_after_seconds": null, "error": { "code": "{ERROR_CODE}", "message": "{description}", "details": {} }, "data": null } ``` - `retriable` — `true` when it is safe to retry (rate limit, network error, 503). `false` for validation and auth errors. - `retry_after_seconds` — seconds to wait before retrying; present only when `retriable` is `true` and the upstream specifies a delay. - `error.code` — machine-readable string: `VALIDATION_ERROR`, `AUTH_ERROR`, `UPSTREAM_ERROR`, `SERVER_ERROR`. - All `data` models accept additional, undocumented fields beyond what's listed above (`extra="allow"`) — Brave may add fields to its API responses that aren't reflected in these schemas yet.
Common Parameters These appear, with the same meaning, across most of the search tools: - `country` (CountryCode) — "Country for results" (`search_local` and `search_places` phrase this as "Country code") - `search_lang` (SearchLang) — Search language - `ui_lang` (UiLang) — UI language - `safesearch` (SafeSearch: `off` | `moderate` | `strict`) — Safe-search level - `spellcheck` (bool) — Spellcheck the query - `freshness` (string) — Time filter: `pd` (day) / `pw` (week) / `pm` (month) / `py` (year), or a custom `YYYY-MM-DDtoYYYY-MM-DD` range - `units` (Units: `metric` | `imperial`) — Measurement units `CountryCode`, `SearchLang`, and `UiLang` are each closed lists of ISO-style codes matching Brave's supported values — pass one of the enumerated codes for the given parameter.
## Getting Your Brave Search API Key
Steps 1. Go to the [Brave Search API dashboard](https://api-dashboard.search.brave.com/) 2. Sign up or log in, then subscribe to a plan (a free tier is available) 3. Open the API Keys section of the dashboard and create a new key (or use the one generated for you on signup) 4. Copy the generated key — you will only see it once
## Troubleshooting
Missing or Invalid Headers - **Cause:** API key not provided in request headers or incorrect format - **Solution:** 1. Verify `Authorization: Bearer YOUR_API_KEY` and `X-Mewcp-Credential-Id: CREDENTIAL-ID` headers are present 2. Check API key is active in your MewCP account
Insufficient Credits - **Cause:** API calls have exceeded your request limits - **Solution:** 1. Check credit usage in your Curious Layer dashboard 2. Upgrade to a paid plan or add credits for higher limits 3. Contact support for credit adjustments
Credential Not Connected - **Cause:** No Brave Search credential linked to your account - **Solution:** 1. Go to **Credentials** in your MewCP dashboard 2. Connect your Brave Search account (OAuth) or add your API key (static) 3. Retry the request with the correct `X-Mewcp-Credential-Id` header
Malformed Request Payload - **Cause:** JSON payload is invalid or missing required fields - **Solution:** 1. Validate JSON syntax before sending 2. Ensure all required tool parameters are included 3. Check parameter types match expected values
Server Not Found - **Cause:** Incorrect server name in the API endpoint - **Solution:** 1. Verify endpoint format: `mewcp-brave-search/mcp/{tool-name}` 2. Use correct server name from documentation 3. Check available servers in your Curious Layer account
Brave Search API Error - **Cause:** Upstream Brave Search API returned an error - **Solution:** 1. Check the Brave Search API's status page for ongoing incidents 2. Verify your credential has the required permissions (some tools require a Pro plan) 3. Review the error message for specific details
---
Resources - **[Brave Search API Documentation](https://api-dashboard.search.brave.com/app/documentation)** — Official API reference - **[FastMCP Docs](https://gofastmcp.com/v2/getting-started/welcome)** — FastMCP specification - **[FastMCP Credentials](https://pypi.org/project/fastmcp-credentials/)** — FastMCP Credentials package for credential handling
--- ## Connection snippets ### Python (fastmcp) ```python import asyncio from fastmcp import Client from fastmcp.client.transports import StreamableHttpTransport SERVER_URL = "https://gateway.mewcp.com/brave-search/mcp" MEWCP_KEY = "YOUR_MEWCP_KEY" CREDENTIAL_ID = "YOUR_CREDENTIAL_ID" transport = StreamableHttpTransport( url=SERVER_URL, headers={ "Authorization": f"Bearer {MEWCP_KEY}", "x-mewcp-credential-id": CREDENTIAL_ID, } ) async def main(): client = Client(transport) async with client: await client.ping() tools = await client.list_tools() resources = await client.list_resources() prompts = await client.list_prompts() # Change the tool name and arguments with actual tool and arguments available in server result = await client.call_tool("example_tool", {"param": "value"}) print(result) asyncio.run(main()) ``` ### TypeScript (MCP SDK) ```typescript import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; const SERVER_URL = "https://gateway.mewcp.com/brave-search/mcp"; const MEWCP_KEY = "YOUR_MEWCP_KEY"; const CREDENTIAL_ID = "YOUR_CREDENTIAL_ID"; const transport = new StreamableHTTPClientTransport(new URL(SERVER_URL), { requestInit: { headers: { Authorization: `Bearer ${MEWCP_KEY}`, "x-mewcp-credential-id": CREDENTIAL_ID, }, }, }); const client = new Client({ name: "mewcp-client", version: "1.0.0", }); await client.connect(transport); const tools = await client.listTools(); console.log("Available tools:", tools.tools.map(t => t.name)); // Change the tool name and arguments to a tool available on your server const result = await client.callTool({ name: "example_tool", arguments: { param: "value" }, }); console.log("Tool result:", result); ``` ### VS Code (settings.json) ```json { "servers": { "mewcp-brave-search": { "type": "http", "url": "https://gateway.mewcp.com/brave-search/mcp", "headers": { "Authorization": "Bearer YOUR_MEWCP_KEY", "x-mewcp-credential-id": "YOUR_CREDENTIAL_ID" } } } } ``` ### Cursor (mcp.json) ```json { "mcpServers": { "brave-search": { "url": "https://gateway.mewcp.com/brave-search/mcp", "headers": { "Authorization": "Bearer YOUR_MEWCP_KEY", "x-mewcp-credential-id": "YOUR_CREDENTIAL_ID" } } } } ``` ### Claude Desktop (claude_desktop_config.json) ```json "mcpServers": { "brave-search": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://gateway.mewcp.com/brave-search/mcp", "--transport", "http-only", "--header", "Authorization: Bearer YOUR_MEWCP_KEY", "--header", "x-mewcp-credential-id: YOUR_CREDENTIAL_ID" ] } } ```