Skip to main content
Glama
isaacgounton

Brave Search MCP Server

by isaacgounton

支持 SSE 的 Brave Search MCP

这是一个模型上下文协议 (MCP) 服务器,提供 Brave Search 功能,并集成了服务器发送事件 (SSE)。它可以部署到 Coolify 并用作实时搜索服务。

特征

  • 通过 MCP 集成 Brave Search API

  • 使用 SSE 的实时搜索结果

  • Docker 和 Coolify 已准备就绪

  • TypeScript 实现

  • Express.js SSE 端点

Related MCP server: WebSearch-MCP

先决条件

  • Brave Search API 密钥

  • Node.js 18+

  • Docker(用于容器化部署)

  • Coolify 实例

本地开发

  1. 克隆存储库

  2. 使用您的 Brave API 密钥创建一个.env文件:

    BRAVE_API_KEY=your_api_key_here
    PORT=3001
  3. 安装依赖项:

    npm install
  4. 启动开发服务器:

    npm run dev

Docker 部署

  1. 使用 docker-compose 构建并运行:

    docker-compose up --build

Coolify 部署

  1. 在 Coolify 仪表板中,创建一个新服务

  2. 选择“从源部署”

  3. 配置以下内容:

    • 存储库 URL:您的存储库 URL

    • 分支:主

    • 构建命令: npm run build

    • 启动命令: npm start

    • 端口:3001

    • 环境变量:

      • BRAVE_API_KEY=你的 API 密钥

      • 端口=3001

使用 SSE 集成

SSE 端点

GET http://your-server:3001/sse

SSE 端点提供实时搜索结果。使用 EventSource API 连接到该端点:

const eventSource = new EventSource('http://your-server:3001/sse');

eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  // Handle the search results
  console.log(data);
};

eventSource.onerror = (error) => {
  console.error('SSE Error:', error);
  eventSource.close();
};

消息端点

POST http://your-server:3001/messages
Content-Type: application/json

{
  "query": "your search query",
  "count": 10  // optional, default: 10, max: 20
}

使用此端点触发将广播到所有连接的 SSE 客户端的搜索。

MCP 使用

服务器提供以下MCP工具:

  • brave_web_search :使用 Brave Search API 执行网络搜索

    {
      query: string;    // Search query
      count?: number;   // Number of results (1-20, default: 10)
    }

错误处理

  • 服务器向所有连接的 SSE 客户端广播错误

  • 错误格式如下:

    {
      "type": "error",
      "error": "error message"
    }

笔记

  • SSE 连接将保持打开状态,直到客户端关闭它

  • 每个搜索结果都会广播给所有连接的客户端

  • 服务器自动处理断开连接和清理

  • 对于生产部署,请考虑对消息端点实施身份验证

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    A Model Context Protocol server that enables AI assistants to perform real-time web searches, retrieving up-to-date information from the internet via a Crawler API.
    1
    65
    40
    ISC
  • A
    license
    A
    quality
    D
    maintenance
    An MCP Server implementation that integrates the Brave Search API, providing, Web Search, Local Points of Interest Search, Image Search, Video Search, News Search and LLM Context Search capabilities
    5
    196
    125
    GPL 3.0

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/isaacgounton/Brave-Search-MCP-SSE'

If you have feedback or need assistance with the MCP directory API, please join our Discord server