# raghulvj01/aegis-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/raghulvj01/aegis-mcp
- Repository: https://github.com/raghulvj01/aegis-mcp

## Overview

Aegis MCP is a DevSecOps tool server for AI agents. The principal workflow is an MCP client submitting a tool call; the server authorizes and audits it, dispatches to a domain tool, and returns its result. Its documented capabilities span cloud and Kubernetes administration, CI/CD and Git, security scanning, network checks, and Cloudflare operations. The graph reflects documented transport and dispatch, plus visible calls; several tool implementations were not excerpted, so their individual runtime links are shown only where documented.

Main entry points: [`server/main.py`](https://github.com/raghulvj01/aegis-mcp/blob/main/server/main.py) (MCP Server), [`server/auth.py`](https://github.com/raghulvj01/aegis-mcp/blob/main/server/auth.py) (Authorization), [`server/config.py`](https://github.com/raghulvj01/aegis-mcp/blob/main/server/config.py) (Runtime Policies), [`tools/cloudflare/api.py`](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cloudflare/api.py) (Cloudflare Tool Facade)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["MCP Server"]
  node_server["MCP Server<br/>[main.py]"]
  node_auth["Authorization<br/>[auth.py]"]
  node_config["Runtime Policies<br/>[config.py]"]
  node_policyfiles["Role and Scope Policies"]
  node_audit["Audit Logging<br/>[audit_logger.py]"]
  node_health["Health Endpoint<br/>[health.py]"]
end

subgraph group_cloud["Cloud and Kubernetes"]
  node_aws_ec2["EC2 Tools<br/>[ec2.py]"]
  node_aws_s3["S3 Access Audit<br/>[s3.py]"]
  node_k8s_pods["Kubernetes Pods<br/>[pods.py]"]
  node_k8s_audit["Kubernetes Audit<br/>[audit.py]"]
  node_cloudflare_api["Cloudflare Tool Facade<br/>[api.py]"]
  node_cloudflare_client["Cloudflare MCP Client<br/>[client.py]"]
end

subgraph group_delivery["CI/CD and Git"]
  node_pipeline["Pipeline Status<br/>[pipeline.py]"]
  node_jenkins["Jenkins Tools<br/>[jenkins.py]"]
  node_git["Git History<br/>[repo.py]"]
end

subgraph group_security["Security Scanning"]
  node_semgrep["Semgrep SAST<br/>[semgrep.py]"]
  node_dependencies["Dependency CVEs<br/>[deps.py]"]
  node_terraform["Terraform Scanner<br/>[terraform.py]"]
  node_secrets["Secret Scanner<br/>[secrets.py]"]
  node_trivy["Trivy Scanner<br/>[trivy.py]"]
end

subgraph group_network["Network Analysis"]
  node_headers["HTTP Headers<br/>[headers.py]"]
  node_ports["Port Scanner<br/>[port_scanner.py]"]
  node_ssl["TLS Certificate Check<br/>[ssl_checker.py]"]
end

node_agent(("MCP Client / Agent"))
node_cloudflare_service{{"Cloudflare MCP"}}

node_agent -->|"sends tool calls"| node_server
node_server -->|"authorizes calls"| node_auth
node_server -->|"audits calls"| node_audit
node_auth -->|"uses settings"| node_config
node_config -->|"loads policies"| node_policyfiles
node_server -->|"exposes health"| node_health
node_server -->|"dispatches tools"| node_aws_ec2
node_server -->|"dispatches tools"| node_aws_s3
node_server -->|"dispatches tools"| node_k8s_pods
node_server -->|"dispatches tools"| node_k8s_audit
node_server -->|"dispatches tools"| node_pipeline
node_server -->|"dispatches tools"| node_jenkins
node_server -->|"dispatches tools"| node_git
node_server -->|"dispatches tools"| node_semgrep
node_server -->|"dispatches tools"| node_dependencies
node_server -->|"dispatches tools"| node_terraform
node_server -->|"dispatches tools"| node_secrets
node_server -->|"dispatches tools"| node_trivy
node_server -->|"dispatches tools"| node_headers
node_server -->|"dispatches tools"| node_ports
node_server -->|"dispatches tools"| node_ssl
node_server -->|"dispatches tools"| node_cloudflare_api
node_cloudflare_api -->|"calls client"| node_cloudflare_client
node_cloudflare_client -->|"sends MCP requests"| node_cloudflare_service

click node_server "https://github.com/raghulvj01/aegis-mcp/blob/main/server/main.py"
click node_auth "https://github.com/raghulvj01/aegis-mcp/blob/main/server/auth.py"
click node_config "https://github.com/raghulvj01/aegis-mcp/blob/main/server/config.py"
click node_policyfiles "https://github.com/raghulvj01/aegis-mcp/tree/main/policies"
click node_audit "https://github.com/raghulvj01/aegis-mcp/blob/main/audit/audit_logger.py"
click node_health "https://github.com/raghulvj01/aegis-mcp/blob/main/server/health.py"
click node_aws_ec2 "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/aws/ec2.py"
click node_aws_s3 "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/aws/s3.py"
click node_k8s_pods "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/kubernetes/pods.py"
click node_k8s_audit "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/kubernetes/audit.py"
click node_pipeline "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cicd/pipeline.py"
click node_jenkins "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cicd/jenkins.py"
click node_git "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/git/repo.py"
click node_semgrep "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/semgrep.py"
click node_dependencies "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/deps.py"
click node_terraform "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/terraform.py"
click node_secrets "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/secrets.py"
click node_trivy "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/trivy.py"
click node_headers "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/network/headers.py"
click node_ports "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/network/port_scanner.py"
click node_ssl "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/network/ssl_checker.py"
click node_cloudflare_api "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cloudflare/api.py"
click node_cloudflare_client "https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cloudflare/client.py"

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_auth,node_config,node_policyfiles,node_audit,node_health,node_agent toneBlue
class node_aws_ec2,node_aws_s3,node_k8s_pods,node_k8s_audit,node_cloudflare_api,node_cloudflare_client toneAmber
class node_pipeline,node_jenkins,node_git toneMint
class node_semgrep,node_dependencies,node_terraform,node_secrets,node_trivy toneRose
class node_headers,node_ports,node_ssl,node_cloudflare_service toneIndigo
```

## Components

### MCP Server

- [MCP Server](https://github.com/raghulvj01/aegis-mcp/blob/main/server/main.py): `server/main.py`
- [Authorization](https://github.com/raghulvj01/aegis-mcp/blob/main/server/auth.py): `server/auth.py`
- [Runtime Policies](https://github.com/raghulvj01/aegis-mcp/blob/main/server/config.py): `server/config.py`
- [Role and Scope Policies](https://github.com/raghulvj01/aegis-mcp/tree/main/policies): `policies`
- [Audit Logging](https://github.com/raghulvj01/aegis-mcp/blob/main/audit/audit_logger.py): `audit/audit_logger.py`
- [Health Endpoint](https://github.com/raghulvj01/aegis-mcp/blob/main/server/health.py): `server/health.py`

### Cloud and Kubernetes

- [EC2 Tools](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/aws/ec2.py): `tools/aws/ec2.py`
- [S3 Access Audit](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/aws/s3.py): `tools/aws/s3.py`
- [Kubernetes Pods](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/kubernetes/pods.py): `tools/kubernetes/pods.py`
- [Kubernetes Audit](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/kubernetes/audit.py): `tools/kubernetes/audit.py`
- [Cloudflare Tool Facade](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cloudflare/api.py): `tools/cloudflare/api.py`
- [Cloudflare MCP Client](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cloudflare/client.py): `tools/cloudflare/client.py`

### CI/CD and Git

- [Pipeline Status](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cicd/pipeline.py): `tools/cicd/pipeline.py`
- [Jenkins Tools](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/cicd/jenkins.py): `tools/cicd/jenkins.py`
- [Git History](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/git/repo.py): `tools/git/repo.py`

### Security Scanning

- [Semgrep SAST](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/semgrep.py): `tools/security/semgrep.py`
- [Dependency CVEs](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/deps.py): `tools/security/deps.py`
- [Terraform Scanner](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/terraform.py): `tools/security/terraform.py`
- [Secret Scanner](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/secrets.py): `tools/security/secrets.py`
- [Trivy Scanner](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/security/trivy.py): `tools/security/trivy.py`

### Network Analysis

- [HTTP Headers](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/network/headers.py): `tools/network/headers.py`
- [Port Scanner](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/network/port_scanner.py): `tools/network/port_scanner.py`
- [TLS Certificate Check](https://github.com/raghulvj01/aegis-mcp/blob/main/tools/network/ssl_checker.py): `tools/network/ssl_checker.py`

### Other components

- **MCP Client / Agent**
- **Cloudflare MCP**

## Connections

- MCP Client / Agent → MCP Server: sends tool calls (evidence: `README.md`)
- MCP Server → Authorization: authorizes calls (evidence: `server/main.py`)
- MCP Server → Audit Logging: audits calls (evidence: `server/main.py`)
- Authorization → Runtime Policies: uses settings (evidence: `server/auth.py`)
- Runtime Policies → Role and Scope Policies: loads policies (evidence: `server/config.py`)
- MCP Server → Health Endpoint: exposes health (evidence: `README.md`)
- MCP Server → EC2 Tools: dispatches tools (evidence: `README.md`)
- MCP Server → S3 Access Audit: dispatches tools (evidence: `server/main.py`)
- MCP Server → Kubernetes Pods: dispatches tools (evidence: `server/main.py`)
- MCP Server → Kubernetes Audit: dispatches tools (evidence: `server/main.py`)
- MCP Server → Pipeline Status: dispatches tools (evidence: `server/main.py`)
- MCP Server → Jenkins Tools: dispatches tools (evidence: `README.md`)
- MCP Server → Git History: dispatches tools (evidence: `README.md`)
- MCP Server → Semgrep SAST: dispatches tools (evidence: `server/main.py`)
- MCP Server → Dependency CVEs: dispatches tools (evidence: `server/main.py`)
- MCP Server → Terraform Scanner: dispatches tools (evidence: `server/main.py`)
- MCP Server → Secret Scanner: dispatches tools (evidence: `server/main.py`)
- MCP Server → Trivy Scanner: dispatches tools (evidence: `README.md`)
- MCP Server → HTTP Headers: dispatches tools (evidence: `server/main.py`)
- MCP Server → Port Scanner: dispatches tools (evidence: `README.md`)
- MCP Server → TLS Certificate Check: dispatches tools (evidence: `README.md`)
- MCP Server → Cloudflare Tool Facade: dispatches tools (evidence: `server/main.py`)
- Cloudflare Tool Facade → Cloudflare MCP Client: calls client (evidence: `tools/cloudflare/api.py`)
- Cloudflare MCP Client → Cloudflare MCP: sends MCP requests (evidence: `tools/cloudflare/client.py`)
