AgentLens — Claude Code MCP server: audit and setup
AgentLens collects AI agent events and exposes them through an API and web dashboard. Use it to inspect tool calls and check whether the event log has changed.
claude mcp add agentlens -- npx -y @agentkitai/agentlens-mcpWhat AgentLens does
AgentLens receives agent activity, including tool calls, sessions, and other events. You can inspect the records through its API or web dashboard. Each event is linked to the previous one with SHA-256, so a changed, removed, or reordered record breaks verification and can be identified.
The MCP server install command uses npx to run @agentkitai/agentlens-mcp. AgentLens can also run as a standalone service: the quick setup uses SQLite, while the full stack uses Postgres and Redis. Docker is required for the audit-chain demo. Editing a stored event breaks verification, so the log’s integrity depends on keeping its records intact.
What it helps with
- capture agent sessions and tool calls
- inspect agent events through an API or dashboard
- detect edits, deletions, or reordered audit records
- export a verifiable audit snapshot with
GET /api/audit/verify/export
Example prompts for the agent
- Show the sessions and tool calls recorded by AgentLens.
- Check the AgentLens audit chain and report any broken records.
- Export a verifiable audit snapshot with
GET /api/audit/verify/export.
How to install AgentLens
Platform CLI
claude mcp add agentlens -- npx -y @agentkitai/agentlens-mcpPlatform CLI
codex mcp add agentlens -- npx -y @agentkitai/agentlens-mcpConfig file
{
"mcpServers": {
"agentlens": {
"command": "npx",
"args": [
"-y",
"@agentkitai/agentlens-mcp"
]
}
}
}Config file
{
"servers": {
"agentlens": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@agentkitai/agentlens-mcp"
]
}
}
}Platform CLI
gemini mcp add agentlens npx -y @agentkitai/agentlens-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about AgentLens
How do I install AgentLens in Claude Code?
Run claude mcp add agentlens -- npx -y @agentkitai/agentlens-mcp to add the MCP server.
What does AgentLens do?
It collects AI agent events and makes them available through an API and web dashboard. Its SHA-256 chain lets you check whether log records have been altered.
How does AgentLens detect changes to the audit log?
Each event is linked to the one before it with SHA-256. Changing, deleting, or reordering an event causes chain verification to fail.