Brave Search MCP Server
SSE サポートを備えた Brave Search MCP
これは、Server-Sent Events(SSE)統合によるBrave Search機能を提供するModel Context Protocol(MCP)サーバーです。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インスタンス
地域開発
リポジトリをクローンする
Brave API キーを使用して
.envファイルを作成します。BRAVE_API_KEY=your_api_key_here PORT=3001依存関係をインストールします:
npm install開発サーバーを起動します:
npm run dev
Docker デプロイメント
docker-compose を使用してビルドおよび実行します。
docker-compose up --build
Coolify デプロイメント
Coolifyダッシュボードで新しいサービスを作成します
「ソースからデプロイ」を選択する
以下を設定します。
リポジトリ URL: リポジトリ URL
支店: メイン
ビルドコマンド:
npm run build起動コマンド:
npm startポート: 3001
環境変数:
BRAVE_API_KEY=APIキーを入力してください
ポート=3001
SSE統合の使用
SSEエンドポイント
GET http://your-server:3001/sseSSEエンドポイントはリアルタイム検索結果を提供します。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接続はクライアントが閉じるまで開いたままになります。
各検索結果は接続されているすべてのクライアントにブロードキャストされます
サーバーは自動的に切断とクリーンアップを処理します
本番環境では、メッセージエンドポイントの認証を実装することを検討してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Web search API and MCP server for developers building AI agents.
Visit https://brave.com/search/api/ for a free API key. Search the web, local businesses, images,…
Related MCP Servers
- -licenseNot gradedqualityBmaintenanceAn MCP server implementation that integrates the Brave Search API, providing both web and local search capabilities.30,371 npm91,812MIT
- AlicenseBqualityDmaintenanceA 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.186 npm42ISC
- AlicenseAqualityBmaintenanceA Model Context Protocol server that provides real-time web search capabilities to AI assistants through pluggable search providers, currently integrated with the Brave Search API.526 npm16MIT
- AlicenseAqualityDmaintenanceAn 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 capabilities5236 npm130GPL 3.0