Urgent.News

What's breaking now, across thousands of outlets.

Tech

MCP vs Code Mode for SREs: From Individual Tool Calls to Intelligent Incident Investigation

Imagine you're on call. Your application suddenly starts returning HTTP 500 errors. You have Prometheus for metrics, Loki for logs, Kubernetes for workload information, and GitHub for deployments. You ask an LLM: Why did our application start returning 5xx errors around 10:30 AM? The LLM needs to investigate several things: Query Prometheus to identify when the error rate increased. Check whether…

According to the source, Model Context Protocol (MCP) and Code Mode are two separate concepts that help LLMs investigate incidents. MCP provides a standard interface for LLMs to connect to external tools and data sources, while Code Mode allows the LLM to write and execute code to orchestrate these tools.

MCP simplifies integration by offering a consistent way for LLMs to access tools like Prometheus, Loki, Kubernetes, and GitHub. It eliminates the need for custom implementations for each tool and handles authentication and API endpoints. For example, an SRE monitoring server can expose tools such as query_prometheus, query_loki, get_pod_status, and get_recent_deployments through MCP.

Code Mode, on the other hand, enables LLMs to write code that orchestrates the tools provided by MCP. Instead of the LLM making multiple individual tool calls and processing intermediate data, Code Mode generates Python code that performs the orchestration. The generated code can query Prometheus for error rates, search Loki for errors within a specific time window, retrieve relevant Kubernetes information, and generate a compact summary.

The main difference between MCP and Code Mode lies in their purposes. MCP focuses on exposing tools to LLMs, while Code Mode handles the orchestration of these tools using generated code. Code Mode acts as an architectural pattern, not a separate protocol that replaces MCP. It allows for more efficient data processing, reduced context responses, and greater flexibility in combining tools and performing custom processing.

In summary, MCP and Code Mode serve different functions in incident investigation for SREs. MCP provides a standardized interface for LLMs to access tools, while Code Mode enables LLMs to write code that orchestrates these tools, improving efficiency and flexibility in the investigation process.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Markdown Is Not HTML, But It Was Born to Become It

Markdown Is Not HTML, But It Was Born to Become It Every README, every GitHub issue, every docs page you have ever written in Markdown ends up as HTML. That is not an accident.

  • Markdown converts cleanly to HTML
  • Created by John Gruber in 2004
  • GitHub Flavored Markdown adds tables, task lists, autolinks

I made ER diagrams with the fewest line crossings, and proved it

I was modelling the ER diagram for a new project, and it got messy quickly once I had to share it with other people. Lines crossed everywhere, and nobody could follow which table pointed where.

  • Author developed ER diagram layout tool called erlayout
  • Tool minimizes line crossings and proves optimality
  • Demonstrated 2 crossings for Sakila database vs 8 standard

Let your computer read your draft back to you

I can reread a paragraph five times and still miss the word I typed twice. My eyes know what I meant to write, so they fill in the gaps. My ears are much less forgiving.

  • Computer text-to-speech reveals draft errors
  • Convert Markdown to plain text for reading
  • Automate reading process for consistent edits

More from Saturday 31 October →