AgentLens
概览
作者提供的说明(英文原文)
Tamper-evident, SHA-256 hash-chained audit trail and observability for AI agents.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i2 项中通过 2 项依据公开信息检查;尚未扫描代码
- 使用情况i起步阶段↓ 49/周 · ★ 25
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 开发者工具
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:2 项中通过 2 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你需要
- npm已安装 Node.js(用于 npx 命令)
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"agentlens": {
"command": "npx",
"args": [
"-y",
"@agentkitai/agentlens-mcp"
]
}
}
}在终端中运行这条命令
claude mcp add agentlens -- npx -y @agentkitai/agentlens-mcp或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"agentlens": {
"command": "npx",
"args": [
"-y",
"@agentkitai/agentlens-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"agentlens": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@agentkitai/agentlens-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月10日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 agentkitai 验证,该账户拥有此仓库
- ✓ 通过
仍在维护
代码最后更新于16天前
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“开发者工具”中的其他服务器比较i
- 星标数多于此分类中其他 5723 个服务器的 93%
- 发布到注册中心的时间比此分类中其他 5723 个服务器的 19% 更新
- 基础检查结果等于或优于此分类中其他 5723 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
AgentLens 安全吗?
它在 2 项适用的基础检查中通过了 2 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于16天前,最新版本(0.13.7)于5个月前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:REA, Netdata, Front-End Checklist
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Netdata
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Front-End Checklist
Review frontend code and live pages against 386 quality-gated web development rules.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
🔍 AgentLens
Open-source observability for AI agents — with a tamper-evident audit trail
Every event SHA-256 hash-chained & cryptographically verifiable — built for EU AI Act Article 12 record-keeping
📖 Documentation · Quick Start · Dashboard · ☁️ Cloud
📑 Table of Contents
- Tamper-Evident by Design
- Quick Start
- Architecture
- Integration Guides
- Key Features
- Dashboard
- AgentLens Cloud
- Packages
- API Overview
- CLI
- Development
- Contributing
- AgentKit Ecosystem
- License
AgentLens is a flight recorder for AI agents. It captures every LLM call, tool invocation, approval decision, and error — then presents it through a queryable API and real-time web dashboard.
🔒 Tamper-evident by design
What sets AgentLens apart from other observability tools: every event is SHA-256 hash-chained to the one before it, the same way git commits and blockchains are linked. The audit log is append-only and cryptographically verifiable — alter, delete, or reorder a single record after the fact and verification fails, pointing at the exact event that broke. Purpose-built for the record-keeping obligations of EU AI Act Article 12 and the emerging IETF Agent Audit Trail work.
See it for yourself in 30 seconds (needs Docker):
git clone https://github.com/agentkitai/agentlens && cd agentlens
./demo/aha.sh
1/5 Starting AgentLens (SQLite, zero-config)… ✓ up at http://localhost:3400
2/5 Ingesting a 5-event agent trace… ✓ 5 events ingested 3/5 Verifying the hash chain… ✓ CHAIN VALID — no tampering detected 4/5 Tampering with one event in the database… ✓ altered llm_call (changed the logged model) 5/5 Re-verifying the hash chain… ✗ CHAIN BROKEN — tampering detected ✅
The demo ingests a real trace, verifies the chain (passes), edits one record directly in the database behind the audit log's back, then re-verifies (fails). Auditors get a signed, verifiable JSON snapshot from GET /api/audit/verify/export.
Five ways to integrate — pick what fits your stack:
| Integration | Language | Effort | Capture |
|---|---|---|---|
| 🔭 [OpenTelemetry](#-opentelemetry-any-genai-agent--no-sdk) | Any | Point your OTLP exporter | Any gen_ai.*-instrumented agent — no AgentLens SDK |
| 🤖 [OpenClaw Plugin](#-openclaw-plugin) | OpenClaw | Copy & enable | Every Anthropic call — prompts, tokens, cost, tools — zero code |
| 🐍 [Python Auto-Instrumentation](#-python-auto-instrumentation) | Python | 1 line | Every OpenAI / Anthropic / LangChain call — deterministic |
| 🔌 [MCP Server](#-mcp-integration) | Any (MCP) | Config block | Tool calls, sessions, events from Claude Desktop / Cursor |
| 📦 [SDK](#-programmatic-sdk) | Python, TypeScript | Code | Full control — log events, query analytics, build integrations |
🚀 Quick Start
One command — server + dashboard on SQLite, zero config:
docker run -p 3400:3400 -e AUTH_DISABLED=true -e JWT_SECRET=dev-secret ghcr.io/agentkitai/agentlens
Open http://localhost:3400
Or without Docker:
npx @agentkitai/agentlens-server
http://localhost:3400 with SQLite — zero config
AUTH_DISABLED=trueis for a quick local trial (JWT_SECRETis still required by the hardened image). For anything shared, dropAUTH_DISABLED, set a realJWT_SECRET, and create an API key (below).
Full stack (Postgres + Redis, auth, TLS) — runs from source:
git clone https://github.com/agentkitai/agentlens && cd agentlens
cp .env.example .env docker compose up
production overlay (auth, restart policies):
docker compose -f docker-compose.yml -f docker-compose.prod.yml up
Create an API Key
curl -X POST http://localhost:3400/api/keys \
-H "Content-Type: application/json" \ -d '{"name": "my-agent"}'
Save the als_... key from the response — it's shown only once. Then head to the Integration Guides to instrument your agent.
🏗️ Architecture
graph TB
subgraph Agents["Your AI Agents"] PY["Python App (OpenAI, Anthropic, LangChain)"] MCP_C["MCP Client (Claude Desktop, Cursor)"] TS["TypeScript App"] OC["OpenClaw Plugin"] end
PY -->|"agentlensai.init() auto-instrumentation"| SERVER MCP_C -->|MCP Protocol| MCP_S["@agentkitai/agentlens-mcp"] MCP_S -->|HTTP| SERVER TS -->|"@agentkitai/agentlens-sdk"| SERVER OC -->|HTTP| SERVER
subgraph Server["@agentkitai/agentlens-server"] direction TB INGEST[Ingest Engine] QUERY[Query Engine] ALERT[Alert Engine] LLM_A[LLM Analytics] HEALTH[Health Scoring] COST[Cost Optimizer] REPLAY[Session Replay] BENCH[Benchmark Engine] GUARD[Guardrails] end
SERVER --> DB[(SQLite / Postgres)] SERVER --> DASH["Dashboard (React SPA)"]
EXT["AgentGate / FormBridge"] -->|Webhook| SERVER
🔧 Integration Guides
🔭 OpenTelemetry (any GenAI agent — no SDK)
If your agent is already instrumented with the [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) — via OpenLLMetry, OpenInference, or the official OTel instrumentations — just point its OTLP exporter at AgentLens. No AgentLens SDK required.
# Send standard OTLP/HTTP to AgentLens (JSON or protobuf, /v1/traces)
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:3400 export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:3400/v1/traces
AgentLens maps gen_ai.* spans into its model and into the tamper-evident audit log:
OTel GenAI span (gen_ai.operation.name) | Becomes |
|---|---|
chat / text_completion / generate_content | a paired llm_call + llm_response (model, provider, messages, usage.input_tokens/output_tokens, finish reason, latency, cost) |
execute_tool | tool_call (gen_ai.tool.name, gen_ai.tool.call.id, arguments) |
embeddings | embedding event with token usage |
invoke_agent / create_agent | agent-invocation event |
Each OTel trace maps to a session (or gen_ai.conversation.id if present), and every event is hash-chained like any other — so traces from any GenAI framework get the same verifiable audit trail. Set OTLP_AUTH_TOKEN to require a bearer token on the OTLP endpoints in production.
Cost with no SDK: OTel GenAI instrumentation reports tokens but rarely cost. AgentLens reconstructs
costUsdfrom the model's per-1M-token pricing (fuzzy-matched on the model id), so OTel-only agents get the same cost analytics as SDK-instrumented ones — no per-call cost attribute required.
🤖 OpenClaw Plugin
If you're running OpenClaw, the AgentLens plugin captures every Anthropic API call automatically — prompts, completions, token usage, costs, latency, and tool calls.
cp -r packages/relay-plugin /usr/lib/node_modules/openclaw/extensions/agentlens-relay
openclaw config patch '{"plugins":{"entries":{"agentlens-relay":{"enabled":true}}}}' openclaw gateway restart
Set AGENTLENS_URL if your AgentLens instance isn't on localhost:3400. See the plugin README for details.
🐍 Python Auto-Instrumentation
One line — every LLM call captured automatically across 9 providers (OpenAI, Anthropic, LiteLLM, AWS Bedrock, Google Vertex AI, Google Gemini, Mistral AI, Cohere, Ollama):
pip install agentlensai[all-providers]
import agentlensai
agentlensai.init( url="http://localhost:3400", api_key="als_your_key", agent_id="my-agent", )
Every LLM call is now captured automatically
Key guarantees: ✅ Deterministic · ✅ Fail-safe · ✅ Non-blocking · ✅ Privacy (init(redact=True))
🔌 MCP Integration
For Claude Desktop, Cursor, or any MCP client — add to your config:
{
"mcpServers": { "agentlens": { "command": "npx", "args": ["@agentkitai/agentlens-mcp"], "env": { "AGENTLENS_API_URL": "http://localhost:3400", "AGENTLENS_API_KEY": "als_your_key_here" } } } }
AgentLens ships 22 MCP tools — covering core observability, intelligence & analytics, and operations. Full MCP tool reference →
📦 Programmatic SDK
Python:
pip install agentlensai
from agentlensai import AgentLensClient
client = AgentLensClient("http://localhost:3400", api_key="als_your_key") sessions = client.get_sessions() analytics = client.get_llm_analytics()
TypeScript:
npm install @agentkitai/agentlens-sdk
import { AgentLensClient } from '@agentkitai/agentlens-sdk';
const client = new AgentLensClient({ baseUrl: 'http://localhost:3400', apiKey: 'als_your_key' }); const sessions = await client.getSessions();
✨ Key Features
- 🐍 Python Auto-Instrumentation —
agentlensai.init()captures every LLM call across 9 providers automatically. Deterministic — no reliance on LLM behavior. - 🔌 MCP-Native — Ships as an MCP server. Works with Claude Desktop, Cursor, and any MCP client.
- 🔭 OpenTelemetry GenAI — Ingests
gen_ai.*OTLP traces from any OTel-instrumented agent (OpenLLMetry, OpenInference, official OTel) — no AgentLens SDK required. - 🧠 LLM Call Tracking — Full prompt/completion visibility, token usage, cost aggregation, latency measurement, and privacy redaction.
- 📊 Real-Time Dashboard — Session timelines, event explorer, LLM analytics, cost tracking, and alerting.
- 🔒 Tamper-Evident Audit Trail — Append-only event storage with SHA-256 hash chains per session.
- 💰 Cost Tracking — Track token usage and estimated costs per session, per agent, per model. Alert on cost spikes.
- 🚨 Alerting — Configurable rules for error rate, cost threshold, latency anomalies, and inactivity.
- ❤️🩹 Health Scores — 5-dimension health scoring with trend tracking.
- 💡 Cost Optimization — Complexity-aware model recommendation engine with projected savings.
- 📼 Session Replay — Step-through