
Spanlens
io.github.spanlens由 GitHub 帳號 spanlens 發布v0.3.0更新於 Oct 27, 2026
Query Spanlens LLM observability from Cursor, Claude Desktop, or Continue via MCP.
概覽
Spanlens MCP 伺服器讓助理查詢你的 Spanlens LLM 可觀測性工作區,取得花費、請求、追蹤、異常與節省建議。
- 可以做什麼
- 取得總花費、請求數、token 用量、延遲與錯誤率,可依模型或供應商分組
- 依模型、供應商、狀態、使用者、時間範圍與筆數篩選個別 LLM 請求
- 列出代理追蹤摘要,並取得單一追蹤的完整 span 樹
- 查詢平台偵測到的花費、延遲與錯誤率異常,可調整觀察視窗與靈敏度
- 取得模型替換的節省建議,以及依終端使用者的用量明細
- 適用情境
- 適合已將 LLM 使用資料送入 Spanlens,並希望在 Cursor、Claude Desktop 或 Continue 中直接詢問花費、延遲、錯誤、追蹤或成本異常,而不必開啟儀表板的使用者。
- 執行需求
- 透過 npx 從 npm 套件以 stdio 在本機執行,需要 Node.js。需在 SPANLENS_API_KEY 提供 Spanlens 公開範圍 API 金鑰,缺少金鑰或使用完整存取金鑰時伺服器會拒絕啟動。需要連線 Spanlens API 的網路;SPANLENS_BASE_URL 可指向自架實例,SPANLENS_TIMEOUT_MS 設定每次呼叫逾時。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Spanlens,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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.
來源:packages/mcp-server/README.md,提交 e825a7e
工具
0版本歷史
2- v0.3.0最新Sep 28, 2026
- v0.2.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分