Autonomous SRE Agent for Cloud Infrastructure Monitoring Using FastMCP

fuzzylabs · Tech · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Cloud infrastructure incident diagnosis

FuzzyLabs wanted an autonomous SRE agent that could triage production incidents end to end by inspecting Kubernetes, GitHub, and Slack context, then posting a diagnostic summary without manual tool-driving.

Constraints:

Architecture

FuzzyLabs built a custom FastMCP client around Claude and three MCP server integrations: Kubernetes for pods/logs, GitHub for source files, and Slack for reporting. CloudWatch or Slack triggers start the loop; the LLM decides which troubleshooting tools to call; the MCP client dispatches calls and returns observations; the agent diagnoses the cart-service incident, fetches RedisCartStore.cs, drafts a fix recommendation, and posts to Slack. Tool caching, filtering, a five-minute timeout, and stop conditioning make the proof of concept operationally bounded.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  cloudwatch-trigger[CloudWatch trigger] --> mcp-client[MCP client]
  slack-trigger[Slack trigger] --> mcp-client
  mcp-client --> claude-llm[Claude LLM]
  claude-llm --> mcp-client
  mcp-client --> kubernetes-mcp-server[Kubernetes MCP Server]
  mcp-client --> github-mcp-server[GitHub MCP Server]
  mcp-client --> slack-mcp-server[Slack MCP Server]
  kubernetes-mcp-server --> online-boutique-app[Online boutique app]
  github-mcp-server --> online-boutique-app
  mcp-client --> tool-cache[Tool cache]
  timeout-controller[Timeout controller] --> mcp-client
  slack-mcp-server --> slack-trigger
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
CloudWatch trigger Detects critical service errors and starts the agent workflow. MCP client
Slack trigger Alternative manual/chat trigger and reporting destination. MCP client, Slack MCP Server
MCP client Custom FastMCP client that packages LLM decisions into tool calls and returns observations. CloudWatch trigger, Slack trigger, Claude LLM, Kubernetes MCP Server, GitHub MCP Server, Slack MCP Server, Tool cache, Timeout controller
Claude LLM Reasoning layer that plans troubleshooting actions and generates the diagnosis. MCP client
Kubernetes MCP Server Lists pods and retrieves logs for the target service. MCP client, Online boutique app
GitHub MCP Server Fetches source files such as RedisCartStore.cs for code-level diagnosis. MCP client, Online boutique app
Slack MCP Server Posts diagnostic summaries and recommendations to the team. MCP client, Slack trigger
Online boutique app Fault-injected microservice demo used as the incident testbed. Kubernetes MCP Server, GitHub MCP Server
Tool cache Caches tool definitions and message history to reduce diagnosis cost. MCP client
Timeout controller Stops reasoning loops after five minutes or after Slack posting. MCP client

Data flow

A CloudWatch CRITICAL 500 alert or Slack trigger sends a prompt to the MCP client. The LLM chooses tools, the client calls Kubernetes, GitHub, and Slack MCP servers, Kubernetes logs identify RedisCartStore.cs, GitHub provides the file, and Slack receives the diagnostic summary and recommendation. Caching, tool filtering, timeout, and stop conditioning constrain cost and autonomy.

3 supporting quotes
“A Cloudwatch trigger starts the agent (also directly trigger-able via Slack). 2. The trigger sends a prompt to the MCP client, outlining its responsibility to diagnose issues.”article, stated
“The MCP client invokes tools from MCP servers (Slack, GitHub, Kubernetes) and returns responses to the LLM. 5.”article, stated
“It fetches the file from GitHub for additional context and drafts a fix. 8. Finally, it posts a diagnosis and recommendation in Slack.”article, stated

Why this architecture

FuzzyLabs built its own MCP client because off-the-shelf AI applications limited autonomy through token gates and manual tool-call acceptance. MCP gives a clean perception-action loop across Kubernetes, GitHub, and Slack, while caching, filtering, timeout, and stop conditioning address cost, security surface, and runaway-loop risks.

3 supporting quotes
“these tools required users to accept tool calling on the agents behalf, removing full autonomy from the application.”article, stated
“The MCP client packages those decisions into calls, dispatches them, then feeds results back to the LLM, closing the perception-action loop.”article, stated
“* Enforced agent timeout: we enforce a five-minute timeout on the agent where we stop the agents reasoning loop if doesn't terminate in this time period.”article, stated

Models used: Anthropic Claude · FastMCP client · MCP servers

Scale

Alternatives considered (roads not taken)

Use Claude Desktop or an existing MCP client

Rejected because: Token usage gatekeeping and manual tool-call acceptance prevented full autonomous workflows.

“Whilst Claude Desktop provided an entry point into developing our own agent, we found that Anthropic would gate-keep token usage making it difficult to perform full agentic workflows.”article, stated
“these tools required users to accept tool calling on the agents behalf, removing full autonomy from the application.”article, stated

Expose all community MCP tools

Rejected because: Unneeded tools increase security risk and token usage.

“* Tool filtering: We used community build MCP servers but we didn’t need all the tools they provided. This not only mitigated a security risk of using tools we don’t need but it also reduced our potential token usage of the LLM (reducing costs).”article, stated
“This not only mitigated a security risk of using tools we don’t need but it also reduced our potential token usage”article, stated

