Model Context Protocol (MCP) Integration

Agentic AI & MCP Server (@stacklenzz/mcp)

Connect your live backend telemetry, active 5xx crash logs, distributed traces, and SLO compliance metrics directly to AI coding assistants like Cursor, Windsurf, Claude Desktop, and Antigravity.

AI-ASSISTED DEBUGGING & OBSERVABILITY
With @stacklenzz/mcp, your AI assistant can query live backend errors, inspect function stack traces, check database latency, and suggest code fixes directly in your IDE without leaving your editor.

Model Context Protocol Overview

The Model Context Protocol (MCP) is an open standard that allows LLM applications to securely access local tools and real-time operational state. The @stacklenzz/mcp package implements a standard MCP stdio server exposing 5 dedicated telemetry tools:

get_service_health

Returns real-time health score, uptime, active error rate, CPU load, and V8 heap utilization.

get_recent_errors

Retrieves recent 4xx/5xx crash logs, fingerprints, stack traces, and request breadcrumbs.

get_recent_traces

Inspects distributed trace waterfall spans (controller, middleware, database) to pinpoint latency bottlenecks.

get_slo_status

Queries SRE Target compliance (e.g. 99.5%), remaining error budget percentage, and burn rate.

🚀 Quick Start: Running the MCP Server

You can launch the MCP server over standard I/O (stdio) using npx:

Launch MCP Server over Stdio
npx -y @stacklenzz/mcp

By default, it queries your local backend stats endpoint at http://localhost:5000/api/observability/stats. You can customize the target backend using the STACKLENZZ_ENDPOINT environment variable.

⚙️ IDE & Assistant Configurations

Cursor IDE Setup (.cursor/mcp.json)

Add the following configuration to .cursor/mcp.json in your project workspace:

.cursor/mcp.json
{
  "mcpServers": {
    "stacklenzz": {
      "command": "npx",
      "args": ["-y", "@stacklenzz/mcp"],
      "env": {
        "STACKLENZZ_ENDPOINT": "http://localhost:5000/api/observability/stats"
      }
    }
  }
}

Claude Desktop Setup (claude_desktop_config.json)

Add Stacklenzz to your global Claude Desktop configuration file:

claude_desktop_config.json
{
  "mcpServers": {
    "stacklenzz-telemetry": {
      "command": "npx",
      "args": ["-y", "@stacklenzz/mcp"],
      "env": {
        "STACKLENZZ_ENDPOINT": "http://localhost:5000/api/observability/stats"
      }
    }
  }
}

💬 Example AI Assistant Prompts

Once configured, you can ask your AI coding assistant questions like:

“Check @stacklenzz/mcp for recent 5xx crash logs and suggest a fix for the failing route.”
“Fetch slow API endpoints from Stacklenzz and inspect the trace waterfall for /api/checkout.”
“What is our current SLO error budget remaining and burn rate?”