brave.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Prepare Node.js
The maintained Brave MCP server requires Node.js 22 or later. Install it, then confirm
node --version reports v22 or later and npx is available:4
Export your API keys
5
Update the Brave MCP server
Replace
npx -y @modelcontextprotocol/server-brave-search with npx -y @brave/brave-search-mcp-server --transport stdio in the saved file.6
Update the Claude model
Replace
Claude(id="claude-sonnet-4-20250514") with Claude(id="claude-sonnet-4-6") in the saved file.7
Run the example
Save the code above as
brave.py, then run: