Skip to main content
Glama
incident-commander-mcp

incident-commander-mcp

by hashirR786

incident-commander-mcp

AI-powered incident management MCP server built for the NitroStack Hackathon.

NitroStack TypeScript MCP


⚠️ R12 Disclosure — Simulated Integrations

All data returned by this MCP server is entirely mocked and stored in-memory.

There are NO real connections to:

  • Kubernetes / container orchestration platforms

  • Grafana / Prometheus / any metrics backend

  • GitHub / GitLab / any version control system

  • PagerDuty / OpsGenie / any alerting system

  • Stripe or any payment processor

This is a demo for hackathon evaluation purposes. The realistic-looking data is seeded with a purposeful incident scenario (deploy at 14:02 → error spike at 14:03) to demonstrate agent reasoning capabilities over MCP tools, resources, and prompts.


Related MCP server: mttrly

Overview

incident-commander-mcp is a single MCP server built on the NitroStack TypeScript framework (@nitrostack/core). It exposes tools, resources, and prompts that enable an AI agent to:

  1. Investigate production incidents by querying deployment history, error logs, and metrics

  2. Reason about root causes using cross-correlated data

  3. Act (with human approval) by requesting rollbacks or creating incident tickets

  4. Document incidents via structured postmortem prompts


Capabilities

🔧 Tools (8)

Tool

Description

Annotation

get_recent_deployments

Recent deployments, optionally filtered by service

readOnly

get_service_logs

Error logs for a service within a time window

readOnly

get_service_metrics

Latency, error rate, CPU/memory time-series

readOnly

check_pod_status

Kubernetes pod readiness and restart counts

readOnly

analyze_root_cause

Cross-correlates deploy + logs + metrics → hypothesis

readOnly

trigger_rollback

Submits a rollback request (requires human approval)

destructive

create_incident_ticket

Creates a new in-memory incident record

—

post_status_update

Appends a timeline entry to an incident

—

📦 Resources (4)

URI

Description

incident://current

Active incident snapshot (JSON)

incident://{id}/timeline

Timeline for a specific incident

deployments://recent

Last 20 deployments across all services

service://{name}/health

Health snapshot for one service

💬 Prompts (3)

Prompt

Arguments

Description

root_cause_investigation

service, symptom

Guides structured RCA with tool call sequence

postmortem_report

incident_id

Generates a blameless postmortem

rollback_decision

service, target_version

Risk/benefit analysis before rollback


Incident Scenario (Demo)

The seeded data tells a realistic story:

14:00 UTC  — payment-service healthy: error_rate 0.2%, latency 45ms
14:02 UTC  — payment-service v2.4.1 deployed (commit a3f8c21d)
14:03 UTC  — Error spike: "Cannot read properties of undefined (reading 'stripeId')"
14:03 UTC  — error_rate jumps to 28%, latency spikes to 320ms
14:04 UTC  — Pods begin CrashLoopBackOff, 7 restarts
14:05 UTC  — error_rate: 91%, latency: 1450ms, API Gateway circuit breaker opens

An agent reasoning over get_recent_deployments → get_service_logs → get_service_metrics → analyze_root_cause should produce a hypothesis pointing to v2.4.1 as the culprit with ~0.90 confidence.


Quick Start

# 1. Clone / navigate to project
cd incident-commander-mcp

# 2. Install dependencies (already done by CLI)
npm install

# 3. Start development server
npm run dev

Building for Production

npm run build
npm start

Built with NitroStack ⚡

Available Tools

8 tools
analyze_root_causeA
Read-onlyIdempotent

Performs automated root cause correlation for a service exhibiting a given symptom. Internally cross-references recent deployments, error logs, and service metrics to produce a structured hypothesis: {likely_cause, confidence (0–1), evidence[]}. This is the primary reasoning tool — call it after collecting data with get_recent_deployments, get_service_logs, and get_service_metrics. Confidence above 0.7 suggests high certainty.

Inputs: service (required), symptom (required).

check_pod_statusA
Read-onlyIdempotent

Checks the current Kubernetes pod/container status for a service. Returns desired vs ready replica counts, restart count, pod phase (Running, CrashLoopBackOff, etc.). A pod_phase of "CrashLoopBackOff" combined with high restarts is a strong indicator of a bad deploy. Use this alongside get_service_metrics to assess service health during an incident.

Inputs: service (required).

create_incident_ticketA

Creates a new incident ticket and appends it to the in-memory incident registry. Use this when a new issue is detected that warrants formal tracking. Returns the generated ticket ID and the full incident object. IMPORTANT: This tool appends a new record — calling it twice creates two tickets. Check for existing incidents with the incident://current resource before creating a new one.

Inputs: title (required), severity (required), description (required).

get_recent_deploymentsA
Read-onlyIdempotent

Retrieves the most recent deployments across all services, or filtered by a specific service name. Use this tool first during incident investigation to check whether any recent deployment correlates with an observed symptom. Each result includes service name, version, commit SHA, deployment time, and who triggered the deploy.

Inputs: limit, service.

get_service_logsA
Read-onlyIdempotent

Retrieves error logs for a specific service within a time window. Use this to identify error messages, stack traces, and patterns after a symptom is observed. Filter by log level to focus on ERROR/FATAL entries during an incident. The "since_minutes" parameter looks back N minutes from the current simulation time (14:06 UTC).

Inputs: service (required), level, since_minutes.

get_service_metricsA
Read-onlyIdempotent

Retrieves time-series performance metrics for a specific service: latency (ms), error rate (0–1), CPU usage (0–1), memory usage (0–1), and requests per second. Use this to identify performance degradation trends and correlate them with deployments or incidents. Look for sudden spikes in error_rate or latency_ms following a deployment.

Inputs: service (required), since_minutes.

post_status_updateA

Appends a timeline entry to an existing incident record. Use this to log investigation findings, actions taken, or status changes during an ongoing incident. Requires a valid incident_id (e.g., "INC-2026-0042"). The message will be timestamped and attributed to "incident-commander-mcp".

Inputs: message (required), incident_id (required).

trigger_rollbackA
Destructive

Submits a rollback request for a service to a target version. IMPORTANT: This tool does NOT immediately execute the rollback. It returns a pending_approval object with a rollback_id that must be reviewed and approved by a human operator before any deployment action is taken. Call analyze_root_cause first to confirm the target version is safe to roll back to. Required fields: service name and target_version (e.g., "v2.4.0").

Inputs: service (required), target_version (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool targets a distinct data type or action: deployments, logs, metrics, pod health, root cause analysis, rollback, ticket creation, and status updates. There is no overlap in purpose, and the descriptions clarify the unique role of each tool.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with lowercase snake_case: get_recent_deployments, check_pod_status, analyze_root_cause, trigger_rollback, create_incident_ticket, post_status_update, etc. The naming convention is uniform and predictable.

    Tool Count5/5

    With 8 tools, the server is well-scoped for incident management. It provides a balanced set of investigation, analysis, action, and documentation tools without unnecessary redundancy or overwhelming volume.

    Completeness4/5

    The tool set covers the core incident lifecycle: investigate (deployments, logs, metrics, pods), analyze (root cause), act (rollback), and document (create ticket, post updates). A minor gap is the lack of a tool to list or retrieve existing incident details, though the incident://current resource partially addresses this.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers