Last9 MCP
Ask your agent to bring production context to your local environment, debug issues, and fix them.
What is Model Context Protocol?
MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.
Using MCP, the agent in your preferred IDE (Cursor, Windsurf, VS Code) or Claude desktop app can talk to Last9 (or other various products) to fetch additional information.
Why use Last9 MCP?
The core idea was, how do we help with developer productivity?
The Last9 MCP server lets developers bring in context of real-time production issues to their local dev environment and let the agent auto-suggest fixes to their codebase based on the production obeservability data.
Gone are the days of “but this works on my machine”. Read more in our launch blogpost.
Get Started
-
Send logs, metrics, & traces to Last9 using the OpenTelemetry integration
-
Install the Last9 MCP server
# Add the Last9 tapbrew tap last9/tap# Install the Last9 MCP CLIbrew install last9-mcp# Install globallynpm install -g @last9/mcp-server# Or run directly with npxnpx @last9/mcp-server -
Connect to the Last9 MCP server
- Open the Claude Desktop app
- Go to Settings, then Developer, click Edit Config
- Open the claude_desktop_config.json file
- Copy and paste the server config to your existing file, then save
- Restart Claude, if already running
{"mcpServers": {"last9": {"command": "/opt/homebrew/bin/last9-mcp","env": {"LAST9_AUTH_TOKEN": "your_auth_token","LAST9_BASE_URL": "https://otlp.last9.io"}}}}- Cursor
- Navigate to Settings, then Cursor Settings
- Select MCP on the left
- Click Add new global MCP server at the top right
- Copy and paste the server config to your existing file, then save
{"mcpServers": {"last9": {"command": "/opt/homebrew/bin/last9-mcp","env": {"LAST9_AUTH_TOKEN": "your_auth_token","LAST9_BASE_URL": "https://otlp.last9.io"}}}}- Open Windsurf
- Go to Settings, then Developer
- Click Edit Config
- Open the windsurf_config.json file
- Copy and paste the server config to your existing file, then save
{"mcpServers": {"last9": {"command": "/opt/homebrew/bin/last9-mcp","env": {"LAST9_AUTH_TOKEN": "your_auth_token","LAST9_BASE_URL": "https://otlp.last9.io"}}}} -
Vibe
MCP Tools
Tools are a powerful primitive in the Model Context Protocol (MCP) that enable servers to expose executable functionality to clients. Through tools, LLMs can interact with external systems, perform computations, and take actions in the real world.
The agent will have to context to call these tools on its own. Currently supported tools/use cases:
-
get_exceptions
: Retrieves server-side exceptions over a specified time range.Parameters:
limit
(integer, optional): Maximum number of exceptions to return. Default: 20lookback_minutes
(integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15start_time_iso
(string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to use lookback_minutesend_time_iso
(string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to default to current timespan_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 forlookback_minutes
(integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15start_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 forseverity
(string, optional): Severity of the logs to getlookback_minutes
(integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15start_time_iso
(string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to use lookback_minutesend_time_iso
(string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to default to current timelimit
(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 PlaneParameters:
name
(string, required): Name of the drop rulefilters
(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 escapedvalue
(string, required): The value to filter againstoperator
(string, required): The operator used for filtering. Valid values:- “equals”
- “not_equals”
- conjunction (string, required): The logical conjunction between filters. Valid values:
- “and”
-
More coming soon…
Demo
Troubleshooting
Please get in touch with us on Discord or Email if you have any questions.