The MCP server.
Connect AgentLens to Claude Desktop, Cursor, or Claude Code. Two commands to install, one to configure. Available on Pro and Enterprise.
Generate one in Settings → API keys. Copy it once.
One pipx command, one paste-in of your key. Validates against /api/v1/whoami so a bad key fails loudly.
Add one JSON block to Claude Desktop / Cursor. Your assistant gets eight new AgentLens tools.
The MCP server ships as a single Python package. We recommend pipx so it lives in its own venv and doesn't collide with your system Python.
pipx install agentlens-mcp
No pipx? pip install agentlens-mcp works too — just be aware it installs into whatever Python is currently active.
Run configure once. It prompts for your API key, hits /api/v1/whoami to make sure it works, then writes ~/.config/agentlens/credentials.json with mode 0600.
agentlens-mcp configure # Paste your AgentLens API key. # Create one at https://agentlens.example/settings/api-keys (Pro or Enterprise plan). # # Key: agl_live_xxxxxxxxxxxxxxxxxxxxxxxx # # ✓ Authenticated as 'ACME UX team' on the 'pro' plan (8,432 credits remaining). # ✓ Saved to /Users/you/.config/agentlens/credentials.json
Prefer environment variables? AGENTLENS_API_KEY (and optionally AGENTLENS_BASE_URL) override the file. Useful in CI.
Same JSON block works in Claude Desktop, Cursor, and Claude Code.
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonAdd the AgentLens server to the mcpServers map. Restart Claude Desktop afterwards — it only re-reads the config on launch.
~/Library/Application Support/Claude/claude_desktop_config.json{
"mcpServers": {
"agentlens": {
"command": "agentlens-mcp",
"args": ["serve"]
}
}
}Cursor~/.cursor/mcp.jsonIdentical shape. Cursor picks up changes without a restart.
~/.cursor/mcp.json{
"mcpServers": {
"agentlens": {
"command": "agentlens-mcp",
"args": ["serve"]
}
}
}Claude Codeclaude mcp add agentlens -- agentlens-mcp serveUse the CLI helper rather than editing config by hand. It writes the same JSON shape under the hood.
claude mcp add agentlens -- agentlens-mcp serveclaude mcp add agentlens -- agentlens-mcp serve
Eight tools. Bias toward synthesis over CRUD — your assistant asks fewer questions and writes shorter chains.
whoami()Sanity-check the connection. Returns the bound account, plan, and credit balance.query_simulations()List sims newest-first. Filter by status (queued / running / completed / failed) and tag.launch_simulation()Kick off a new run. Returns immediately with the sim id and an estimated credit ceiling.wait_for_simulation()Block until a run finishes, streaming progress updates back through MCP's progress channel as it goes. Caps at 30 min by default.get_simulation_progress()Cheap status snapshot. Safe to poll yourself if you'd rather not block.summarize_simulation()Bundle sim metadata + report + top 5 pages into one response. The right tool for 'what did the report say?'cancel_simulation()Stop a running sim. Already-terminal runs return a noop.compare_battle()Diff two simulations head-to-head — per-entry KPIs with deltas, persona winners/losers, per-URL drop-off, and a verdict line. Pro+ only.Run agentlens-mcp doctor — it re-validates your stored key against the same endpoint the server uses on every tool call. Most failures are a revoked key (mint a fresh one) or a plan downgrade (you need Pro+).
agentlens-mcp doctor # ✓ 'ACME UX team' on plan 'pro', 8,432 credits remaining.
The MCP server caches nothing — but your Claude Desktop / Cursor session does cache tool definitions. Restart the editor and the new plan takes effect immediately.
Confirm the editor is invoking 'agentlens-mcp serve' (not just 'agentlens-mcp'). The 'serve' subcommand is what speaks MCP over stdio — the bare command prints help and exits.
~/.config/agentlens/credentials.json (mode 0600). Anyone with read access to your home directory can use it — revoke and re-issue if you suspect compromise. OS keychain integration is coming in v2.