Spanlens logo

Spanlens

by spanlens

Queries Spanlens LLM observability data through seven read-only MCP tools for logs, traces, costs, anomalies, and analytics.

Install Spanlens

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "spanlens-spanlens-2": {
      "command": "npx",
      "args": [
        "-y",
        "@spanlens/cli"
      ],
      "env": {
        "SPANLENS_API_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @spanlens/cli

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The spanlens/Spanlens MCP server exposes Spanlens LLM observability data to MCP clients through seven read tools. It covers request logs, agent traces, cost statistics, anomaly data, model-savings information, and per-user analytics for workloads using OpenAI, Anthropic, or Gemini. Reach for it when an agent needs to investigate LLM usage without leaving its client; Cursor and Claude Desktop are explicitly supported. The project is open source and self-hostable, with the MCP package available through npm.

Use cases

  • Inspect recent LLM request logs from an MCP client
  • Review agent traces for multi-step workflows
  • Analyze model costs and potential savings
  • Investigate latency, cost, or error anomalies
  • Compare usage analytics across end users

Key features

  • Seven read-only observability tools
  • Request log queries
  • Agent trace inspection
  • Cost and model-savings analysis
  • Anomaly queries
  • Per-user analytics

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

24/25 checks healthy over the last 104d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11h ago via OSV.dev · @spanlens/cli (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars13Stargazers on the source repository.
npm downloads219Package downloads in the last 30 days.
Last commit6d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Spanlens works

What spanlens/Spanlens does

The spanlens/Spanlens MCP server makes Spanlens observability records available to an MCP client. It is intended for inspecting LLM activity rather than sending new model requests. The available interface contains seven read tools covering request logs, agent traces, cost statistics, anomalies, model-savings data, and analytics organized by end user.

Use it when an agent needs operational context about an LLM application: which requests were made, how traces behaved, what usage cost, whether unusual activity was detected, or how usage differs between users. The underlying Spanlens product records activity across OpenAI, Anthropic, and Gemini workloads. The repository describes the server as open source and self-hostable.

How it works

The server connects an MCP client to Spanlens observability data. A client can then issue read queries through the exposed tools and receive results for investigation or analysis. The material identifies Cursor and Claude Desktop as supported clients, so the server can be used from either environment when configured as an MCP server.

The data available to the MCP layer comes from Spanlens instrumentation and integrations. Spanlens can record model, provider, latency, token, cost, request, and response information. It also supports multi-step agent tracing, cost tracking, anomaly detection, and per-user tagging.

Setup and configuration

The package name for the server is @spanlens/mcp-server. The documented launch command is:

Terminal
npx -y @spanlens/mcp-server

Configure that command in an MCP-compatible client such as Cursor or Claude Desktop.

Spanlens itself uses SPANLENS_API_KEY in its JavaScript and Python setup examples. The material does not explicitly state whether the MCP process requires that variable, how it receives the key, or whether a self-hosted endpoint needs additional settings. Confirm the MCP package documentation before deploying it with a hosted or self-hosted Spanlens instance.

Tools and capabilities

The spanlens/Spanlens MCP server provides seven read-oriented capabilities for:

  • Searching or reviewing request logs.
  • Examining agent traces.
  • Inspecting cost statistics.
  • Reviewing detected anomalies.
  • Evaluating model-savings information.
  • Analyzing activity by end user.
  • Querying observability information across supported provider workloads.

Spanlens request records can include full prompt and response bodies, streaming responses reconstructed by the platform, token counts, latency, model, provider, and cost. Agent traces can represent multi-step workflows. Per-user analytics depend on calls being tagged with Spanlens's user mechanism, such as x-spanlens-user, withUser(), or with_user().

Limitations and notes

It also does not document an MCP-specific authentication flow.

OpenAI, Anthropic, and Gemini are the providers named in the listing. The broader Spanlens project mentions additional integrations, but those should not be assumed to be direct MCP query targets without checking the server's own documentation.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Spanlens

Run `npx -y @spanlens/mcp-server`, then configure that command in an MCP client.

Yes.

Yes. Cursor is explicitly listed as a supported MCP client.

It provides seven read tools for request logs, agent traces, cost statistics, anomalies, model savings, and per-user analytics.

The listing says its observability queries cover workloads using OpenAI, Anthropic, and Gemini.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSpanlens AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/spanlens-spanlens-2?style=directory)](https://allmcps.com/mcp/spanlens-spanlens-2)
HTML Embed
<a href="https://allmcps.com/mcp/spanlens-spanlens-2"><img src="https://allmcps.com/api/badge/spanlens-spanlens-2?style=directory" alt="Spanlens on AllMCPs" /></a>