
Spanlens
io.github.spanlensPublished by GitHub account spanlensv0.3.0Updated Oct 27, 2026
Query Spanlens LLM observability from Cursor, Claude Desktop, or Continue via MCP.
Overview
Spanlens MCP server lets an assistant query your Spanlens LLM observability workspace for spend, requests, traces, anomalies and savings.
- What you can do
- Get aggregate cost, request count, token usage, latency and error rate, optionally grouped by model or provider
- List and filter individual LLM requests by model, provider, status, user, time window and limit
- List agent trace summaries and pull the full span tree for a single trace
- Retrieve detected cost, latency and error-rate anomalies with an adjustable window and sensitivity
- Get model-swap savings recommendations and per-end-user usage breakdowns
- When to use it
- Useful when you already send LLM usage data to Spanlens and want to ask about spend, latency, errors, traces or cost anomalies from inside Cursor, Claude Desktop or Continue instead of opening the dashboard.
- Requirements
- Runs locally over stdio via npx from the npm package, so Node.js is needed. Requires a Spanlens public-scope API key in SPANLENS_API_KEY; the server refuses to start without one or with a full-access key. Network access to the Spanlens API is required; SPANLENS_BASE_URL can point at a self-hosted instance, and SPANLENS_TIMEOUT_MS sets the per-call timeout.
Installation
In SourceWeft
- Open Spanlens in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
@spanlens/mcp-server
Query your LLM observability data from inside Cursor, Continue, or Claude Desktop. Powered by Spanlens.
Ask your IDE's agent things like "what's my OpenAI spend this week?", "any cost anomalies?", or "show me the most expensive trace today" — and get real answers from your Spanlens workspace through the Model Context Protocol.
30-second setup
1. Issue a public-scope Spanlens key
Public-scope keys (sl_live_pub_*) are read-only — they can query your dashboard data but cannot trigger LLM proxy spend. This server refuses to start with a full-access key because the credential will live in a plaintext config file in your IDE.
Create one at spanlens.io/projects → the Public Keys card at the top → + New public key. Copy the sl_live_pub_… value when it's shown.
2. Add the server to your IDE
Cursor — ~/.cursor/mcp.json (or workspace .cursor/mcp.json)
Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Continue — ~/.continue/config.yaml
3. Reload your IDE and start asking
The agent will discover seven tools and use them automatically when relevant.
What you can ask
Available tools
Safety
This server is designed for the IDE-config use case, where the credential sits in a plaintext file that's easy to leak (dotfile sync, screen shares, accidental commits). Two defenses:
- Public-scope keys only. The server boots, calls
/api/v1/me/key-infoagainst your workspace, and verifies the key hasscope=public. If you accidentally paste a full-accesssl_live_*key, the server refuses to start with a clear error pointing at the correct key type. - Read-only at the API layer. Even if a public key leaks, it cannot call
/proxy/*or/ingest/*— the Spanlens server enforces this with a 403 +PUBLIC_KEY_WRITE_FORBIDDENcode. The blast radius of a leak is "competitor sees my usage stats", not "competitor runs up my OpenAI bill".
Configuration
Self-hosted Spanlens
Links
License
MIT — see LICENSE in the repo root.
Source: packages/mcp-server/README.md at commit e825a7e
Tools
0Version history
2- v0.3.0LatestSep 28, 2026
- v0.2.1Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts