Skip to main content
Glama

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 端点

先决条件

  • 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 连接将保持打开状态,直到客户端关闭它
  • 每个搜索结果都会广播给所有连接的客户端
  • 服务器自动处理断开连接和清理
  • 对于生产部署,请考虑对消息端点实施身份验证
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

与 Brave Search API 集成的模型上下文协议服务器,通过服务器发送事件 (SSE) 提供实时搜索功能。

  1. 特征
    1. 先决条件
      1. 本地开发
        1. Docker 部署
          1. Coolify 部署
            1. 使用 SSE 集成
              1. SSE 端点
              2. 消息端点
            2. MCP 使用
              1. 错误处理
                1. 笔记

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    A Model Context Protocol (MCP) server that provides search and crawl functionality using Search1API.
                    Last updated -
                    5
                    206
                    111
                    TypeScript
                    MIT License
                    • Apple
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A server based on the MCP protocol that uses the Brave API for web search functionality.
                    Last updated -
                    6
                    Python
                    MIT License
                    • Apple
                    • Linux
                  • -
                    security
                    A
                    license
                    -
                    quality
                    "primitive" RAG-like web search model context protocol server that runs locally. ✨ no APIs ✨
                    Last updated -
                    43
                    Python
                    MIT License
                    • Linux
                    • Apple
                  • A
                    security
                    F
                    license
                    A
                    quality
                    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.
                    Last updated -
                    1
                    44
                    8
                    JavaScript
                    • Apple
                    • Linux

                  View all related MCP servers

                  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