Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

last9-mcp-server

MCP.Pizza Chef: last9

Last9 MCP Server is a Model Context Protocol server that integrates real-time production context such as logs, metrics, and traces into local development environments. It enables AI agents to access detailed service data, exceptions, and logs to accelerate debugging and auto-fixing of code. Compatible with Claude, Cursor, Windsurf, and VSCode, it supports tools like get_exceptions, get_service_graph, get_logs, and get_drop_rules for comprehensive observability.

Use This MCP server To

Fetch real-time exceptions for debugging Retrieve service graphs to analyze endpoint dependencies Filter and access logs by service and severity Obtain log drop rules to understand log filtering Integrate production telemetry into local IDEs Enable AI-assisted auto-fixing with live context Visualize service health and trace data in development Correlate logs and traces for root cause analysis

README

Last9 MCP Server

last9 mcp demo

A Model Context Protocol server implementation for Last9 that enables AI agents to seamlessly bring real-time production context — logs, metrics, and traces — into your local environment to auto-fix code faster.

Status

Works with Claude desktop app, or Cursor, Windsurf, and VSCode (Github Copilot) IDEs. Implements the following MCP tools:

  • get_exceptions: Get the list of exceptions.
  • get_service_graph: Get service graph for an endpoint from the exception.
  • get_logs: Get logs filtered by service name and/or severity level.
  • get_drop_rules: Get drop rules for logs that determine what logs get filtered out at Last9 Control Plane
  • add_drop_rule: Create a drop rule for logs at Last9 Control Plane

Tools Documentation

get_exceptions

Retrieves server-side exceptions over a specified time range.

Parameters:

  • limit (integer, optional): Maximum number of exceptions to return. Default: 20.
  • lookback_minutes (integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15.
  • start_time_iso (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to use lookback_minutes.
  • end_time_iso (string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to default to current time.
  • span_name (string, optional): Name of the span to filter by.

get_service_graph

Gets the upstream and downstream services for a given span name, along with the throughput for each service.

Parameters:

  • span_name (string, required): Name of the span to get dependencies for.
  • lookback_minutes (integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15.
  • start_time_iso (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to use lookback_minutes.

get_logs

Gets logs filtered by optional service name and/or severity level within a specified time range.

Parameters:

  • service (string, optional): Name of the service to get logs for.
  • severity (string, optional): Severity of the logs to get.
  • lookback_minutes (integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15.
  • start_time_iso (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to use lookback_minutes.
  • end_time_iso (string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to default to current time.
  • limit (integer, optional): Maximum number of logs to return. Default: 20.

get_drop_rules

Gets drop rules for logs, which determine what logs get filtered out from reaching Last9.

add_drop_rule

Adds a new drop rule to filter out specific logs at Last9 Control Plane

Parameters:

  • name (string, required): Name of the drop rule.
  • filters (array, required): List of filter conditions to apply. Each filter has:
    • key (string, required): The key to filter on. Only attributes and resource.attributes keys are supported. For resource attributes, use format: resource.attributes[key_name] and for log attributes, use format: attributes[key_name] Double quotes in key names must be escaped.
    • value (string, required): The value to filter against.
    • operator (string, required): The operator used for filtering. Valid values:
      • "equals"
      • "not_equals"
    • conjunction (string, required): The logical conjunction between filters. Valid values:
      • "and"

Installation

You can install the Last9 Observability MCP server using either:

Homebrew

# Add the Last9 tap
brew tap last9/tap

# Install the Last9 MCP CLI
brew install last9-mcp

NPM

# Install globally
npm install -g @last9/mcp-server

# Or run directly with npx
npx @last9/mcp-server

Configuration

Environment Variables

The Last9 MCP server requires the following environment variables:

  • LAST9_BASE_URL: (required) Last9 API URL from OTel integration
  • LAST9_AUTH_TOKEN: (required) Authentication token for Last9 MCP server from OTel integration
  • LAST9_REFRESH_TOKEN: (required) Refresh Token with Write permissions, needed for accessing control plane APIs from API Access

Usage with Claude Desktop

Configure the Claude app to use the MCP server:

  1. Open the Claude Desktop app, go to Settings, then Developer
  2. Click Edit Config
  3. Open the claude_desktop_config.json file
  4. Copy and paste the server config to your existing file, then save
  5. Restart Claude
{
  "mcpServers": {
    "last9": {
      "command": "/opt/homebrew/bin/last9-mcp",
      "env": {
        "LAST9_BASE_URL": "<last9_otlp_host>",
        "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
        "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
      }
    }
  }
}

Usage with Cursor

Configure Cursor to use the MCP server:

  1. Open Cursor, go to Settings, then Cursor Settings
  2. Select MCP on the left
  3. Click Add "New Global MCP Server" at the top right
  4. Copy and paste the server config to your existing file, then save
  5. Restart Cursor
{
  "mcpServers": {
    "last9": {
      "command": "/opt/homebrew/bin/last9-mcp",
      "env": {
        "LAST9_BASE_URL": "<last9_otlp_host>",
        "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
        "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
      }
    }
  }
}

Usage with Windsurf

Configure Windsurf to use the MCP server:

  1. Open Windsurf, go to Settings, then Developer
  2. Click Edit Config
  3. Open the windsurf_config.json file
  4. Copy and paste the server config to your existing file, then save
  5. Restart Windsurf
{
  "mcpServers": {
    "last9": {
      "command": "/opt/homebrew/bin/last9-mcp",
      "env": {
        "LAST9_BASE_URL": "<last9_otlp_host>",
        "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
        "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
      }
    }
  }
}

Usage with VS Code

Note: MCP support in VS Code is available starting v1.99 and is currently in preview. For advanced configuration options and alternative setup methods, view the VS Code MCP documentation.

  1. Open VS Code, go to Settings, select the User tab, then Features, then Chat
  2. Click "Edit settings.json"
  3. Copy and paste the server config to your existing file, then save
  4. Restart VS Code
{
  "mcp": {
    "servers": {
      "last9": {
        "type": "stdio",
        "command": "/opt/homebrew/bin/last9-mcp",
        "env": {
          "LAST9_BASE_URL": "<last9_otlp_host>",
          "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
          "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
        }
      }
    }
  }
}

Badges

MseeP.ai Security Assessment Badge

last9-mcp-server FAQ

How does Last9 MCP Server integrate with local development environments?
It connects via MCP to IDEs like VSCode and apps like Claude, providing real-time production context directly in your workspace.
What types of data can I access through Last9 MCP Server?
You can access exceptions, service graphs, logs filtered by service or severity, and log drop rules.
Can Last9 MCP Server help automate code fixes?
Yes, by providing AI agents with live telemetry and error context, it enables faster and more accurate auto-fixing.
Is Last9 MCP Server compatible with multiple AI platforms?
Yes, it works with Claude, OpenAI, Gemini, and other MCP-compatible AI clients.
How does Last9 MCP Server improve debugging workflows?
It centralizes production logs, metrics, and traces in your local environment, reducing context switching and speeding root cause analysis.
What MCP tools does Last9 MCP Server implement?
It implements get_exceptions, get_service_graph, get_logs, and get_drop_rules tools for comprehensive observability.
Does Last9 MCP Server support filtering logs?
Yes, logs can be filtered by service name and severity level to focus on relevant data.
Where can I find demos or more information about Last9 MCP Server?
You can view a demo on YouTube and read the announcement blog post linked in the GitHub repository.