SuperAPI AI Directory

spanlens/Spanlens

Spanlens is an open-source LLM observability and monitoring tool that serves as a drop-in proxy for OpenAI, Anthropic, and Gemini, providing request logging, cost tracking, and agent trace tracking, and supports self-hosting with a single Docker command under the MIT license. Its mcp-server package lets users query observability data from a Spanlens workspace via the Model Context Protocol in Cursor, Continue, or Claude Desktop, such as this week's OpenAI spend, cost anomalies, or the most expensive trace of the day. The server only accepts read-only public-scope keys (sl_live_pub_*) and refuses to start with a full-permission key.

Open website

About this tool

Spanlens is an open-source large language model (LLM) observability and monitoring project, primarily used to help developers observe and analyze LLM calls. According to available information, it can serve as a drop-in proxy for OpenAI, Anthropic, and Gemini, providing request logging, cost tracking, and agent trace tracking, and supports self-hosting with a single Docker command under the MIT license.

The focus of this introduction is the mcp-server package (@spanlens/mcp-server) in the repository. This package is used to query LLM observability data within a Spanlens workspace via the Model Context Protocol (MCP) in IDEs or desktop clients such as Cursor, Continue, or Claude Desktop. Users can ask the agent in their IDE questions such as "What is my OpenAI spend this week", "Are there any cost anomalies", or "Show today's most expensive trace", and the agent will obtain real answers from the Spanlens workspace through this server.

Regarding usage, the information provides a "30-second setup" flow: Step one, create a public-scope Spanlens key (prefix sl_live_pub_*). Such keys are read-only and can query dashboard data but cannot trigger LLM proxy spending. The information explicitly states that the server refuses to start with a full-permission key because credentials are stored in plaintext in the IDE's configuration files. The creation location is the Public Keys card at the top of spanlens.io/projects; click "+ New public key" and copy the sl_live_pub_… value when it is displayed. Step two, add the server to the IDE. Step three, reload the IDE and start asking questions; the agent will automatically discover seven tools and use them in relevant scenarios. The information does not list the specific names and parameters of these seven tools.

Regarding security design, the information states that the server targets IDE configuration scenarios where credentials are stored in plaintext files that are prone to leakage (e.g., dotfile sync, screen sharing, accidental commits). There are two safeguards for this: first, only public-scope keys are allowed; at startup the server calls /api/v1/me/key-info to verify the keyhas scope=public, and if a full-permission sl_live_* key is pasted by mistake, the server refuses to start and gives an error pointing to the correct key type; second, the API layer is read-only, so even if a public key leaks, it cannot call /proxy/* or /ingest/*, and the Spanlens server rejects it with 403 and the PUBLIC_KEY_WRITE_FORBIDDEN code, so the impact of a leak is limited to "others seeing your usage statistics" rather than "others consuming your OpenAI bill".

The applicable scenario is mainly developers quickly querying LLM usage costs, anomalies, and trace records in an IDE or desktop client. Regarding limitations, the information does not provide specific installation commands, configuration examples, supported IDE versions, the specific list of the seven tools, pricing information, or performance data; these contents are not yet available.