MCP
search
Brave Search
Run web and local-place searches via the Brave Search API.
Requires Growth plan or above.
Connect Brave Search
Sign up for an API key at api.search.brave.com (free tier is 2,000 queries/month), then paste it on the Brave Search card at /dashboard/connections.
Example
Run a web search and use the results in an LLM prompt or UI.
app/api/web-search/route.ts
export async function GET(req: Request) {const q = new URL(req.url).searchParams.get('q')!const res = await fetch('https://leash.build/api/integrations/brave-search/brave_web_search', {method: 'POST',headers: {'x-api-key': process.env.LEASH_API_KEY!,'content-type': 'application/json',},body: JSON.stringify({query: q,count: 10,}),})const { data } = await res.json()// data =>// {// web: {// results: [// {// title: 'Anthropic — Claude',// url: 'https://www.anthropic.com/claude',// description: 'Claude is a next-generation AI assistant...'// },// ...// ]// },// query: { original: 'claude api', altered: null }// }return Response.json(data)}
Available tools
brave_web_search— general web search with snippets.brave_local_search— local businesses and places (US only).
Common gotchas
- count caps at 20. For deeper results, page with
offset; max offset is 9 (so 10 pages of 20 = 200 results). - brave_local_search returns no results outside the US. Fall back to
brave_web_searchwith a location-qualified query elsewhere. - Free-tier QPS is 1 request/sec. Bursts trigger 429; back off and serialize.
See the Brave Search API reference for the underlying provider docs.
Other languages: see SDK overview.