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 보안 로그를 쿼리하고 분석하기 위한 MCP(Model Context Protocol) 서버입니다.

특징

  • 고급 필터링을 사용하여 보안 알림 검색
  • 특정 알림에 대한 자세한 정보를 얻으세요
  • 보안 이벤트에 대한 통계 생성
  • 시간 경과에 따른 알림 추세 시각화
  • 장기 실행 작업에 대한 진행 상황 보고
  • 구조화된 오류 처리

필수 조건

  • Node.js v16 이상
  • Wazuh 보안 로그가 포함된 OpenSearch 인스턴스에 액세스

설치

옵션 1: GitHub에서 직접 npx와 함께 사용(권장)

저장소를 복제하지 않고도 npx를 사용하여 이 도구를 직접 실행할 수 있습니다.

지엑스피1

옵션 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);

특허

MIT

-
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