Read-only access to Spanlens LLM observability data: request logs, costs, agent traces and anomalies.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add spanlens --env SPANLENS_API_KEY='<SPANLENS_API_KEY>' -- npx -y @spanlens/mcp-server~/.codex/config.toml
[mcp_servers.spanlens]
command = "npx"
args = ["-y", "@spanlens/mcp-server"]
env = { SPANLENS_API_KEY = "<SPANLENS_API_KEY>" }
# codex mcp add spanlens --env SPANLENS_API_KEY='<SPANLENS_API_KEY>' -- npx -y @spanlens/mcp-server~/.cursor/mcp.json
{
"mcpServers": {
"spanlens": {
"command": "npx",
"args": [
"-y",
"@spanlens/mcp-server"
],
"env": {
"SPANLENS_API_KEY": "<SPANLENS_API_KEY>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"spanlens": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@spanlens/mcp-server"
],
"env": {
"SPANLENS_API_KEY": "<SPANLENS_API_KEY>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"spanlens": {
"command": "npx",
"args": [
"-y",
"@spanlens/mcp-server"
],
"env": {
"SPANLENS_API_KEY": "<SPANLENS_API_KEY>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"spanlens": {
"command": "npx",
"args": [
"-y",
"@spanlens/mcp-server"
],
"env": {
"SPANLENS_API_KEY": "<SPANLENS_API_KEY>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"spanlens": {
"command": "npx",
"args": [
"-y",
"@spanlens/mcp-server"
],
"env": {
"SPANLENS_API_KEY": "<SPANLENS_API_KEY>"
}
}
}
}Environment variables
SPANLENS_API_KEY
Replace the placeholders with your own credentials and keep them out of version control.