Spanlens MCP Server

Spanlens SDK for Python. Agent tracing, LLM usage capture, and cost observability.

Remote serverstreamable-httpPython

What is the Spanlens MCP server?

Spanlens SDK for Python. Agent tracing, LLM usage capture, and cost observability. That is what the spanlens mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

  1. Installs @spanlens/sdk with your package manager (npm / pnpm / yarn / bun) 2. Writes SPANLENS_API_KEY to .env.local 3. Rewrites every new OpenAI({ apiKey, baseURL }) into createOpenAI()
  • Helicone — was acquired and its roadmap is uncertain
  • Langfuse — is powerful but complex to set up and expensive to scale

What it needs from you

Configuration is passed through the environment: SPANLENS_API_KEY, RESEND_API_KEY, NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY, ENCRYPTION_KEY. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Getting it running

Because this one is hosted, setup is mostly authentication — you point your client at the endpoint and approve access. Nothing runs on your machine, so there is no runtime to keep patched.

How it compares

Among the monitoring and observability options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes.

This entry was verified against Spanlens's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • Your data travels to the provider's service, so the usual questions apply about what you send and what they retain.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How to install the Spanlens MCP server

{
  "mcpServers": {
    "spanlens": {
      "command": "npx",
      "args": ["-y", "@spanlens/cli"],
      "env": {
        "SPANLENS_API_KEY": "your-value",
        "RESEND_API_KEY": "your-value",
        "NEXT_PUBLIC_SUPABASE_URL": "your-value",
        "NEXT_PUBLIC_SUPABASE_ANON_KEY": "your-value",
        "SUPABASE_URL": "your-value",
        "SUPABASE_ANON_KEY": "your-value",
        "SUPABASE_SERVICE_ROLE_KEY": "your-value",
        "ENCRYPTION_KEY": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
SPANLENS_API_KEYCredential the server authenticates with.Yes
RESEND_API_KEYCredential the server authenticates with.Yes
NEXT_PUBLIC_SUPABASE_URLEndpoint or connection string the server talks to.Yes
NEXT_PUBLIC_SUPABASE_ANON_KEYCredential the server authenticates with.Yes
SUPABASE_URLEndpoint or connection string the server talks to.Yes
SUPABASE_ANON_KEYCredential the server authenticates with.Yes
SUPABASE_SERVICE_ROLE_KEYCredential the server authenticates with.Yes
ENCRYPTION_KEYCredential the server authenticates with.Yes

Frequently asked questions

It connects Spanlens to MCP-compatible AI assistants such as Claude and Cursor. Instead of copying data back and forth by hand, the assistant works with Spanlens directly.