Showing posts with label Vibe Coding. Show all posts
Showing posts with label Vibe Coding. Show all posts

Tuesday, November 24, 2026

From Local Beans to an Official MCP Agent Registry: Building a Distributed, Human-on-the-Loop AIOps Governance Platform

From Local Beans to an Official MCP Agent Registry: Building a Distributed, Human-on-the-Loop AIOps Governance Platform
AIOps Model Context Protocol MCP Registry Spring AI Jaeger Milvus RAG NVIDIA Jetson Orin Human-in-the-Loop Vibe Coding

From Local Beans to an Official MCP Agent Registry: Building a Distributed, Human-on-the-Loop AIOps Governance Platform

Transparency Disclaimer: I did not write a single line of code for this project. Every Java class, Docker Compose configuration, MCP server registration manifest, and frontend script in the aiops-governance-orchestrator repository was generated by Google AI based on my architectural requirements, iterative testing, and operational feedback.

1. Why Hardcoded Agents Hit a Wall

In Phase 1 of building the AIOps Governance Operations Center, all specialist agents—telemetry scouts, latency/error analysts, and remediation executors—lived as local Spring @Component beans inside a single JVM (:8085). While convenient for an initial prototype, coupling agents inside one application meant adding a new diagnostic specialist or upgrading an agent required recompiling and redeploying the entire orchestrator.

In Phase 2, the platform evolved into a distributed, polyglot agent ecosystem powered by the Official Model Context Protocol (MCP) Registry (:8090). Specialist agents now run as standalone containerized MCP servers (:8091, :8092, :8093), self-publish their capabilities and routing metadata on startup, and are discovered dynamically at runtime over MCP Server-Sent Events (SSE).

AIOps Governance & Official MCP Registry Distributed Architecture
Figure 1: Distributed AIOps Governance Architecture with Official MCP Registry (:8090), Standalone MCP Agents (:8091–:8093), Jaeger, Milvus, and NVIDIA Jetson Orin GPU.

2. Complete Service & Port Reference

Component Port Role in the Architecture
aiops-governance-orchestrator :8085 Core control plane, Operations Center Web UI, TelemetryScoutAgent, McpRegistryClient, and PolicyGatekeeperAgent.
Official MCP Registry :8090 Upstream Go-based MCP Registry (modelcontextprotocol/registry) serving POST /v0/publish and GET /v0/servers.
Registry PostgreSQL :5433 Stores published ServerJSON manifests, SSE URLs, tool names, match keywords, and routing priorities.
security-analyst-mcp :8091 Standalone Spring AI MCP server specializing in admin, auth, and forbidden span anomalies (priority: 5).
latency-analyst-mcp :8092 Standalone Spring AI MCP server specializing in latency SLO violations and HTTP 5xx errors (priority: 10).
remediation-executor-mcp :8093 Standalone Spring AI MCP executor handling approved actions (OPEN_CIRCUIT_BREAKER, CLEAR_CACHE).
geo-time-mcp-server :8083 Monitored Spring Boot microservice exposing /api/admin/remediate for live circuit-breaker control.
jaeger-aiops-guardian :8084 MCP bridge querying Jaeger traces and exposing structured span summaries to TelemetryScoutAgent.
Jaeger UI / Query :16686 / :16685 Distributed trace ingestion, visualization, and span latency/error lookup.
Milvus Vector DB / Attu :19530 / :8000 Vector storage for application-specific runbooks and SLO evaluation criteria (Attu provides the visual UI).
NVIDIA Jetson Orin (Ollama) :11434 Edge GPU inference running qwen2.5:3b for root-cause diagnosis and nomic-embed-text for RAG embeddings.

3. End-to-End Incident Detection & Execution Flow

During a governance scan, the orchestrator coordinates telemetry inspection, dynamic agent discovery, edge GPU reasoning, and human sign-off—recording exact millisecond durations for every stage and every Jaeger span segment.

End-to-End AIOps Incident Detection, MCP Discovery & Human-on-the-Loop Approval Sequence
Figure 2: Step-by-step incident detection, MCP Registry discovery, Jetson Orin GPU inference, and Human-on-the-Loop remediation sequence with real execution timings.
Stage 1 • Scout
39 ms
TelemetryScoutAgent queries Jaeger and extracts anomalous spans.
Stage 2 • MCP Analyst
~1.5 s warm
latency-analyst-mcp (:8092) diagnoses root cause on Jetson Orin GPU (12,411 ms cold model load).
Stage 3 • HITL Gate
< 1 ms
PolicyGatekeeperAgent pauses execution until an operator approves in the UI.
Stage 4 • MCP Executor
157 ms
remediation-executor-mcp (:8093) opens the circuit breaker on timeapi.

4. Architectural Deep Dive

What Agent Registry Is Used?

The platform runs the Official Model Context Protocol (MCP) Registry (modelcontextprotocol/registry on :8090) backed by PostgreSQL (:5433). On startup, each Spring Boot MCP agent (:8091, :8092, :8093) obtains a registry token via POST /v0/auth/none, validates its manifest against the 2025-12-11 MCP schema, and registers via POST /v0/publish. Custom routing metadata—role (ANALYST or EXECUTOR), toolName, matchKeywords, allowedActions, priority, and internalSseUrl—is stored inside _meta["io.modelcontextprotocol.registry/publisher-provided"].

How Do Jaeger and Milvus Fit Into the Architecture?

  • Jaeger (:16686) — Real-Time Anomaly Detection: Monitored applications export OpenTelemetry spans to Jaeger. During a scan, TelemetryScoutAgent fetches spans exceeding the app's sloMaxLatencyMs threshold or carrying error=true, attaching each segment (operationName, durationMs, hasError, and clickable traceId) directly to the incident card.
  • Milvus (:19530) — Context-Aware Runbook RAG: Operators upload runbooks or remediation policies in the UI (+ Upload Criteria (Milvus)). CriteriaKnowledgeService embeds the rules via nomic-embed-text on the Jetson Orin GPU and stores them in Milvus. Before calling a remote MCP analyst, the orchestrator retrieves the top matching runbook rules via vector similarity search so the LLM's recommendation respects service-specific constraints.

Where Are Jaeger Traces & Metrics Stored?

In the local Docker Compose stack, Jaeger runs as jaegertracing/all-in-one, storing trace spans in memory for fast, zero-setup local testing (traces clear when the container restarts). For persistent storage in production, switching Jaeger's SPAN_STORAGE_TYPE environment variable moves trace storage to Badger (local disk volume), Elasticsearch / OpenSearch, or Cassandra with zero changes to instrumented applications.

How Do You Adjust an Application's SLO?

  1. Open the Operations Center at http://localhost:8085 and locate the service under Onboarded Spring Boot Apps.
  2. Click Edit SLO & Policy to open the policy modal.
  3. Update Latency SLO Threshold (ms) (sloMaxLatencyMs), Allowed Actions, Evaluation Criteria, or the Require Human-on-the-Loop Approval toggle, then click Save Policy & SLO (POST /api/governance/apps).
  4. Subsequent governance scans immediately evaluate Jaeger spans against the updated SLO threshold.

Can You Onboard C#, Node.js, or Python Web Apps?

Yes — the orchestrator is completely language-agnostic. Any C# (.NET ASP.NET Core), Node.js (Express / NestJS), Python (FastAPI), or Go web service can be monitored as long as it fulfills two lightweight contracts:

  1. Export OpenTelemetry Traces to Jaeger: Configure the standard OpenTelemetry SDK/auto-instrumentation for C#, Node.js, or Python to export OTLP traces to Jaeger (http://localhost:4317 or :4318) with service.name matching the onboarded app name.
  2. Expose a Remediation Webhook: Expose an HTTP POST endpoint (such as /api/admin/remediate) accepting {"action": "...", "component": "..."} to toggle circuit breakers, flush caches, or adjust rate limits.
// Example C# ASP.NET Core Minimal API Remediation Webhook
app.MapPost("/api/admin/remediate", (RemediationRequest req) =>
{
    if (req.Action == "OPEN_CIRCUIT_BREAKER") CircuitBreakerState.Open(req.Component);
    if (req.Action == "CLEAR_CACHE") MemoryCacheManager.Clear(req.Component);
    return Results.Ok(new { status = "APPLIED", component = req.Component, action = req.Action });
});
// Example Node.js Express Remediation Webhook
app.post('/api/admin/remediate', (req, res) => {
  const { action, component } = req.body;
  if (action === 'OPEN_CIRCUIT_BREAKER') circuitBreakers.open(component);
  if (action === 'CLEAR_CACHE') caches.flush(component);
  res.json({ status: 'APPLIED', component, action });
});

5. Source Code Repository

Explore the full source code, Docker Compose manifests, and standalone MCP agent implementations on GitHub:
https://github.com/htotapally/aiops-governance-orchestrator.git