Bring real-time production logs, metrics and traces from Last9 into your local environment to fix code
Last9 MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Your AI agent doesn't know what's broken in production. This fixes that.
Last9 MCP Server connects Claude, Cursor, Windsurf, and any other MCP-capable AI assistant directly to your production observability data — logs, metrics, traces, exceptions, database queries, alerts, and deployments. The agent stops guessing and starts reading the actual signal.
- Watch the demo
- Announcement post
---
Start in 30 seconds (Hosted)
No binary to install. No tokens to manage. One URL, OAuth in your browser, done.
Find your org slug in your Last9 URL: app.last9.io/ /...
Claude Code
Type /mcp, select last9, authenticate. That's it.
Cursor
**Settings > MCP > Add New MCP Server:**
Click **Connect**, complete OAuth.
VS Code
Requires v1.99+. Open Command Palette → **MCP: Add Server**, paste the URL, authenticate.
Or directly in settings.json:
Windsurf
**Settings > Cascade > Open MCP Marketplace > gear icon (mcp_config.json):**
Claude Web/Desktop
**Settings > Connectors > Add custom connector.** Name it last9, paste the URL, authenticate.
> Requires admin access to your Claude organization.
---
Self-Hosted (STDIO)
Use this when your MCP client doesn't support HTTP transport, or when you need the server running locally.
Install
**Homebrew:**
**NPM:**
**Binary releases** (Windows / manual):
Download from GitHub Releases:
| Platform | Archive |
| --------------- | --------------------------------------- |
| Windows (x64) | last9-mcp-server_Windows_x86_64.zip |
| Windows (ARM64) | last9-mcp-server_Windows_arm64.zip |
| Linux (x64) | last9-mcp-server_Linux_x86_64.tar.gz |
| Linux (ARM64) | last9-mcp-server_Linux_arm64.tar.gz |
| macOS (x64) | last9-mcp-server_Darwin_x86_64.tar.gz |
| macOS (ARM64) | last9-mcp-server_Darwin_arm64.tar.gz |
Get a Refresh Token
Only **admins** can create tokens.
1. Go to API Access
2. Click **Generate Token** with Write permissions
3. Copy it
Client Configuration
**Homebrew:**
**NPM:**
**Where to paste this:**
| Client | Location |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| Claude Web/Desktop | Settings > Developer > Edit Config (claude_desktop_config.json) |
| Cursor | Settings > Cursor Settings > MCP > Add New Global MCP Server |
| Windsurf | Settings > Cascade > MCP Marketplace > gear icon (mcp_config.json) |
| VS Code | Wrap in { "mcp": { "servers": { ... } } } in settings.json — details |
VS Code STDIO config
For NPM: use "command": "npx" and add "args": ["-y", "@last9/mcp-server@latest"].
Windows
After downloading from GitHub Releases, extract and point to the full path:
The NPM route is easier on Windows — no path management.
Environment Variables
| Variable | Default | Description |
| ---------------------------- | -------------------- | ----------- |
| LAST9_REFRESH_TOKEN | *(required)* | Refresh token from API Access |
| LAST9_DATASOURCE | org default | Datasource/cluster name — useful when you have multiple Levitate clusters |
| LAST9_API_HOST | app.last9.io | Override the API host |
| LAST9_TOOLSETS | all tools | Comma-separated toolsets to expose (logs, traces, metrics, alerts, dashboards, profiles, grafana, investigate, all). Alias: LAST9_MCP_TOOLSETS |
| LAST9_MAX_GET_LOGS_ENTRIES | 5000 | Max entries for chunked get_logs requests |
| LAST9_USE_LOG_SEARCH_API | false | Set true to answer get_logs and get_service_logs with one server-side search call instead of client-side chunking |
| LAST9_DEBUG_CHUNKING | false | Set true to log chunk-planning details for get_logs, get_service_logs, get_traces |
| LAST9_DISABLE_TELEMETRY | true | Set false to enable internal OTel tracing |
| OTEL_SDK_DISABLED | — | Standard OTel env var. Overrides LAST9_DISABLE_TELEMETRY |
| OTEL_EXPORTER_OTLP_ENDPOINT| — | OTLP collector endpoint (only when telemetry is enabled) |
| OTEL_EXPORTER_OTLP_HEADERS | — | OTLP auth headers (only when telemetry is enabled) |
---
What It Can Do
Service Health
- **get_service_summary** — Ranked fleet (service, env) rows: interval request_count, throughput_rpm, HTTP 4xx/5xx counts, and gRPC error counts
- **get_service_environments** — Available environments for your services. Run this first — other APM tools need env from here
- **get_service_performance_details** — Full breakdown: throughput, error rate, p50/p90/p95/avg/max, apdex, availability
- **get_service_operations_summary** — Operations grouped by HTTP endpoints, DB calls, messaging, HTTP clients
- **get_service_dependency_graph** — Dependency map with throughput, latency, and error rates for upstream/downstream/infra