# gbrigandi/mcp-server-wazuh architecture

> Architecture diagram of the GitHub repository gbrigandi/mcp-server-wazuh, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gbrigandi/mcp-server-wazuh
- Repository: https://github.com/gbrigandi/mcp-server-wazuh

## Overview

This is a Rust MCP server that exposes Wazuh security and operational data as tools for MCP-compatible clients. The principal workflow is a client request entering the server’s MCP interface, being dispatched by the tool router to a domain module, then querying Wazuh and formatting the response as MCP content. The modules cover alerts, agents, vulnerabilities, rules, logs, statistics, and cluster operations. Relationships follow the shown router delegation and client calls; some capability details are documented in the README but their full implementations were not sampled.

Main entry points: [`src/main.rs`](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/main.rs) (Wazuh MCP Server), [`src/tools/agents.rs`](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/agents.rs) (Agent Tools), [`src/tools/vulnerabilities.rs`](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/vulnerabilities.rs) (Vulnerability Tools), [`src/tools/rules.rs`](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/rules.rs) (Rule Tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["MCP Interface"]
  node_server["Wazuh MCP Server<br/>[main.rs]"]
end

subgraph group_manager["Manager Operations"]
  node_agents["Agent Tools<br/>[agents.rs]"]
  node_vulnerabilities["Vulnerability Tools<br/>[vulnerabilities.rs]"]
  node_rules["Rule Tools<br/>[rules.rs]"]
end

subgraph group_indexer["Indexer Operations"]
  node_alerts["Alert Tools<br/>[alerts.rs]"]
end

subgraph group_operations["Operations Monitoring"]
  node_stats["Stats and Logs<br/>[stats.rs]"]
end

node_client(("MCP Client"))
node_manager_api["Wazuh Manager API"]
node_indexer_api[("Wazuh Indexer")]

node_client -->|"requests tools"| node_server
node_server -->|"delegates calls"| node_agents
node_server -->|"delegates calls"| node_alerts
node_server -->|"delegates calls"| node_rules
node_server -->|"delegates calls"| node_stats
node_server -->|"delegates calls"| node_vulnerabilities
node_agents -->|"queries agents"| node_manager_api
node_vulnerabilities -.->|"queries vulnerabilities"| node_manager_api
node_rules -->|"queries rules"| node_manager_api
node_stats -->|"queries logs and cluster"| node_manager_api
node_alerts -->|"retrieves alerts"| node_indexer_api

click node_server "https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/main.rs"
click node_agents "https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/agents.rs"
click node_vulnerabilities "https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/vulnerabilities.rs"
click node_rules "https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/rules.rs"
click node_stats "https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/stats.rs"
click node_alerts "https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/alerts.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_client toneBlue
class node_agents,node_vulnerabilities,node_rules,node_indexer_api toneAmber
class node_alerts,node_manager_api toneMint
class node_stats toneRose
```

## Components

### MCP Interface

- [Wazuh MCP Server](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/main.rs): `src/main.rs`

### Manager Operations

- [Agent Tools](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/agents.rs): `src/tools/agents.rs`
- [Vulnerability Tools](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/vulnerabilities.rs): `src/tools/vulnerabilities.rs`
- [Rule Tools](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/rules.rs): `src/tools/rules.rs`

### Indexer Operations

- [Alert Tools](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/alerts.rs): `src/tools/alerts.rs`

### Operations Monitoring

- [Stats and Logs](https://github.com/gbrigandi/mcp-server-wazuh/blob/main/src/tools/stats.rs): `src/tools/stats.rs`

### Other components

- **MCP Client**
- **Wazuh Manager API**
- **Wazuh Indexer**

## Connections

- MCP Client → Wazuh MCP Server: requests tools (evidence: `README.md`)
- Wazuh MCP Server → Agent Tools: delegates calls (evidence: `src/main.rs`)
- Wazuh MCP Server → Alert Tools: delegates calls (evidence: `src/main.rs`)
- Wazuh MCP Server → Rule Tools: delegates calls (evidence: `src/main.rs`)
- Wazuh MCP Server → Stats and Logs: delegates calls (evidence: `src/main.rs`)
- Wazuh MCP Server → Vulnerability Tools: delegates calls (evidence: `src/main.rs`)
- Agent Tools → Wazuh Manager API: queries agents (evidence: `src/tools/agents.rs`)
- Vulnerability Tools → Wazuh Manager API: queries vulnerabilities
- Rule Tools → Wazuh Manager API: queries rules (evidence: `src/tools/rules.rs`)
- Stats and Logs → Wazuh Manager API: queries logs and cluster (evidence: `src/tools/stats.rs`)
- Alert Tools → Wazuh Indexer: retrieves alerts (evidence: `src/tools/alerts.rs`)
