Last9 MCP Server: Real-Time Production Logs & Traces
Bring real-time production logs, metrics, and traces into your local environment with the Last9 MCP server to auto-fix code faster.
npx -y @last9/last9-mcp-serverOverview
Last9 MCP Server implements the Model Context Protocol (MCP) to bring live production context — logs, metrics, and traces — directly into AI-enabled developer workflows. By connecting observability data to local MCP-capable tools and agents, you can surface real-time signals inside code assistants (Claude, Cursor, VS Code, etc.) to speed debugging and automate fixes with accurate, up-to-date context.
The project supports two modes: a hosted HTTP endpoint (recommended for speed and OAuth-based auth) and a self-hosted local binary running over STDIO (for environments that disallow direct HTTP or require local control). The server coordinates authentication with Last9, streams relevant telemetry, and exposes a set of MCP tools so agents can query and interact with production context from within the developer environment.
GitHub: https://github.com/last9/last9-mcp-server
Features
- Real-time production context: logs, metrics, and tracing data streamed into MCP clients
- Hosted HTTP mode with OAuth-based sign-in (no local token required)
- Self-hosted STDIO binary for offline or restricted environments
- Client-ready configurations for Claude, Cursor, VS Code, Windsurf and more
- Simple refresh-token auth for self-hosted use
- Portable installs: Homebrew, NPM, and pre-built release archives
Installation / Configuration
Quick note: choose hosted HTTP unless you need a local binary or your MCP client only supports STDIO.
Hosted (fastest, OAuth-based)
- Find your org slug in the Last9 URL: app.last9.io/<org_slug>/…
- Use this MCP URL in your client:
https://app.last9.io/api/v4/organizations/<org_slug>/mcp
Example: add to Claude Code
Cursor config (JSON)
VS Code (user settings)
Self-hosted (STDIO) — install options
Homebrew
# run:
NPM
# or run inline:
GitHub Releases
| Platform | Archive name pattern |
|---|---|
| Windows x64 | last9-mcp-server_Windows_x86_64.zip |
| Linux x64 | last9-mcp-server_Linux_x86_64.tar.gz |
| macOS arm64 | last9-mcp-server_Darwin_arm64.tar.gz |
Self-hosted credentials
- Create a Refresh Token with Write permissions from Last9: app.last9.io/settings/api-access
- Provide the token via environment variable: LAST9_REFRESH_TOKEN
Example STDIO client config (generic JSON)
For NPM-based invocation set command to npx and args to ["-y","@last9/mcp-server@latest"].
Available Tools / Resources
The MCP server exposes production observability tools that MCP-enabled clients and agents can use:
- Logs: tail, query, and paginate recent logs for a service or request
- Metrics: timeseries charts, thresholds, and recent anomalies
- Traces: fetch traces and spans for sampled requests, jump to spans for debugging
- Links: quick navigation to Last9 UI entries (incidents, traces, logs)
- Authentication: OAuth for hosted mode; refresh-token for self-hosted
See the project repository for code, examples, and release binaries: https://github.com/last9/last9-mcp-server
Use Cases
- Debugging a production error: open your code assistant (Claude/Cursor/VS Code Chat), connect the Last9 MCP server, and ask for recent errors for service X. The agent can show live logs and example traces related to the error, accelerating root cause identification.
- Auto-fix pull requests: an AI agent can correlate a failing test locally with recent production traces and propose a targeted code change, including exact span IDs and log snippets as evidence.
- Postmortem investigation: during incident review, stream metrics and tail logs directly into your editor or agent, annotate the timeline, and save links to traces and incidents for the runbook.
- Restricted environments: run the STDIO binary on a bastion or local workstation with a refresh token — no public HTTP endpoint required.
Getting Help & Contributing
- Read the repo README and issue tracker on GitHub: https://github.com/last9/last9-mcp-server
- Open an issue for bugs, feature requests, or ask for client-specific examples (Claude, Cursor, VS Code).
- Contributions via PRs are welcome — follow the repo contribution guidelines.
This guide should get you started connecting real-time Last9 observability into MCP-enabled developer tooling so agents and code assistants can act on accurate production context.