Wazuh OpenSearch Analytics
W

Wazuh OpenSearch Analytics

2 points
7.2K

Installation

Copy the following command to your Client for configuration
Note: Your key is sensitive information, do not share it with anyone.

🚀 OpenSearch MCP Server

A Model Context Protocol (MCP) server for querying and analyzing Wazuh security logs stored in OpenSearch.

🚀 Quick Start

The OpenSearch MCP Server is a powerful tool for querying and analyzing Wazuh security logs. Here's how to get started:

Prerequisites

  • Node.js v16 or higher.
  • Access to an OpenSearch instance containing Wazuh security logs.

Installation

Option 1: Directly use npx from GitHub (Recommended)

You can run this tool directly using npx without cloning the repository:

# Run the latest version from GitHub
npx github:jetbalsa/mcp-opensearch-js

# Enable debug mode
npx github:jetbalsa/mcp-opensearch-js --debug

# You can also specify a specific branch or commit
npx github:jetbalsa/mcp-opensearch-js#main

Option 2: Local Installation

  1. Clone this repository:
git clone https://github.com/jetbalsa/mcp-opensearch-js.git
cd mcp-opensearch-js
  1. Install dependencies:
npm install
  1. Configure environment variables:
cp .env.example .env
  1. Edit the .env file with your OpenSearch connection details:
OPENSEARCH_URL=https://your-opensearch-endpoint:9200
OPENSEARCH_USERNAME=your-username
OPENSEARCH_PASSWORD=your-password
DEBUG=false

Starting the Server

Start the server:

npm start

This will start the server in stdio mode.

Enable debug logging:

npm run stdio:debug

Test with MCP CLI:

npm run dev

This will start the server and perform an interactive test using the MCP CLI tool.

Test with MCP Inspector:

npm run inspect

This will start the server and connect to the MCP Inspector for visual debugging.

✨ Features

  • Search for security alerts with advanced filtering capabilities.
  • Retrieve detailed information about specific alerts.
  • Generate statistics on security events.
  • Visualize the time trends of alerts.
  • Provide long - term operation progress reports.
  • Implement structured error handling.

📦 Installation

The installation process has been detailed in the Quick Start section above.

💻 Usage Examples

Using the MCP CLI Tool

# Search for alerts
mcp-cli search --keyword "error" --output json

# Get alert details
mcp-cli get --id 12345 --verbose

# Generate statistics
mcp-cli stats --time-range "2023-10-01 00:00:00" "2023-10-07 23:59:59" --summary

# Visualize trends
mcp-cli trends --start-time "2023-10-01" --end-time "2023-10-07" --format chart

Using the Client

const { MCPClient } = require('mcp-opensearch');
const client = new MCPClient({
  host: 'localhost',
  port: 9200,
  username: 'your-username',
  password: 'your-password'
});

// Search for alerts
client.search({ keyword: 'error' }, (err, result) => {
  if (err) return console.error(err);
  console.log(result);
});

// Get alert details
client.get({ id: '12345' }, (err, result) => {
  if (err) return console.error(err);
  console.log(result);
});

📚 Documentation

Server Tools

The server provides the following tools:

1. Search Alerts

Search for security alerts in Wazuh data.

Parameters:

  • --search: Specify the keyword or condition to search for.
  • --filter: Apply advanced filters (e.g., time range, log level, etc.).
  • -o, --output: Specify the output format (supports JSON, CSV, text, etc.).

2. Get Alert Details

Retrieve detailed information about a specific alert.

Parameters:

  • --id: Specify the ID of the alert to query.
  • --fields: Specify the fields to display (comma - separated).
  • -v, --verbose: Enable verbose mode to display more relevant information.

3. Statistics

Generate statistics on security events.

Parameters:

  • --time-range: Specify the time range (format: YYYY-MM-DD HH:MM:SS).
  • --aggregation: Specify the aggregation method (e.g., by hour, day, week, etc.).
  • -s, --summary: Display the summary result.

4. Visualize Trends

Visualize the time trends of alerts.

Parameters:

  • --start-time: Specify the start time.
  • --end-time: Specify the end time.
  • -f, --format: Specify the output format (e.g., chart, table, etc.).

Using the Client

To use this server as a client, follow these steps:

Install dependencies:

npm install mcp-opensearch

Connect to the MCP server:

const { MCPClient } = require('mcp-opensearch');
const client = new MCPClient({
  host: 'localhost',
  port: 9200,
  username: 'your-username', // Optional
  password: 'your-password'  // Optional
});

Example usage:

// Search for alerts
client.search({ keyword: 'error' }, (err, result) => {
  if (err) return console.error(err);
  console.log('Search Result:', result);
});

// Get alert details
client.get({ id: '12345' }, (err, result) => {
  if (err) return console.error(err);
  console.log('Alert Details:', result);
});

Alternatives

C
Claude Context
Claude Context is an MCP plugin that provides in - depth context of the entire codebase for AI programming assistants through semantic code search. It supports multiple embedding models and vector databases to achieve efficient code retrieval.
TypeScript
4.8K
5 points
A
Acemcp
Acemcp is an MCP server for codebase indexing and semantic search, supporting automatic incremental indexing, multi-encoding file processing, .gitignore integration, and a Web management interface, helping developers quickly search for and understand code context.
Python
9.9K
5 points
M
MCP
The Microsoft official MCP server provides search and access functions for the latest Microsoft technical documentation for AI assistants
13.1K
5 points
A
Aderyn
Aderyn is an open - source Solidity smart contract static analysis tool written in Rust, which helps developers and security researchers discover vulnerabilities in Solidity code. It supports Foundry and Hardhat projects, can generate reports in multiple formats, and provides a VSCode extension.
Rust
8.7K
5 points
A
Annas MCP
The MCP server and CLI tool of Anna's Archive are used to search for and download documents on the platform and support access through an API key.
Go
10.6K
4.5 points
S
Search1api
The Search1API MCP Server is a server based on the Model Context Protocol (MCP), providing search and crawling functions, and supporting multiple search services and tools.
TypeScript
15.5K
4 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
55.0K
4.3 points
B
Bing Search MCP
An MCP server for integrating Microsoft Bing Search API, supporting web page, news, and image search functions, providing network search capabilities for AI assistants.
Python
17.1K
4 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
17.5K
4.5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
17.5K
4.3 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
27.6K
5 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
55.0K
4.3 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
24.3K
5 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
52.4K
4.5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
17.2K
4.5 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
36.7K
4.8 points
AIBase
Zhiqi Future, Your AI Solution Think Tank
© 2025AIBase