Trace Forge logo

Trace Forge

Logs agent traces, nested spans, tool calls, and decisions, then retrieves, searches, and summarizes execution history.

Install Trace Forge

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "trace-forge": {
      "command": "npx",
      "args": [
        "-y",
        "trace-forge-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

Structured execution tracing is the focus of the trace-forge MCP server, which records agent tasks, spans, tool calls, and decisions through MCP tools. Agents can start and end traces, organize work into nested spans, log timing and token data, and capture reasoning with alternatives and confidence. Use it when an agent workflow needs an auditable execution record, searchable trace history, or aggregate runtime statistics. It runs through npx or from source and includes resources for recent traces and overall statistics.

Use cases

  • Record agent task execution for audit review
  • Group multi-step work into nested spans
  • Log tool calls with timing and token data
  • Capture decisions with alternatives and confidence
  • Search traces by agent or outcome

Key features

  • Structured trace and span creation
  • Nested span trees
  • Tool-call and decision logging
  • Token-based cost estimation
  • Trace retrieval and search
  • Recent-trace and aggregate-stat resources

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 3d ago

Recent health check succeeded.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · trace-forge-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads174Package downloads in the last 30 days.
Last commit6mo agoMost recent push to the default branch.

How Trace Forge works

What trace-forge does

The trace-forge MCP server provides a write path for structured observability data generated during AI agent tasks. It records a top-level trace for a task, optional nested spans for logical work units, tool-call events, and decision events. A trace can be completed with an outcome and optional summary, after which the server reports totals such as duration, event count, span count, and tool-call count.

Decision records include the agent’s reasoning, alternatives considered, selected action, and a confidence value from 0.0 to 1.0. Tool-call records include the tool name, arguments, a result preview limited to 500 characters, duration, status, and optionally token usage. When token usage is supplied, the server calculates a cost estimate.

The project is designed for traceability of agent actions and decisions, including the EU AI Act Article 14 use case described in its documentation. It does not claim to replace legal or compliance review.

How it works

A typical workflow begins with trace_start, which returns a trace identifier and start time. Use trace_span to create named units such as research or validation; a parent_span_id allows spans to form a hierarchy. During execution, record each tool invocation with trace_tool_call and decision points with trace_decision.

Call trace_end when the task finishes, using one of the supported outcomes: success, failure, partial, or timeout. The completed record can be inspected with get_trace, which returns the trace tree, events, tool calls, decisions, and computed totals. search_traces filters records by agent ID and/or status and returns recent matches with summary statistics.

The trace-forge MCP server also exposes traces://recent for the latest 20 traces and traces://stats for aggregate totals, average duration, and success rate.

Setup and configuration

Run the server with npx:

Terminal
npx trace-forge-mcp

For Claude Desktop, add an MCP server entry that uses npx as the command and trace-forge-mcp as its argument:

config.json
{
  "mcpServers": {
    "trace-forge": {
      "command": "npx",
      "args": ["trace-forge-mcp"]
    }
  }
}

You can also clone the repository, install its npm dependencies, and start it with node src/index.js. No environment variables are documented for configuration.

Tools and capabilities

The trace-forge MCP server exposes these tools:

  • trace_start creates a trace for an agent and task.
  • trace_span creates nested or top-level spans.
  • trace_tool_call records tool arguments, result previews, timing, status, and optional token usage.
  • trace_decision records reasoning, alternatives, the chosen action, and confidence.
  • trace_end closes a trace and computes execution totals.
  • get_trace returns a complete trace tree.
  • search_traces filters traces by agent and status, with a configurable limit from 1 to 100.

Limitations and notes

The documented tool interface requires the caller to provide the trace ID for subsequent events. Tool calls require a result preview of no more than 500 characters, a duration, and a status. The available tool-call statuses are success, error, and timeout; trace outcomes are success, failure, partial, and timeout. Cost estimation depends on providing a token count, and the documentation does not specify a pricing model or storage backend.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Trace Forge

trace-forge is an MCP server that connects AI agent workflows to structured trace logging. Its main tools start and end traces, create nested spans, record tool calls with timing and token data, log decisions with reasoning, retrieve complete trace trees, and search traces by agent ID or status.

Install it by running `npx trace-forge-mcp`. You can also clone the repository, run `npm install`, and start it with `node src/index.js`.

Add a `trace-forge` entry to `claude_desktop_config.json` with `npx` as the command and `trace-forge-mcp` as its argument. Restart or reload Claude Desktop after updating the configuration.

You can record agent tasks, nested spans, tool calls, and decision points. Tool calls include arguments, result previews, duration, status, and optional token usage; decisions include reasoning, alternatives, the chosen action, and confidence.

Yes. Use `search_traces` to filter traces by agent ID and/or status, with a result limit from 1 to 100. Use `get_trace` when you need the full nested trace and event details.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTrace Forge AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/trace-forge?style=directory)](https://allmcps.com/mcp/trace-forge)
HTML Embed
<a href="https://allmcps.com/mcp/trace-forge"><img src="https://allmcps.com/api/badge/trace-forge?style=directory" alt="Trace Forge on AllMCPs" /></a>