Lens MCP server
Lens serves a read-only MCP endpoint at /lens/mcp, so a coding agent can look up its own runs: list traces, open one with its steps and cost, and read its turns. It is part of the Lens server, so there is nothing to install and it always matches your Lens version.
Add it to Claude Code
For standalone Lens, use the Lens address and LENS_ADMIN_TOKEN:
claude mcp add --transport http lens http://localhost:4318/lens/mcp \
--header "Authorization: Bearer <LENS_ADMIN_TOKEN>"
For Lens connected to LiteLLM, use your gateway address and a LiteLLM key instead. The gateway forwards the request to Lens signed in as that key's user:
claude mcp add --transport http lens https://<your-litellm-proxy>/lens/mcp \
--header "Authorization: Bearer <your LiteLLM key>"
Run claude mcp list and check that lens shows as connected. Then ask something that needs trace data, such as "Use Lens to find my most recent trace and tell me what it cost".
Any MCP client that speaks Streamable HTTP works the same way: send JSON-RPC with POST to /lens/mcp and the same Authorization header.
Credentials
The endpoint takes the same credentials as the trace read API. LENS_ADMIN_TOKEN reads every trace, and whoever runs the Lens deployment holds it. Through the gateway, a LiteLLM key returns only the traces its user and their teams may see. A tracing key can only send traces, so it is rejected here with 401.