AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Agentlens

mcp-modernops888-agentlens Β· by ModernOps888

πŸ” Chrome DevTools for AI Agents. Time-travel debugging, cost tracking, and anomaly detection for multi-agent LLM workflows. MCP-native.

β€” No reviews yet
0 installs
35 views
0.0% view→install

Install

$ agentstack add mcp-modernops888-agentlens

βœ“ scanned Β· βœ“ verified, works with Claude Code, Cursor, and more.

Security review

βœ“ Passed

No issues found. Passed automated security review. Β· v0.1.0 How review works β†’

  • βœ“ Prompt-injection patterns
  • βœ“ Secret / credential exfiltration
  • βœ“ Dangerous shell & filesystem operations
  • βœ“ Untrusted network calls
  • βœ“ Known-malicious package signatures

What it can access

  • ● Network access Used
  • βœ“ Filesystem access No
  • βœ“ Shell / process execution No
  • βœ“ Environment & secrets No
  • βœ“ Dynamic code execution No

From automated source analysis of v0.1.0. β€œUsed” means the capability is present in the source β€” more access means more to trust, not that it’s unsafe.

View the full security report β†’

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-modernops888-agentlens)

Reliability & compatibility

βœ“ Security review passed
0 installs to date
β€” no reviews yet
● 3mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work β†’
Are you the author of Agentlens? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

πŸ” AgentLens

AI Agent Debugger & Replay Inspector

Chrome DevTools for AI Agents. Capture, replay, and inspect every LLM call, tool invocation, and decision in your multi-agent workflows.

