Skip to content
MCP server

MCP Agent Trace Inspector

Local tracing, cost estimates and audit logs for MCP agent workflows

Runs locally

MCP Agent Trace Inspector is an MCP server for developer tools. It runs locally on your machine and is started by your AI client.

Platforms
CLI, Self-hosted
Runs
Locally
What it can do
Can change data (1 tool)
Version
1.0.1
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a 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

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

Or share it with your project

Add to .mcp.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 Code setup guide

Add to claude_desktop_config.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.

Claude Desktop setup guide

Add to ~/.cursor/mcp.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.

Cursor setup guide

Add to ~/.copilot/mcp-config.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.

VS Code setup guide

Add with the CLI

Run in a terminal

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

Or add to config.toml

Add to ~/.codex/config.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>" }

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "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>"
      }
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.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

    Antigravity

    Add to ~/.gemini/config/mcp_config.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.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.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.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.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.

    Cline setup guide

  • Zed

    Add to Zed settings.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.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "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.

    Junie

    Add to ~/.junie/mcp/mcp.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.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.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.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

Configuration

  • MCP_API_KEYOptional API key for the Streamable HTTP transport (stdio does not require it).
  • MCP_JWT_SECRETOptional HMAC-SHA256 secret for Bearer JWTs on the Streamable HTTP transport.

About MCP Agent Trace Inspector

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.

Tools this server provides (5)

Taken from the project documentation; the running server may differ.

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_startName suggests: changes
Start a named trace
trace_step
Record one step of a trace
trace_end
Finish a trace
get_trace_summaryName suggests: reads
Summary with steps, tokens, latency and cost estimate
list_tracesName suggests: reads
List recorded traces

What it does

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

MCP Agent Trace Inspector 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.

How AIPoweredBot checks servers