# MCP Agent Trace Inspector

> MCP Agent Trace Inspector is an MCP server for developer tools. Local tracing, cost estimates and audit logs for MCP agent workflows. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/dbsectrainer/mcp-agent-trace-inspector
- **MCP Registry name:** io.github.dbsectrainer/mcp-agent-trace-inspector
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools), [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-11-23

## About

The agent tells this server what it is doing: it opens a trace, records each step with the tool's input and output, and closes the trace. Everything lands in a local SQLite database, so there is no cloud account and nothing leaves the machine. The README is explicit that tracing is opt-in per step; it does not intercept other MCP servers on its own.

Once traces exist, people can read summaries with step count, estimated tokens, latency and cost, compare two runs, export a self-contained HTML dashboard with a step timeline and latency waterfall, or emit OTLP/JSON spans. Cost comes from an offline cl100k_base tokenizer and a configurable price table. Thresholds for latency, error rate and cost can alert when a trace ends, with optional Slack or webhook delivery, and an append-only JSONL audit log can be exported as JSON or CSV.

It needs Node 22.13 or newer and runs over stdio by default; a stateless Streamable HTTP mode adds optional API-key or JWT auth and rate limiting.

## Features

- **Step tracing:** Records tool calls, inputs, outputs and latency for each step.
- **Offline cost estimates:** Counts tokens locally against a configurable pricing table.
- **HTML dashboard:** Exports a self-contained report with timeline and latency waterfall.
- **Run comparison:** Diffs two traces in aggregate and step by step.
- **OTLP export:** Writes standard resourceSpans/scopeSpans/spans JSON.
- **Alerts and retention:** Persists latency, error and cost thresholds and supports purge or archive policies.
- **HTTP transport:** Optional stateless Streamable HTTP with API key or JWT.

## Good for

- Debugging where an agent run slowed down or failed
- Estimating what an agent workflow costs
- Comparing a regression run against a baseline
- Keeping a compliance audit trail of recorded steps

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add mcp-agent-trace-inspector --env MCP_API_KEY='<MCP_API_KEY>' --env MCP_JWT_SECRET='<MCP_JWT_SECRET>' -- npx -y mcp-agent-trace-inspector
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add mcp-agent-trace-inspector --env MCP_API_KEY='<MCP_API_KEY>' --env MCP_JWT_SECRET='<MCP_JWT_SECRET>' -- npx -y mcp-agent-trace-inspector
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.mcp-agent-trace-inspector]
command = "npx"
args = ["-y", "mcp-agent-trace-inspector"]
env = { MCP_API_KEY = "<MCP_API_KEY>", MCP_JWT_SECRET = "<MCP_JWT_SECRET>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e MCP_API_KEY='<MCP_API_KEY>' -e MCP_JWT_SECRET='<MCP_JWT_SECRET>' mcp-agent-trace-inspector npx -- -y mcp-agent-trace-inspector

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-agent-trace-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-trace-inspector"
      ],
      "env": {
        "MCP_API_KEY": "<MCP_API_KEY>",
        "MCP_JWT_SECRET": "<MCP_JWT_SECRET>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 5 tools changes data; 2 names don't say. From the server's own tool labels and tool names; not verified by us.

- `trace_start` (name suggests: changes): Start a named trace
- `trace_step`: Record one step of a trace
- `trace_end`: Finish a trace
- `get_trace_summary` (name suggests: reads): Summary with steps, tokens, latency and cost estimate
- `list_traces` (name suggests: reads): List recorded traces

## FAQ

### Does MCP Agent Trace Inspector send traces anywhere?

No. Traces are stored in a local SQLite file, by default at ~/.mcp/traces.db.

### Does MCP Agent Trace Inspector trace other MCP servers automatically?

No. It records only the steps an agent reports with trace_step.

### Which Node version is required?

Node.js 22.13 or newer.

### Is the HTTP mode safe to expose?

The default bind is loopback; the README says to put TLS and an authenticating proxy in front of any non-loopback use.

### How do I add MCP Agent Trace Inspector to Claude Code?

Run this command in your terminal: claude mcp add mcp-agent-trace-inspector --env MCP_API_KEY='<MCP_API_KEY>' --env MCP_JWT_SECRET='<MCP_JWT_SECRET>' -- npx -y mcp-agent-trace-inspector

### What are the best alternatives to MCP Agent Trace Inspector?

The closest alternatives to MCP Agent Trace Inspector are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/mcp-agent-trace-inspector