[](LICENSE) [](https://nextjs.org) [](https://typescriptlang.org)


🎯 The Problem: Multi-agent AI systems are a black box. When an agent fails, burns money in a loop, or makes a bad decision β€” you have no way to see why.

πŸ’‘ The Solution: AgentLens captures every step and lets you replay, inspect, and debug the entire execution like a video player with a timeline scrubber.


✨ Features

🎬 Time-Travel Replay

Scrub through your agent's entire execution timeline. Click any step to see exactly what happened β€” the full prompt, response, tokens, cost, and decision rationale.

πŸ’° Cost Dashboard

Real-time token & cost tracking per agent, per step, per model. Know exactly where your money is going.

🚨 Anomaly Detection

Automatic detection of:

  • Infinite loops β€” Agent stuck in fixβ†’testβ†’fail cycles
  • Token escalation β€” Context window growing out of control
  • Repeated prompts β€” 85%+ similarity with previous prompts
  • Empty responses β€” Model returned nothing useful

πŸ”Œ MCP Inspector

Dedicated panel for Model Context Protocol tool invocations. See which MCP servers were called, with what params, and what they returned.

🎨 Multi-Agent Visualization

Color-coded agent badges, agent flow trees, and per-agent cost breakdowns. See your entire orchestration at a glance.

▢️ Playback Controls

Play, pause, step forward, reset. Scrub through the timeline like a video player.


πŸš€ Quick Start

git clone https://github.com/ModernOps888/agentlens.git
cd agentlens
npm install
npm run dev

Open http://localhost:3000 β€” the app ships with built-in demo data showing:

  1. Successful workflow: A 5-agent LinkedIn blog post pipeline (Orchestrator β†’ Researcher β†’ Writer β†’ Editor β†’ Publisher)
  2. Failed workflow: A coding agent caught in an infinite fix-test loop with automatic halt

πŸ”— Connect Your Agents (Python SDK)

pip install requests
from agentlens import AgentLens

# Start a trace session  
lens = AgentLens(session_name="My Agent Pipeline")

# Option A: Wrap OpenAI (automatic tracing β€” zero code changes)
from openai import OpenAI
client = lens.wrap_openai(OpenAI(), agent_name="MyAgent")
response = client.chat.completions.create(model="gpt-5.4", messages=[...])  # Updated June 2026
# ^ Every call is now traced in AgentLens!

# Option B: Wrap Anthropic (Claude)
from anthropic import Anthropic
client = lens.wrap_anthropic(Anthropic(), agent_name="ClaudeAgent")
response = client.messages.create(model="claude-sonnet-4-6", max_tokens=1024, messages=[...])  # Updated June 2026

# Option C: Wrap Google Gemini
import google.generativeai as genai
model = lens.wrap_google(genai.GenerativeModel("gemini-3.5-flash")  # Updated June 2026, agent_name="GeminiAgent")
response = model.generate_content("Explain quantum computing")

# Option D: Wrap Ollama (local LLMs β€” no package needed)
ollama = lens.wrap_ollama(agent_name="LocalLLM")
response = ollama.chat(model="llama3", messages=[{"role": "user", "content": "Hello!"}])

# Option E: Wrap LiteLLM (any provider via proxy)
import litellm
litellm.callbacks = [lens.wrap_litellm(agent_name="MultiModel")]

# Option F: Manual tracing
lens.trace_llm_call(
    agent_name="Researcher",
    model="gpt-5.4",  # Updated June 2026
    prompt="Research this topic...",
    response="Here are the findings...",
    tokens={"prompt_tokens": 150, "completion_tokens": 200, "total_tokens": 350},
)

# Trace tool calls, MCP invocations, agent spawns, decisions, errors
lens.trace_tool_call(agent_name="Coder", tool_name="file_read", tool_input={"path": "main.py"})
lens.trace_mcp_call(agent_name="Agent", server_name="web-search", tool_name="search", params={"q": "..."})
lens.trace_agent_spawn(parent_agent="Orchestrator", spawned_agent="Writer")
lens.trace_decision(agent_name="Orchestrator", reason="Quality score 9/10, proceeding")
lens.trace_error(agent_name="Coder", error_message="Test failed: assertion error")

lens.end()  # Mark session complete

> Note: Copy sdk/python/agentlens.py into your project, or add it to your Python path. The SDK sends traces to http://localhost:3000/api/ingest by default.

πŸ› οΈ REST API (any language)

# Send a trace step
curl -X POST http://localhost:3000/api/ingest \
  -H "Content-Type: application/json" \
  -d '{"session_id":"my-session","session_name":"Test","agent_name":"Agent1","step_type":"llm_call","model":"gpt-5.4","prompt":"Hello","response":"Hi there"}'

# End a session
curl -X POST "http://localhost:3000/api/ingest?action=end" \
  -H "Content-Type: application/json" \
  -d '{"session_id":"my-session","status":"completed"}'

# Get all live sessions
curl http://localhost:3000/api/ingest

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  AgentLens                   β”‚
β”‚                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Proxy   β”‚  β”‚ Recorder β”‚  β”‚  Storage   β”‚ β”‚
β”‚  β”‚ (capturesβ”‚β†’ β”‚ (structs β”‚β†’ β”‚ (SQLite /  β”‚ β”‚
β”‚  β”‚  calls)  β”‚  β”‚  traces) β”‚  β”‚  JSON)     β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚        ↑                          ↓         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Your AI  β”‚              β”‚  Web UI    β”‚   β”‚
β”‚  β”‚ Agent    β”‚              β”‚ (Timeline  β”‚   β”‚
β”‚  β”‚ Code     β”‚              β”‚  Replay    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚  Inspector)β”‚   β”‚
β”‚                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

| Component | Technology | |:----------|:-----------| | Frontend | Next.js 16 + React + TypeScript | | Styling | Vanilla CSS (dark mode, glassmorphism) | | Storage | SQLite + JSON | | Fonts | Inter + JetBrains Mono |


πŸ“Š Supported Providers & Models

| Provider | Models | Auto-Wrap | Cost Tracking | |:---------|:-------|:----------|:-------------| | OpenAI | GPT-5.4, GPT-5.4-mini, o1, o3 | wrap_openai() | βœ… | | Anthropic | Claude Opus 4-8, Claude Sonnet 4-6 | wrap_anthropic() | βœ… | | Google | Gemini 3.5 Flash, Gemini 3.1 Pro | wrap_google() | βœ… | | Ollama | Llama 3, DeepSeek, Mistral, CodeLlama | wrap_ollama() | βœ… (free) | | LiteLLM | Any provider via LiteLLM proxy | wrap_litellm() | βœ… | | Custom | Any OpenAI-compatible API | Manual | βœ… (configurable) |


πŸ”Œ MCPlex Integration

AgentLens pairs with MCPlex to create a complete agent toolkit:

  • MCPlex = execution layer (routes, secures, caches MCP tools)
  • AgentLens = observability layer (traces, debugs, replays, alerts)

Enable the bridge in MCPlex's mcplex.toml:

[agentlens]
enabled = true
url = "http://127.0.0.1:3000/api/ingest"
session_name = "MCPlex Gateway"

Every tool call through MCPlex now appears as a traced step in AgentLens's timeline. Both tools work 100% independently β€” the bridge is opt-in.


πŸ’» IDE Integration (MCP Server)

AgentLens exposes an MCP server so IDE agents (Antigravity, Claude Code, Cursor, Windsurf) can query traces:

{
  "mcpServers": {
    "agentlens": {
      "command": "node",
      "args": ["path/to/agentlens/src/mcp-server-entry.mts"],
      "env": { "AGENTLENS_URL": "http://127.0.0.1:3000" }
    }
  }
}

Available tools:

| Tool | Description | |------|-------------| | agentlens_list_sessions | List recent sessions with cost/anomaly summary | | agentlens_get_session | Full session with all steps | | agentlens_search_traces | Cross-session search by text, agent, type | | agentlens_get_anomalies | All detected anomalies | | agentlens_get_cost_summary | Cost breakdown by agent/model/provider |


🐳 Docker

# Run AgentLens standalone
docker build -t agentlens .
docker run -p 3000:3000 agentlens

# Run AgentLens + MCPlex together
docker-compose up

πŸ” Use Cases

  • Debug failing agents β€” See exactly where and why an agent went wrong
  • Optimize costs β€” Find expensive agents and reduce token usage
  • Detect loops β€” Catch infinite fixβ†’testβ†’fail cycles before they burn your budget
  • Compare runs β€” Diff successful vs failed executions side-by-side
  • Audit workflows β€” Full trace of every decision for compliance and review
  • Demo & showcase β€” Beautiful UI for showing off your agent architecture

πŸ—ΊοΈ Roadmap

  • [x] Run comparison (diff view) βœ…
  • [x] Export traces to JSON βœ…
  • [x] Search & filter timeline βœ…
  • [x] Keyboard shortcuts βœ…
  • [x] OpenTelemetry export format βœ…
  • [x] Budget alerts & cost projections βœ…
  • [x] Live streaming simulation βœ…
  • [x] Python SDK & REST API βœ…
  • [x] Real-time trace streaming (SSE) βœ…
  • [x] LangGraph / CrewAI / AutoGen framework adapters βœ…
  • [x] Team collaboration (shared traces) βœ…
  • [x] VS Code extension βœ…
  • [x] npm package (agentlens-sdk) βœ…
  • [x] Anthropic (Claude) auto-tracing βœ…
  • [x] Google (Gemini) auto-tracing βœ…
  • [x] Ollama local LLM tracing βœ…
  • [x] LiteLLM universal proxy tracing βœ…
  • [x] Google ADK adapter βœ…
  • [x] MCPlex integration bridge βœ…
  • [x] MCP server for IDE agents βœ…
  • [x] Cross-session search API βœ…
  • [x] Docker & docker-compose βœ…
  • [x] Async Python SDK (aiohttp) βœ…

🀝 Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.


πŸ“„ License

MIT License. See [LICENSE](LICENSE) for details.

πŸ”§ Recent Changes (v1.1 β€” Hardening)

  • MCP Error Recovery β€” Malformed JSON or tool handler crashes now log to stderr instead of silently dropping. IDE agents get proper error feedback.
  • MCP Spec Compliance β€” Added resources/list and prompts/list stubs, returning empty arrays instead of method-not-found errors.
  • Graceful Shutdown β€” MCP server now handles SIGINT/SIGTERM signals for clean exit.
  • Cleanup Timer Lifecycle β€” Added destroy() method to TraceStore that clears the cleanup interval timer, preventing leaks on server shutdown.
  • Sampled-Out Session Pruning β€” The sampledOutSessions Set is now bounded (auto-cleared at >10K entries), preventing unbounded memory growth.
  • Updated Model Pricing β€” Added GPT-5.4 family, Claude Sonnet 4.6/Opus 4.7, Gemini 2.5 Flash, DeepSeek V3, Qwen 2.5 Coder to the cost tracking table (May 2026).

Built with ❀️ for the AI agent community

If this tool saved you from a $47 infinite loop, consider giving it a ⭐

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source β€” we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.