Last9

Last9

A Model Context Protocol server that streams real-time production context (logs, metrics, traces) to developers for auto

46
Stars
8
Forks
16
Releases

Overview

Last9 MCP Server is a Model Context Protocol server implementation for Last9 that enables AI agents to fetch real-time production context—logs, metrics, and traces—into local development environments to accelerate debugging and automated code fixes. It exposes a comprehensive set of MCP tools across Observability, Prometheus metrics, logs, traces, change events, and alerts, allowing clients to query service health, performance, environments, and operational details. Observability & APM tools (get_exceptions, get_service_summary, get_service_environments, get_service_performance_details, get_service_operations_summary, get_service_dependency_graph) provide both high-level summaries and deep dives into throughput, error rates, and dependencies. Prometheus/PromQL tools (prometheus_range_query, prometheus_instant_query, prometheus_label_values, prometheus_labels) enable range/instant queries and label discovery for metric-driven debugging. Logs Management tools (get_logs, get_drop_rules, add_drop_rule, get_service_logs, get_log_attributes) support advanced log queries and attribute discovery. Traces Management tools (get_traces, get_service_traces, get_trace_attributes) enable JSON-pipeline trace queries and per-service traces. Additional capabilities cover Change Events (get_change_events) and Alerts (get_alert_config, get_alerts). Installation supports Homebrew and NPM, with environment-variable configuration for Last9 and OTLP, plus HTTP mode for development debugging. Curl examples and deployment guidance are provided for testing and integration.

Details

Owner
last9
Language
Go
License
Apache License 2.0
Updated
2025-12-07

Features

Observability & APM Tools

Access server-side utilities for get_exceptions, get_service_summary, get_service_environments, get_service_performance_details, get_service_operations_summary, and get_service_dependency_graph to assess health and performance.

Prometheus/PromQL Tools

Execute prometheus_range_query and prometheus_instant_query, and discover label values/labels via prometheus_label_values and prometheus_labels for metric-driven workflows.

Logs Management

Fetch aggregated logs, manage drop rules, retrieve raw service logs, and inspect log attributes with get_logs, get_drop_rules, add_drop_rule, get_service_logs, and get_log_attributes.

Traces Management

Perform advanced trace queries and retrieve traces by trace ID or service, plus trace attribute discovery using get_traces, get_service_traces, and get_trace_attributes.

Change Events

Retrieve last9_change_events within a time window to monitor deployments, config changes, and other system modifications.

Alert Management

Fetch alert configurations and currently active alerts from Last9 monitoring with get_alert_config and get_alerts.

Installation & Configuration

Flexible installation via Homebrew or NPM and environment-variable configuration (Last9 tokens, OTLP endpoint/headers) to tailor the MCP server for your environment.

Development & HTTP Mode

HTTP mode for development/debugging, with curl testing examples and guidance for running and testing the MCP server.

Audience

DevelopersLeverage production context (logs, metrics, traces) in IDEs to rapidly debug and auto-fix code.
AI agentsProvide real-time production data to AI agents for context-aware diagnosis and automated fixes.
Observability engineersAccess comprehensive service metrics and logs to monitor, triage, and validate changes across environments.

Tags

MCPLast9ObservabilityAPMLogsTracesPrometheusPromQLOpenTelemetryControl PlaneAI-assisted debuggingDevToolsIDE integration