Wazuh MCP Server

by unmuktoai
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Retrieves security alerts from Elasticsearch indices containing Wazuh data, transforming them into standardized MCP messages.

  • Uses Flask to expose an HTTP endpoint for serving transformed security event data to clients.

Wazuh MCP 服务器

一个生产级的开源 MCP 服务器,用于将 Wazuh 安全数据与 LLM(例如 Claude 桌面应用程序)集成。该服务使用 Wazuh RESTful API 进行身份验证,从 Elasticsearch 索引中检索警报,将事件转换为符合 MCP 标准的 JSON 格式,并为 Claude 桌面公开一个 HTTP 端点以获取实时安全上下文。

特征

  • **基于 JWT 的身份验证:**使用 JWT 令牌通过 Wazuh 进行安全身份验证。
  • **警报检索:**查询 Elasticsearch 索引以获取 Wazuh 警报数据。
  • **MCP 消息转换:**将安全事件转换为标准化的 MCP 消息。
  • **Flask HTTP 服务器:**为 Claude Desktop 集成公开一个/mcp端点。
  • **强大的错误处理:**处理令牌过期、网络超时和格式错误的数据。
  • **可配置:**通过环境变量轻松配置并通过其配置文件与 Claude Desktop 集成。

先决条件

  • Python 3.8+
  • 访问 Wazuh API 实例。
  • (可选)配置 Claude Desktop 来调用 MCP 服务器。

安装

  1. 克隆存储库:
    git clone https://github.com/unmuktoai/Wazuh-MCP-Server.git cd Wazuh-MCP-Server

创建并激活虚拟环境:

python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate

安装依赖项:

pip install -r requirements.txt

配置设置以下环境变量来配置 MCP 服务器:

WAZUH_HOST: Wazuh server hostname or IP. WAZUH_PORT: Port for the Wazuh API (default: 55000). WAZUH_USER: Wazuh API username. WAZUH_PASS: Wazuh API password. VERIFY_SSL: Set to "true" or "false" (default: false). MCP_SERVER_PORT: Port on which the MCP server will run (default: 8000).

示例(MacOS):

export WAZUH_HOST="your_wazuh_server" export WAZUH_PORT="55000" export WAZUH_USER="your_username" export WAZUH_PASS="your_password" export VERIFY_SSL="false" export MCP_SERVER_PORT="8000"

运行服务器使用以下命令启动 MCP 服务器:

python wazuh_mcp_server.py

服务器将监听指定端口的所有接口

MCP_SERVER_PORT.

与 Claude Desktop 集成 要与 Claude Desktop 集成,请更新其配置文件:

MacOS:~/Library/Application Support/Claude/claude_desktop_config.json Windows:%APPDATA%/Claude/claude_desktop_config.json 在 mcpServers 下添加以下条目:

{ "mcpServers": { "mcp-server-wazuh": { "command": "python3 /path/to/Wazuh-MCP-Server/wazuh_mcp_server.py", "env": { "WAZUH_HOST": "your_wazuh_server", "WAZUH_PORT": "55000", "WAZUH_USER": "your_username", "WAZUH_PASS": "your_password", "MCP_SERVER_PORT": "8000", "VERIFY_SSL": "false" } } } }

许可证 该项目根据 MIT 许可证进行授权。

欢迎贡献代码!请提交 issue 或 PR,以改进代码或修复 bug。

-
security - not tested
A
license - permissive license
-
quality - not tested

通过从 Elasticsearch 索引中检索警报并将其转换为符合 MCP 的格式,将 Wazuh 安全数据与 LLM(例如 Claude Desktop)安全地集成,从而在 LLM 应用程序中实现实时安全上下文。

  1. Features
    1. Prerequisites
      1. Installation
        ID: 8tkuk2554f