Skip to main content
MCP server CX Codex

mcp-server · spanlens — Claude Code MCP server: use and install

This MCP server lets an IDE agent query Spanlens observability data, including LLM spend, traces, errors, and anomalies. Use it when investigating model usage.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env SPANLENS_API_KEY=<SPANLENS_API_KEY> --env SPANLENS_BASE_URL=<SPANLENS_BASE_URL> --transport stdio mcp-server -- npx -y @spanlens/mcp-server
Open on GitHub

What mcp-server does

mcp-server connects an agent to a Spanlens workspace through MCP. Its seven tools cover spend and token summaries, individual request searches, trace discovery, and full span trees. The server also reports detected cost or latency anomalies, suggests model swaps, and breaks usage down by end user.

Set SPANLENS_API_KEY to a sl_live_pub_* credential before starting it. Startup checks the key scope, and a full-access sl_live_* key is rejected because the credential is stored in an IDE configuration file. The package runs with npx -y @spanlens/mcp-server; self-hosted Spanlens instances can use SPANLENS_BASE_URL.

Stats can be grouped by model or provider, while request searches accept filters such as status, user, and time range. The server will not start without a public-scope key, so create that credential before configuring the MCP entry.

What it helps with

  • inspect LLM spend by model or provider
  • spot unusual cost and latency patterns
  • find failed calls for a selected model
  • trace an agent run down to its spans
  • compare model swaps with projected savings

Example prompts for the agent

  • Show our LLM spend for this week, grouped by provider.
  • Find recent cost or latency anomalies in Spanlens.
  • List failed calls for gpt-4o, then inspect trace abc123….

How to install mcp-server

Platform CLI

claude mcp add --env SPANLENS_API_KEY=<SPANLENS_API_KEY> --env SPANLENS_BASE_URL=<SPANLENS_BASE_URL> --transport stdio mcp-server -- npx -y @spanlens/mcp-server

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about mcp-server

How do I install mcp-server in Claude Code?

Run claude mcp add mcp-server -e SPANLENS_API_KEY=<SPANLENS_API_KEY> -- npx -y @spanlens/mcp-server. Use a public-scope key.

What does mcp-server do?

It gives an MCP-connected agent read access to Spanlens data about LLM costs, tokens, latency, errors, requests, and agent traces.

Which API key does mcp-server require?

Use a sl_live_pub_* key from the Public Keys section. The server rejects a full sl_live_* key, while the public key cannot call proxy or ingest operations.

Similar MCP servers

All MCP servers for AI and ML →

mcp-server by other authors comes first.

mcp-server HeyPuter Connects your AI agent to Puter for files, websites and workers. Useful when the project already lives in Puter's cloud. CX Codex +1 ★ 43,872repo stars mcp-server mapbox Connects Mapbox location APIs to your AI assistant for geocoding, multi-modal routing, and map rendering. Helpful when building travel planners or spatial query assistants. CX Codex +1 ★ 363repo stars mcp-server PackmindHub Connects team engineering playbooks and shared coding standards from Packmind directly to AI coding agents. CX Codex +1 ★ 319repo stars mcp-server BingoWon Search Apple developer documentation and WWDC transcripts, with results ranked for relevance to your question. Useful when an agent needs API references or coding context. CX Codex +1 ★ 121repo stars mcp-server UI5 Connects SAPUI5 and OpenUI5 developer tooling to AI assistants. Helps scaffold apps, inspect manifest schemas, and run linters directly in chat. CX Codex +1 ★ 104repo stars MCP Toolbox for Databases official googleapis Connect an AI agent to databases through MCP to inspect schemas, run queries, and write code informed by the database structure. CX Codex +1 ★ 16,717repo stars labelhead-artist-momentum paperclipai This MCP server reports momentum scores for trending hip-hop artists across four cultural dimensions. Use it when an agent needs music trend data. CX Codex +1 ★ 107,423repo stars Agent Skills Search Server agentskills Searches and discovers agent skills in the skills.sh registry over an HTTP MCP endpoint. Helps an assistant find specialized workflows on demand. CX Codex +1 ★ 26,559repo stars Skyvern Skyvern-AI Connects coding agents to vision-based browser automation via Playwright. Useful for submitting forms, clicking UI elements, and extracting data without brittle selectors. CX Codex +1 ★ 23,263repo stars Nhost nhost This MCP server connects an AI assistant to an Nhost project's GraphQL API. Users authenticate with Nhost Auth, and their permissions govern data access. CX Codex +1 ★ 9,366repo stars PraisonAI MervinPraison Autonomous agent framework with reflection and MCP support. It orchestrates multi-agent tasks directly inside your coding workflow. CX Codex +1 ★ 9,289repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor