Skip to content

Conversation

Copy link

Copilot AI commented Dec 18, 2025

Adds a Model Context Protocol server implementation for Brave Search API, enabling AI agents to perform privacy-focused searches through a standardized interface.

Implementation

  • MCP Server (src/index.ts): STDIO transport with 6 tools registered via @modelcontextprotocol/sdk
  • API Client (src/brave-api.ts): Fetch-based client with result formatting, type validation via Zod
  • Search Tools (src/tools/): Web, local, image, video, news, and summarizer endpoints
  • Configuration (src/config.ts): Environment-based config with schema validation

Usage

// Tools accept search parameters and return formatted markdown
{
  name: 'brave_web_search',
  arguments: {
    q: 'typescript best practices',
    count: 10,
    safesearch: 'moderate'
  }
}
// Returns formatted results with titles, URLs, descriptions

Integration

Add to MCP client config:

{
  "mcpServers": {
    "brave-search": {
      "command": "node",
      "args": ["dist/index.js"],
      "env": { "BRAVE_API_KEY": "..." }
    }
  }
}

Security

  • API key via environment variables only
  • Zod schemas validate all inputs (count limits, enum values, required fields)
  • CodeQL scan: 0 alerts
  • Undefined handling for optional API response fields
Original prompt

https://github.com/brave/brave-search-mcp-server


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update README documentation for clarity and completeness Implement Brave Search MCP Server Dec 18, 2025
Copilot AI requested a review from dshvvvshr December 18, 2025 05:28
Copy link
Owner

@dshvvvshr dshvvvshr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do what you think is best. You got this! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants