- Home
- MCP servers
- Last9
Last9
- go
50
GitHub Stars
go
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You deploy a Last9 MCP Server to bring real-time production context — logs, metrics, and traces — into your local environment so AI agents can analyze and auto-fix code faster. This guide gives you practical, end-to-end steps to connect, configure, and use the MCP server with your preferred client and workflow.
How to use
You can connect to the Last9 MCP Server using either the hosted HTTP transport or a local STDIO server. The HTTP option requires a client token and lets your MCP client reach Last9’s API endpoint directly. The STDIO option runs a local MCP server binary or npm package that your MCP client can connect to on your machine. Choose the method that fits your workflow and security needs.
How to install
Prerequisites: you should have a modern shell, and access to either the hosted HTTP endpoint or a local runtime for the STDIO server (see below). If you plan to run a local MCP server, you can install via Homebrew or via Node Package Manager (NPM). Then configure your MCP client to point at the local server or the hosted HTTP URL.
Recommended path: use the hosted MCP over HTTP to avoid running a local binary. If you must run locally, choose one of these options.
Step-by-step options follow for the two primary installation approaches.
# Hosted HTTP transport setup is configured in your MCP client
# No local binary necessary. Use a client token to authenticate.
# Configuration examples are shown in the next sections.
Additional installation options
Local STDIO installation lets you run the MCP server on your machine. You can install via Homebrew or via NPM, then run the server locally and point your MCP client to the local process.
Security and credentials
Use a securely generated Client Token for hosted MCP access. If you are using a local STDIO server, use a Refresh Token with Write permissions. Do not expose tokens in public or shared environments. Store tokens in secure environment variables or secret managers.
Configuration overview
The MCP server supports two primary connection modes: hosted HTTP transport and local STDIO. In the HTTP mode, your client connects to a remote URL with a bearer token. In STDIO mode, your client launches a local server process and communicates over standard input/output.
Notes and best practices
• For best reliability, prefer the hosted HTTP transport when possible to avoid local binary management. • If you need local execution, ensure you provide the required refresh/token credentials and environment variables as described for your platform. • When switching between HTTP and STDIO, update your MCP client configuration to the corresponding URL/command and restart the client.
Troubleshooting
If you encounter connection issues, verify that the correct URL or command is configured, confirm tokens are valid and not expired, and ensure the MCP server process has the necessary permissions to access tokens and network resources.
Examples of common usage
Use the hosted HTTP transport when you want to avoid running a local MCP server. If you must run locally, start the STDIO server with your token and point your client to localhost. Configure the client to pass the appropriate authorization header for HTTP or to connect to the local STDIO process.
What you can do with the MCP server
Access the full range of Last9 MCP tools to retrieve and analyze observability data, including exceptions, service performance details, traces, logs, Prometheus queries, alerts, and change events. These capabilities enable rapid context-rich debugging and faster, more informed fixes.
Usage with Claude Desktop, Cursor, Windsurf, and VS Code
You can configure each client to connect to the MCP server using the provided configuration examples. After updating the client settings, restart the client to apply the new MCP connection.
Next steps
- Choose HTTP or STDIO as your connection method.
- Gather the required credentials (Client Token for hosted HTTP, Refresh Token for local STDIO).
- Add the MCP server configuration to your client.
- Restart the client and start using the MCP tools to query logs, metrics, and traces.
Configuration
Managed HTTP transport (recommended)
- Set header X-LAST9-API-TOKEN with a Bearer token in your MCP client configuration. Local STDIO server environment variables
- LAST9_REFRESH_TOKEN is required to run the server locally. Optional: enable telemetry by adjusting LAST9_DISABLE_TELEMETRY and OTEL_EXPORTER_OTLP_* variables if you use an OpenTelemetry collector.
Usage notes for clients
Configure your MCP client to point to the hosted URL or to the local STDIO command. The hosted URL is provided in the configuration examples and the local STDIO command is shown for each supported installation method.
Available tools
get_exceptions
Get the list of exceptions within a specified time range.
get_service_summary
Get service throughput, error rate, and response time summary for a time window.
get_service_environments
Get available environments for services.
get_service_performance_details
Get detailed performance metrics for a service over a time range.
get_service_operations_summary
Get a summary of operations inside a service.
get_service_dependency_graph
Get the service dependency graph showing dependencies.
prometheus_range_query
Execute a Prometheus range query for metrics data.
prometheus_instant_query
Execute a Prometheus instant query for metrics data.
prometheus_label_values
Get label values for a PromQL filter query.
prometheus_labels
Get available labels for a PromQL query.
get_logs
Get logs filtered by service name and severity.
get_drop_rules
Get drop rules for logs at Last9 Control Plane.
add_drop_rule
Create a new drop rule to filter out specific logs.
get_service_logs
Get raw log entries for a specific service over a time range.
get_log_attributes
Get available log attributes (labels) for a time window.
get_traces
Retrieve traces using JSON pipeline queries.
get_service_traces
Retrieve traces by trace ID or service name within a time range.
get_trace_attributes
Get available trace attributes (series) for a time window.
get_change_events
Get change events from the last9_change_events metric.
get_alert_config
Get alert configurations from Last9.
get_alerts
Get currently active alerts from Last9 monitoring system.