MCP Agent Trace
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Agent Tracestart a trace session for my agent run"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Agent Trace — Observability for AI Agent Loops
Record agent events, build trace trees, compute metrics, detect loops, and export traces. 12 tools. Zero dependencies.
Install
pip install mcp-agent-traceRequirements: Python 3.10+. Zero runtime dependencies (stdlib only).
Type checking: Ships with py.typed marker (PEP 561). Compatible with mypy, pyright, and pyrefly.
Related MCP server: RawTrace MCP
The Problem
Agent decisions are black boxes. No way to trace what happened, what tokens were spent on, where loops occurred. Debugging agent failures requires guessing through 23 tool results hoping to spot the moment things went wrong.
The Solution
MCP Agent Trace records structured events throughout the agent loop, builds hierarchical trace trees, computes token/latency metrics, detects repeated action patterns, and exports full traces as JSON.
Quick Start
from src.trace_engine import AgentTracer
# Start a trace session
tracer = AgentTracer()
tracer.start_trace(session_id="debug-auth-bug")
# Log events as the agent runs
tracer.log_event("tool_call", {"tool": "read_file", "path": "auth.py"})
tracer.log_event("tool_result", {"tool": "read_file", "tokens": 1200})
tracer.log_event("decision", {"chosen": "patch", "reason": "found bug on line 42"})
tracer.log_event("error", {"error": "patch failed", "retry": True})
# Get metrics
metrics = tracer.get_metrics()
print(f"Tokens: {metrics['total_tokens']:,}")
print(f"Tools: {metrics['tool_calls']} calls")
print(f"Loops: {metrics['loops_detected']}")
# Export for analysis
tracer.export_trace("debug-session.json")12 Tools
Tool | What it does |
| Begin a new trace session |
| End session, compute summary metrics |
| Record a structured event |
| Get full trace tree for a session |
| Token usage, tool calls, latency, loop detection |
| Find repeated tool-call patterns |
| Export as JSON for external analysis |
| List all trace sessions |
| Chronological event timeline |
| Add human annotation to an event |
| Aggregate statistics across sessions |
| Clear all sessions and traces |
Event Types
model_call — LLM API call (tokens, model, latency)
tool_call — Agent invoking a tool
tool_result — Tool response (size, duration)
decision — Agent chose between options
error — Exception or failure
milestone — Task progress marker
user_input — User message received
agent_response — Agent message sentMCP Server Setup
{
"mcpServers": {
"agent-trace": {
"command": "python3",
"args": ["-m", "src.server"]
}
}
}Sample Trace Output
=== TRACE: debug-auth-bug (8 events) ===
[10:15:03] MODEL: claude-sonnet in=4200 out=180 ($0.0153)
[10:15:04] CALL: read_file({'path': 'auth.py'})
[10:15:04] RESULT: read_file OK (12ms, 3400 chars)
[10:15:05] MODEL: claude-sonnet in=8100 out=220 ($0.0273)
[10:15:06] CALL: patch({'path': 'auth.py', ...})
[10:15:06] RESULT: patch OK (5ms, 150 chars)
=== SUMMARY ===
Tokens: 12,300 in + 400 out
Cost: $0.0426
Tools: 2 unique, 2 callsReal Results
Metric | Before tracing | After tracing |
Avg tool calls per task | 18 | 11 |
Repeat calls | 23% | 4% |
Error recovery rate | 31% | 78% |
Debug time per failure | 15 min | 2 min |
Tests
python -m pytest tests/ -v # 28 tests, all passingInspiration
AgentDoG — Diagnostic guardrails
Azure SRE Agent — 35k incidents traced
License
MIT — see LICENSE
Links
Freelance portfolio: https://ameobius-space.github.io/kwork-portfolio/
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceProvides observability for multi-agent workflows by tracking hierarchical task structure, architectural decisions, reasoning, encountered problems, code modifications with Git diffs, and temporal metrics.Last updated49
- AlicenseAqualityAmaintenanceRecords raw DOM mutations and network events during AI agent browser interactions, enabling detailed debugging and analysis of Playwright automations.Last updated591631MIT
- Alicense-qualityFmaintenanceEnables comprehensive collection and analysis of ClaudeCode development sessions, including agent tracking, tool usage analytics, and performance metrics.Last updatedMIT
- Alicense-qualityDmaintenanceTracks and analyzes AI agent tool calls with event logging, dashboard, per-tool and per-agent analytics, and error monitoring.Last updatedMIT
Related MCP Connectors
Agent Replay Debugger MCP — record every agent step + deterministic replay. Step-debugger for
AI agent run monitoring with incident replay and SLA receipts.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AMEOBIUS-space/mcp-agent-trace'
If you have feedback or need assistance with the MCP directory API, please join our Discord server