mcp_tools_advanced_example.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 both Brave MCP commands
Replace both occurrences of
npx -y @modelcontextprotocol/server-brave-search with npx -y @brave/brave-search-mcp-server --transport stdio in the saved file.6
Run the example
Save the code above as
mcp_tools_advanced_example.py, then run: