OpenSearch MCP Server
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.
Enables package management and script execution for server operations like starting in various modes (stdio, debug, dev, inspect).
Enables querying and analyzing Wazuh security logs stored in OpenSearch, with features for searching alerts with advanced filtering, retrieving detailed alert information, generating security event statistics, and visualizing alert trends over time.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenSearch MCP Server show me high severity alerts from the last 24 hours"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenSearch MCP Server
A Model Context Protocol (MCP) server for querying and analyzing Wazuh security logs stored in OpenSearch.
Features
Search for security alerts with advanced filtering
Get detailed information about specific alerts
Generate statistics on security events
Visualize alert trends over time
Progress reporting for long-running operations
Structured error handling
Related MCP server: OpenSearch MCP Server
Prerequisites
Node.js v16 or higher
Access to an OpenSearch instance containing Wazuh security logs
Installation
Option 1: Use with npx directly 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
# 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#mainOption 2: Local Installation
Clone this repository:
git clone https://github.com/jetbalsa/mcp-opensearch-js.git
cd mcp-opensearch-jsInstall dependencies:
npm installConfigure your environment variables:
cp .env.example .envEdit the
.envfile with your OpenSearch connection details:
OPENSEARCH_URL=https://your-opensearch-endpoint:9200
OPENSEARCH_USERNAME=your-username
OPENSEARCH_PASSWORD=your-password
DEBUG=falseRunning the Server
Start the server:
npm startThis will start the server in stdio mode.
Enable debug logging:
npm run stdio:debugTest with MCP CLI:
npm run devThis runs the server with the FastMCP CLI tool for interactive testing.
Test with MCP Inspector:
npm run inspectThis starts the server and connects it to the MCP Inspector for visual debugging.
Server Tools
The server provides the following tools:
1. Search Alerts
Search for security alerts in Wazuh data.
Parameters:
query: The search query texttimeRange: Time range (e.g., 1h, 24h, 7d)maxResults: Maximum number of results to returnindex: Index pattern to search
2. Get Alert Details
Get detailed information about a specific alert by ID.
Parameters:
id: The alert IDindex: Index pattern
3. Alert Statistics
Get statistics about security alerts.
Parameters:
timeRange: Time range (e.g., 1h, 24h, 7d)field: Field to aggregate by (e.g., rule.level, agent.name)index: Index pattern
4. Visualize Alert Trend
Visualize alert trends over time.
Parameters:
timeRange: Time range (e.g., 1h, 24h, 7d)interval: Time interval for grouping (e.g., 1h, 1d)query: Query to filter alertsindex: Index pattern
Example Usage
Using the MCP CLI tool:
> 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)Using with a Client
To use this MCP server with a client implementation:
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);License
MIT
Available Tools
9 toolsalertStatisticsC
Get statistics about security alerts
Inputs: field, index, timeRange.
exploreFieldValuesC
Explore possible values for a field in an index
Inputs: field (required), index (required), maxValues, query.
getAlertDetailsB
Get detailed information about a specific alert by ID
Inputs: id (required), index.
getIndexMappingC
Get the field mappings for an index
Inputs: index (required).
listIndexesC
List all available indexes in OpenSearch
Inputs: pattern.
monitorLogsC
Monitor logs in real-time (simulated)
Inputs: index (required), maxResults, query, refreshInterval.
searchAlertsC
Search for security alerts in Wazuh data
Inputs: query (required), index, maxResults, timeRange.
searchLogsC
Search for logs in any OpenSearch index
Inputs: index (required), query (required), fields, maxResults, +2 more.
visualizeAlertTrendC
Visualize alert trends over time
Inputs: index, interval, query, timeRange.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools have distinct purposes, but 'searchAlerts' and 'searchLogs' could be confused as both involve searching, though they target different data types (alerts vs. logs). The descriptions clarify this distinction, but the overlap in naming might cause initial ambiguity for an agent.
The naming is mixed with some tools using verb_noun patterns (e.g., 'listIndexes', 'searchAlerts') and others using noun_verb or descriptive phrases (e.g., 'alertStatistics', 'exploreFieldValues'). This inconsistency makes the set less predictable, though the names remain readable overall.
With 9 tools, the count is well-scoped for an OpenSearch server, covering key operations like listing, searching, monitoring, and visualizing data. Each tool appears to serve a specific function without redundancy, fitting the domain appropriately.
The tool set covers core OpenSearch and Wazuh security alert functionalities, including listing, searching, monitoring, and visualization. Minor gaps might exist, such as lack of CRUD operations for indexes or alerts (e.g., create/update/delete), but agents can likely work around this for common use cases.
Maintenance
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
ZEN SecDB MCP server for CVE intelligence, CVSS/EPSS scoring, advisories, SSVC, and package audits.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that facilitates integration with OpenCTI, allowing users to query and retrieve cyber threat intelligence data via a standardized interface.1642MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server implementation that enables natural language interactions with OpenSearch clusters, allowing users to search documents, analyze indices, and manage clusters through simple conversational commands.1411Apache 2.0
- AlicenseAqualityBmaintenanceAI-powered MCP server that enables security analysts to query Wazuh SIEM/XDR for alert triage, threat hunting, compliance audits, and incident response through natural language prompts.2813MIT
- AlicenseNot gradedqualityBmaintenanceA production-ready Model Context Protocol (MCP) server for seamless integration between Wazuh SIEM and Large Language Models (LLMs).94AGPL 3.0