@m4trix/trace-viewer 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/cli.js +1862 -21
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +222 -4
- package/dist/index.js +1833 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -23,6 +23,33 @@ pnpm --filter @m4trix/trace-viewer exec m4trix-trace-viewer --adapter fs --path
|
|
|
23
23
|
|
|
24
24
|
Then open **http://127.0.0.1:4319** in a browser.
|
|
25
25
|
|
|
26
|
+
## MCP server for coding agents
|
|
27
|
+
|
|
28
|
+
`m4trix-trace-viewer mcp` serves the same trace store as a local [MCP](https://modelcontextprotocol.io)
|
|
29
|
+
server over stdio, so coding agents can inspect, search and compare traces. It accepts the same
|
|
30
|
+
`--adapter` / `--path` flags. Pass an absolute `--path`, because agents may launch it from another directory.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
claude mcp add m4trix-traces -- npx m4trix-trace-viewer mcp --path "$PWD/tmp/tracing-example"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Tool | Purpose |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `list_traces` | Newest-first traces filtered by status, project, name, metadata, time range, latency |
|
|
39
|
+
| `get_trace` | Run tree outline (LangGraph plumbing hidden by default, errors never hidden) |
|
|
40
|
+
| `find_runs` | Runs by type, name, status, error text, latency, tokens, metadata across traces |
|
|
41
|
+
| `get_run` | One run: ancestry, timing, full error, children, payload previews |
|
|
42
|
+
| `get_payload` | Payload as outline or JSON, narrowed by JSONPath, paged with `offset` |
|
|
43
|
+
| `load_trace_payloads` | Load trace payloads into the in-memory search index |
|
|
44
|
+
| `search_payloads` | Text/regex search; identical values grouped at the run where they first appeared |
|
|
45
|
+
| `analyze_trace` | Root-cause errors, unfinished/orphan runs, critical path, token hotspots, loops, swallowed errors |
|
|
46
|
+
| `get_conversation` | Chat transcript (OpenAI, Anthropic, LangChain shapes) of a run |
|
|
47
|
+
| `compare` | Diff two runs' payloads, or align two traces run by run |
|
|
48
|
+
| `annotate` | Write a trace/run annotation (the tool tells agents to ask the user first) |
|
|
49
|
+
|
|
50
|
+
Trace ids accept `latest` or a unique prefix; run ids accept a unique prefix. Payload strings that
|
|
51
|
+
contain JSON are decoded, so paths and search reach into serialized tool arguments.
|
|
52
|
+
|
|
26
53
|
## Trace profiles and the AI payload mapper
|
|
27
54
|
|
|
28
55
|
Profiles control how the run detail panel renders payloads. **Raw** and **LangGraph** are built in;
|
|
@@ -61,6 +88,9 @@ const traceViewerApi = createFsTraceViewerApi('./tmp/tracing-example');
|
|
|
61
88
|
startTraceViewerServer({ traceViewerApi, port: 4319 });
|
|
62
89
|
```
|
|
63
90
|
|
|
91
|
+
`createTraceMcpServer({ traceViewerApi })` returns an `McpServer` you can connect to any MCP
|
|
92
|
+
transport; `startTraceMcpStdioServer` does that for stdio.
|
|
93
|
+
|
|
64
94
|
## tRPC procedures
|
|
65
95
|
|
|
66
96
|
- `traces.list` — `TraceViewerApi.listTraces`
|