Let the agent reason until completion with no explicit stop

Rejected because: Runaway reasoning loops waste cost and can get stuck.

“This stops the agent from getting stuck and continuing unnecessarily. * Stop conditioning: we enforce that the agent stop once it has sent a message to the Slack channel, this stops the agent from continuing its reasoning loop unnecessarily.”article, stated
“* Stop conditioning: we enforce that the agent stop once it has sent a message to the Slack channel, this stops the agent from continuing its reasoning loop unnecessarily.”article, stated

Patterns

tool-use-orchestration (incident-response)

The MCP client coordinates Kubernetes, GitHub, and Slack tools from LLM decisions.

“The MCP client invokes tools from MCP servers (Slack, GitHub, Kubernetes) and returns responses to the LLM.”article, stated

semantic-caching (cost)

Tool definitions and message history are cached to reduce repeated LLM cost.

“caching repetitive information like the tools and message history can have a significant impact on cost.”article, stated

safety-policy-enforcement (runtime)

Tool filtering, timeout, and stop conditioning define boundaries on autonomous action.

“Tool filtering provides both security and efficiency benefits by limiting the agent to only necessary tools”summary, stated

observability-tracing (sre)

The workflow begins from CloudWatch errors and inspects Kubernetes logs to diagnose incidents.

“AWS CloudWatch detects the CRITICAL 500 error and alerts the agent.”article, stated

human-in-the-loop-gate (operations)

The current system posts diagnosis and recommendations rather than directly remediating production.

“Finally, it posts a diagnosis and recommendation in Slack.”article, stated

Tradeoffs

Build a custom MCP client

Chose FastMCP client directly calling Anthropic over Claude Desktop or other application clients.

Rationale: A custom client removes manual tool-call acceptance and enables autonomous SRE behavior.

“tailoring it towards our goal of an autonomous SRE agent. To do this we implemented our own MCP client”article, stated

Filter available tools

Chose only necessary MCP tools over all tools from community MCP servers.

Rationale: Filtering reduces both attack surface and token usage.

“This not only mitigated a security risk of using tools we don’t need but it also reduced our potential token usage of the LLM”article, stated

Stop after diagnosis in Slack

Chose diagnostic recommendation over automatic remediation.

Rationale: The team has not yet resolved security, effectiveness, and cost questions for broader authority.

"research areas.

  1. Effectiveness: Does the agent actually do what it’s meant to?"
“If we want the agent to go beyond diagnosis and start fixing issues on its own, how do we manage that safely?”article, stated

Gotchas (what bit them)

Existing MCP clients blocked full autonomy.

Root cause: They imposed token usage limits and required users to accept tool calls.

Resolution: FuzzyLabs implemented a custom FastMCP client that calls Anthropic directly.

“A key area of exploration as part of this work was to remove the training wheels provided by these AI applications.”article, stated
“we implemented our own MCP client using FastMCP”article, stated

Unbounded agent loops can waste cost and stall.

Root cause: Autonomous reasoning may continue after sufficient work or fail to terminate.

Resolution: The client enforces a five-minute timeout and stops after Slack posting.

“we enforce a five-minute timeout on the agent where we stop the agents reasoning loop if doesn't terminate in this time period.”article, stated
“we enforce that the agent stop once it has sent a message to the Slack channel”article, stated

Security boundaries become harder when moving from diagnosis to remediation.

Root cause: Giving agents authority to fix systems expands what malicious users or bad calls can exploit.

Resolution: The team keeps security as a research area before expanding remediation authority.

“If we want the agent to go beyond diagnosis and start fixing issues on its own, how do we manage that safely?”article, stated

Effectiveness evaluation is unresolved.

Root cause: It is not obvious how to measure whether an SRE agent performs its intended functions meaningfully.

Resolution: FuzzyLabs lists effectiveness measurement as a next research area.

“Does the agent actually do what it’s meant to? And how do we measure that in a meaningful way?”article, stated

Evaluation

FuzzyLabs evaluates the proof of concept through a fault-injected online boutique microservice incident, a step-by-step CloudWatch-to-Slack diagnosis trace, and operational measurements such as tool-caching cost reduction, timeout behavior, and open research questions around effectiveness/security/cost.

Metrics: latest 1000 Kubernetes pod logs checked · 83% cost-per-diagnosis reduction from caching · five-minute timeout · HTTP 500 cart-service simulated incident · three research areas: effectiveness, security, cost

3 supporting quotes
“we forked Google’s “online boutique” micro-service demo and introduced deliberate application and system errors.”article, stated
“implementing this caching reduced our cost per-diagnose by 83%.”article, stated
“The agent prompt specifies: check the latest 1000 Kubernetes pod logs”article, stated

Outcomes

This is a controlled proof of concept, not a broad production deployment. The concrete metrics are the latest-1000-log workflow, 83% caching cost reduction, and five-minute timeout.

3 supporting quotes
“I've identified an issue in the cartservice application. The problem appears to be located in the RedisCartStore.cs file.”article, stated
“Recommendation: If this is intended behavior, consider adding proper error handling and user feedback.”article, stated
“We’ll dig into each of these areas in separate blog posts and link them here once they’re live.”article, stated