Labsco
thomasvan logo

Brave Search

โ˜… 1

from thomasvan

A server for Brave Search, enabling web search capabilities via its API.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

Brave Search MCP Server

smithery badge

This project implements a Model Context Protocol (MCP) server for Brave Search, allowing integration with AI assistants like Claude.

Available Tools

The server provides two main tools:

  1. brave_web_search: Performs a web search using the Brave Search API.
  2. brave_local_search: Searches for local businesses and places.

Refer to the tool docstrings in src/server.py for detailed usage information.

Development

To make changes to the project:

  1. Modify the code in the src directory as needed.
  2. Update the requirements.txt file if you add or remove dependencies:
    uv pip freeze > requirements.txt
  3. Restart the server to apply changes.

Testing

The project includes both unit tests and integration tests:

Installing Test Dependencies

uv pip install pytest pytest-asyncio pytest-cov

Running Unit Tests

Unit tests can be run without an API key and use mocks to simulate API responses:

# Run all unit tests
python -m pytest tests/unit/

# Run with verbose output
python -m pytest tests/unit/ -v

Running Integration Tests

Integration tests require a valid Brave API key and make real API calls:

# Run integration tests with your API key
BRAVE_API_KEY_INTEGRATION="your_api_key_here" python -m pytest tests/integration/ -v

Test Coverage

To check test coverage:

python -m pytest --cov=src/mcp_brave_search