Self-Healing Infrastructure Agents
Integrates with Amazon CloudWatch and SNS to ingest signed CloudWatch alarm state change notifications, verify SNS message signatures, enforce topic allow lists, and confirm subscriptions for incident correlation.
Provides remediation actions on Kubernetes clusters including rolling restart, scale, rollout undo, cordon, and uncordon, with server-side dry-run support and resourceVersion preconditions; also reads Deployments, ReplicaSets, Pods, and Nodes as diagnostic evidence.
Integrates with Prometheus Alertmanager to ingest alert webhook notifications (payload v4 with constant-time bearer credential comparison) and exposes Prometheus metrics for observability.
Analyzes Terraform plan JSON documents for destructive changes, stateful resources, disabled safety attributes, blast radius, and risk score, and applies the exact reviewed saved plan after digest re-verification.
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., "@Self-Healing Infrastructure Agentsdiagnose the latest crash-loop alert and propose a dry-run fix"
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.
Self-Healing Infrastructure Agents
Agents that turn infrastructure alerts into verified, reversible remediations. Alerts from Prometheus Alertmanager and CloudWatch (via SNS) are correlated into incidents and diagnosed with versioned playbooks against read-only evidence from the cluster. A selected action becomes a remediation plan that the policy engine allows, holds for human approval, or denies. Terraform changes are reviewed through analysis of the saved plan (destructive actions, stateful resources, disabled safety attributes, blast radius). Execution snapshots the current state, applies the change, runs a post-check and rolls back automatically when the check fails. Dry run is the default; nothing destructive runs without a human approval.
Telemetry ─▶ Terraform Analysis ─▶ Policy Validation ─▶ Remediation ─▶ Rollback
(Alertmanager, (plan JSON: deletes, (ABAC policy, change (k8s restart/scale/ (snapshot restore,
CloudWatch) blast radius, risk) windows, approvals) undo/cordon, tf apply) last-known-good plan)Repository: https://github.com/kogunlowo123/self-healing-infrastructure-agents
Capabilities
Capability | Implementation |
Alert ingestion | Alertmanager webhook (payload v4, bearer credential compared in constant time); CloudWatch alarm state changes through SNS with SignatureVersion 2 (SHA256withRSA) verification, topic allow list, certificate host and region checks, replay window |
Correlation | One open incident per alert fingerprint, enforced by a unique database column; repeats raise occurrence count and severity |
Diagnosis | Versioned YAML playbooks ( |
Advisory narrative | Optional model-written incident note through the agentic-core |
Terraform analysis |
|
Policy validation | agentic-core |
Approvals | Human operators only (enterprise OIDC role |
Remediation | Kubernetes rolling restart, scale, rollout undo, cordon and uncordon through the API server (server-side |
Rollback | Snapshot restore with its own verification for Kubernetes actions; for Terraform, a fresh plan of the last-known-good stack applied only when non-destructive |
Agent identity | Inbound agent calls authorized by the agent identity fabric ( |
MCP and A2A | Eight MCP tools on |
Audit | Hash-chained, Ed25519-signed agentic-core |
Observability | Prometheus metrics, OpenTelemetry traces, JSON logs with correlation IDs, SLO and safety alerts, Grafana dashboard |
Shared controls (policy engine, audit chain, model routing, content guard, logging, telemetry) come from agentic-core.
Related MCP server: devops-mcp-server
Quick start (local)
Requires Docker. No API keys or cloud credentials are needed; the service starts in dry-run mode.
docker compose up --build
curl -s localhost:8080/readyz
curl -s localhost:8080/.well-known/agent-card.jsonDevelopment
uv sync
make check # ruff, black, mypy --strict, bandit, contracts, tests (coverage >= 90%)
make integration # PostgreSQL integration tests (needs HEAL_TEST_DATABASE_URL)
make helm # helm lint with CI values
make terraform # terraform fmt + validate for aws, azure, gcpTest suites:
Suite | Content |
| Models and state machines, ingestion, Terraform analysis on recorded plans, change calendar, governor, diagnosis, Kubernetes adapter on recorded API wire documents, Terraform CLI runner with a stand-in executable, identity fabric client, executor, services, runtime |
| Forged and replayed SNS messages, webhook credentials, token attacks, scope and approval bypass, stateful-destroy override, plan path traversal, prompt injection in alerts, MCP host and origin checks |
| Database, Kubernetes API, Terraform, identity fabric and audit failures |
| Latency budgets; |
| Full HTTP lifecycle, MCP and A2A over HTTP, property-based OpenAPI contract test |
| Repositories against PostgreSQL |
Fixtures: tests/fixtures/terraform/terraform-data-*.plan.json were recorded
with Terraform 1.7.5; the aws-* plans keep that recorded structure with AWS
resource types and attributes. Kubernetes fixtures follow the API server's
wire format.
API
Endpoint | Caller | Purpose |
| Alertmanager | Ingest a webhook notification |
| Amazon SNS | Ingest a signed CloudWatch alarm; confirm subscriptions |
| Operators, agents ( | Incidents with alerts and diagnosis |
| Operators, agents ( | Re-run diagnosis on fresh evidence |
| Operators, agents, CI ( | Risk analysis of a plan document |
| Operators, agents ( | Propose a remediation; returns the policy outcome |
| Operators, agents ( | Plans with approvals and executions |
| Human approvers ( | Approve or reject a plan digest |
| Operators, agents ( | Dry run (default) or live execution |
| MCP clients | MCP streamable HTTP endpoint |
| A2A peers | Agent card; JSON-RPC |
| Platform | Liveness, readiness (database), Prometheus metrics |
Error bodies follow the OAuth style {"error": ..., "error_description": ...}.
Full contract: docs/api/openapi.json; JSON Schemas in schemas/.
MCP tools: list_incidents, get_incident, diagnose_incident,
analyze_terraform_plan, propose_remediation, list_remediations,
dry_run_remediation, execute_remediation.
A2A skills: get-incident, diagnose-incident, analyze-terraform-plan,
propose-remediation, get-remediation.
Deployment
Layer | Location |
Container image |
|
Helm chart |
|
Namespace, Alertmanager route and secret sync |
|
Cloud infrastructure |
|
See the startup runbook and enabling live execution.
Documentation
Runbooks: startup, monitoring, incident response, remediation failure, enabling live execution, rollback, disaster recovery
License
Apache-2.0
This server cannot be deployed
Maintenance
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Authenticated MCP server for ClearPolicy policy and compliance workflows.
One MCP endpoint for your company's tools, with per-person sign-in, policy and audit.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceTurns OpenAPI specs into MCP tools with secure defaults, risk inspection, confirmation gates, response limits, audit logging, and secret redaction.-
- FlicenseNot gradedqualityDmaintenanceExposes DevOps/SRE operations like Kubernetes pod status, Prometheus metrics queries, and deploy history as tools for MCP-compatible clients.-
- AlicenseAqualityDmaintenanceExposes an observability REST API as MCP tools, enabling incident investigation through automated correlation of deploys with errors, log and metrics queries.6MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that provides guarded, audited, read-only access to ops tooling (alerts, metrics, logs, deploys, runbooks) and a triage agent that diagnoses incidents end-to-end with CI-verified root cause analysis.MIT