Trace Forge

io.github.mdfifty50-boop由 GitHub 帳號 mdfifty50-boop 發布v0.1.1更新於 Oct 27, 2026

Structured execution trace and span logging for AI agents

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理為 AI 代理任務記錄結構化的執行追蹤、跨度、工具呼叫與決策,並可檢索與查詢這些紀錄。

可以做什麼
  • 為代理任務開始與結束追蹤,記錄代理識別碼、任務描述、中繼資料、結果與摘要
  • 在追蹤內建立可巢狀的跨度,標記邏輯工作單位
  • 記錄工具呼叫,包含參數、結果預覽、耗時、狀態及選用的以 token 計算的成本估算
  • 記錄決策點,包含推理過程、評估過的其他方案、所選動作與信心值
  • 取得完整追蹤樹,並依代理識別碼或狀態搜尋追蹤
  • 透過資源讀取最近追蹤與彙總統計
適用情境
當你需要可稽核的代理行為紀錄時適用,例如檢視多步驟工具呼叫、比較決策依據,或為高風險 AI 工作流程保留可追溯性文件。
執行需求
以本機程序方式執行,可透過 npx(需 Node.js)或從原始碼 npm install 啟動,並在用戶端的 MCP 伺服器設定中登記。未宣告需要帳號、API 金鑰、環境變數或標頭。
安裝前請注意
這是寫入型服務:工具參數、結果預覽、推理內容與中繼資料都會存入追蹤,請避免傳入密鑰或個人資料。追蹤由該伺服器保存在本機,若用於合規紀錄,應先確認其儲存位置與保留期限。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Trace Forge,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

trace-forge-mcp

MCP server for writing structured traces, spans, and decisions. The only write-path observability MCP — all 9 existing observability MCPs are read-only.

Built for EU AI Act traceability compliance (Article 14, due August 2026).

Install

bash
npx trace-forge-mcp

Claude Desktop

Add to claude_desktop_config.json:

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

From source

bash
git clone https://github.com/mdfifty50-boop/trace-forge-mcp.gitcd trace-forge-mcpnpm installnode src/index.js

Tools

trace_start

Begin a new trace for an agent task.

ParamTypeRequiredDescription
agent_idstringyesUnique agent identifier
task_descriptionstringyesWhat the agent is doing
metadataobjectnoOptional metadata (model, department, priority)

Returns: { trace_id, started_at }

trace_span

Create a span within a trace. Spans can be nested via parent_span_id.

ParamTypeRequiredDescription
trace_idstringyesTrace to attach to
span_namestringyesSpan name (e.g. "research", "validation")
parent_span_idstringnoParent span for nesting
metadataobjectnoOptional span metadata

Returns: { span_id, trace_id }

trace_tool_call

Log a tool call within a trace. Auto-calculates cost estimate from token count.

ParamTypeRequiredDescription
trace_idstringyesTrace this belongs to
span_idstringnoSpan this belongs to
tool_namestringyesTool that was called
argsobjectyesArguments passed
result_previewstringyesResult preview (max 500 chars)
tokens_usednumbernoToken count (enables cost estimation)
duration_msnumberyesCall duration in milliseconds
statusstringyes"success", "error", or "timeout"

Returns: { event_id, logged: true }

trace_decision

Log an agent decision point with reasoning and alternatives considered.

ParamTypeRequiredDescription
trace_idstringyesTrace this belongs to
reasoningstringyesWhy the agent made this decision
alternatives_consideredstring[]yesOther options evaluated
chosen_actionstringyesWhat was decided
confidencenumberyesConfidence 0.0 to 1.0

Returns: { event_id, logged: true }

trace_end

Complete a trace. Auto-calculates total duration, event counts, and span counts.

ParamTypeRequiredDescription
trace_idstringyesTrace to complete
outcomestringyes"success", "failure", "partial", or "timeout"
summarystringnoOptional summary

Returns: { trace_id, duration_ms, events_count, spans_count, tool_calls_count }

get_trace

Retrieve a complete trace tree with all spans, events, tool calls, and decisions.

ParamTypeRequiredDescription
trace_idstringyesTrace ID to retrieve

Returns: Full trace object with nested span tree, all events, and computed totals.

search_traces

Find traces by agent ID and/or status.

ParamTypeDefaultDescription
agent_idstring-Filter by agent
statusstring-Filter by status
limitnumber20Max results (1-100)

Returns: Matching traces sorted by recency with summary stats.

Resources

URIDescription
traces://recentLast 20 traces with summary
traces://statsAggregate statistics (total, avg duration, success rate)

Usage Pattern

1. trace_start — when agent begins a task2. trace_span — create logical work units (research, generation, validation)3. During execution:   - trace_tool_call — after each tool invocation   - trace_decision — at each decision point4. trace_end — when task completes5. get_trace — retrieve full audit trail6. search_traces — find traces by agent or status

EU AI Act Compliance

Article 14 of the EU AI Act requires high-risk AI systems to maintain traceability of decisions and actions. trace-forge-mcp provides:

  • Structured decision logging with reasoning and alternatives
  • Complete tool call audit trails with timing and cost
  • Hierarchical span trees for complex multi-step tasks
  • Agent identification and task attribution

License

MIT

來源:README.md,提交 b613faf

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。