OpenSearch MCP Server

Integrations

  • Provides configuration of OpenSearch connection details through environment variables stored in a .env file.

  • Allows running the server directly from GitHub using npx without cloning the repository, with options to specify branches or commits.

  • Serves as the runtime environment for the MCP server, requiring version 16 or higher.

OpenSearch MCP サーバー

OpenSearch に保存されている Wazuh セキュリティ ログを照会および分析するための Model Context Protocol (MCP) サーバー。

特徴

  • 高度なフィルタリングでセキュリティアラートを検索する
  • 特定のアラートに関する詳細情報を取得する
  • セキュリティイベントの統計を生成する
  • アラートの傾向を時間経過とともに視覚化する
  • 長時間実行操作の進捗レポート
  • 構造化されたエラー処理

前提条件

  • Node.js v16以上
  • Wazuh セキュリティ ログを含む OpenSearch インスタンスへのアクセス

インストール

オプション 1: GitHub から直接 npx を使用する (推奨)

リポジトリをクローンせずに、npx を使用してこのツールを直接実行できます。

# Run the latest version from GitHub npx github:jetbalsa/mcp-opensearch-js # Run with debug mode enabled npx github:jetbalsa/mcp-opensearch-js --debug # You can also specify a specific branch or commit npx github:jetbalsa/mcp-opensearch-js#main

オプション2: ローカルインストール

  1. このリポジトリをクローンします:
git clone https://github.com/jetbalsa/mcp-opensearch-js.git cd mcp-opensearch-js
  1. 依存関係をインストールします:
npm install
  1. 環境変数を設定します。
cp .env.example .env
  1. OpenSearch 接続の詳細を使用して.envファイルを編集します。
OPENSEARCH_URL=https://your-opensearch-endpoint:9200 OPENSEARCH_USERNAME=your-username OPENSEARCH_PASSWORD=your-password DEBUG=false

サーバーの実行

サーバーを起動します。

npm start

これにより、サーバーが stdio モードで起動します。

デバッグ ログを有効にする:

npm run stdio:debug

MCP CLI でテストします。

npm run dev

これにより、対話型テスト用の FastMCP CLI ツールを使用してサーバーが実行されます。

MCP Inspector でテストします。

npm run inspect

これにより、サーバーが起動し、視覚的なデバッグのために MCP Inspector に接続されます。

サーバーツール

サーバーは次のツールを提供します。

1. 検索アラート

Wazuh データ内のセキュリティ警告を検索します。

パラメータ:

  • query : 検索クエリテキスト
  • timeRange : 時間範囲(例:1時間、24時間、7日)
  • maxResults : 返される結果の最大数
  • index : 検索するインデックスパターン

2. アラートの詳細を取得する

ID 別に特定のアラートの詳細情報を取得します。

パラメータ:

  • id : アラートID
  • index : インデックスパターン

3. アラート統計

セキュリティ警告に関する統計を取得します。

パラメータ:

  • timeRange : 時間範囲(例:1時間、24時間、7日)
  • field : 集計するフィールド (例: rule.level、agent.name)
  • index : インデックスパターン

4. アラートの傾向を視覚化する

アラートの傾向を時間経過とともに視覚化します。

パラメータ:

  • timeRange : 時間範囲(例:1時間、24時間、7日)
  • interval : グループ化する時間間隔(例:1時間、1日)
  • query : アラートをフィルタリングするクエリ
  • index : インデックスパターン

使用例

MCP CLI ツールの使用:

> tools Available tools: - searchAlerts: Search for security alerts in Wazuh data - getAlertDetails: Get detailed information about a specific alert by ID - alertStatistics: Get statistics about security alerts - visualizeAlertTrend: Visualize alert trends over time > tools.searchAlerts(query: "rule.level:>10", timeRange: "12h", maxResults: 5)

クライアントとの使用

この MCP サーバーをクライアント実装で使用するには:

import { Client } from "@modelcontextprotocol/sdk"; import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js"; const client = new Client( { name: "example-client", version: "1.0.0", }, { capabilities: {}, }, ); const transport = new SSEClientTransport(new URL(`http://localhost:3000/sse`)); await client.connect(transport); // Use tools const result = await client.executeTool("searchAlerts", { query: "rule.level:>10", timeRange: "24h", maxResults: 10 }); console.log(result);

ライセンス

マサチューセッツ工科大学

-
security - not tested
F
license - not found
-
quality - not tested

アラートの検索、詳細情報の取得、統計の生成、傾向の視覚化などの機能を備え、OpenSearch に保存されている Wazuh セキュリティ ログのクエリと分析を可能にするモデル コンテキスト プロトコル サーバーです。

  1. Features
    1. Prerequisites
      1. Installation
        1. Option 1: Use with npx directly from GitHub (recommended)
        2. Option 2: Local Installation
      2. Running the Server
        1. Start the server:
        2. Enable debug logging:
        3. Test with MCP CLI:
        4. Test with MCP Inspector:
      3. Server Tools
        1. 1. Search Alerts
        2. 2. Get Alert Details
        3. 3. Alert Statistics
        4. 4. Visualize Alert Trend
      4. Example Usage
        1. Using with a Client
          1. License
            ID: iesh89xysn