@agent-inspect/mcp-server 6.13.0 → 6.14.1
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 +27 -18
- package/dist/{chunk-TLE64A3T.mjs → chunk-C6EBJS57.mjs} +57 -2
- package/dist/chunk-C6EBJS57.mjs.map +1 -0
- package/dist/cli.cjs +55 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +55 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +12 -4
- package/dist/chunk-TLE64A3T.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,64 +1,73 @@
|
|
|
1
1
|
# @agent-inspect/mcp-server
|
|
2
2
|
|
|
3
|
-
Read-only MCP server
|
|
3
|
+
Read-only MCP server for the **local coding-agent debug loop**: list runs, summarize failures, inspect trees, evaluate contracts, and fetch **TraceFacts** (`get_trace_facts`) — without invoking agent tools or mutating traces.
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
**Support level:** Preview — see [SUPPORT-LEVELS.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/SUPPORT-LEVELS.md).
|
|
7
7
|
|
|
8
8
|
## When to use
|
|
9
9
|
|
|
10
|
-
- Let MCP
|
|
11
|
-
-
|
|
10
|
+
- Let Cursor, Claude Code, Codex, Gemini, or other MCP clients inspect local `.agent-inspect/` evidence
|
|
11
|
+
- Debug failed trajectories with the same TraceFacts used by CLI checks
|
|
12
12
|
|
|
13
13
|
## When not to use
|
|
14
14
|
|
|
15
|
-
- Invoking
|
|
16
|
-
- Uploading traces to a remote MCP host
|
|
15
|
+
- Invoking target-app tools through MCP
|
|
16
|
+
- Uploading traces to a remote MCP host / collector
|
|
17
|
+
- Expecting the server to edit application code
|
|
17
18
|
|
|
18
19
|
## Install
|
|
19
20
|
|
|
20
21
|
```bash
|
|
21
22
|
npm install @agent-inspect/mcp-server
|
|
23
|
+
# optional helper:
|
|
24
|
+
npx agent-inspect mcp configure --client cursor
|
|
22
25
|
```
|
|
23
26
|
|
|
24
27
|
## Example
|
|
25
28
|
|
|
26
29
|
```bash
|
|
27
30
|
npx @agent-inspect/mcp-server --dir .agent-inspect
|
|
28
|
-
# or after install:
|
|
29
|
-
# npx agent-inspect-mcp-server --dir .agent-inspect
|
|
30
31
|
```
|
|
31
32
|
|
|
33
|
+
## Flagship tools (read-only)
|
|
34
|
+
|
|
35
|
+
| Tool | Role |
|
|
36
|
+
|------|------|
|
|
37
|
+
| `list_recent_runs` / `list_recent_failures` | Browse local runs |
|
|
38
|
+
| `get_run_summary` / `get_execution_tree` | Bounded summaries |
|
|
39
|
+
| `get_first_causal_failure` | Deterministic first causal failure |
|
|
40
|
+
| `get_contract_failures` | TraceContract / check failures |
|
|
41
|
+
| `get_trace_facts` | TraceFacts / semantic parity summary |
|
|
42
|
+
| `compare_runs` | Structural diff |
|
|
43
|
+
| `create_share_checked_evidence` | Share-gated Evidence package |
|
|
44
|
+
|
|
45
|
+
Results are redacted (share profile by default), bounded, and deterministic for the same inputs.
|
|
46
|
+
|
|
32
47
|
## Privacy
|
|
33
48
|
|
|
34
49
|
- Reads local trace directory only
|
|
35
50
|
- Tool results go through a share-profile redaction / size boundary
|
|
36
51
|
- Exposes configured local evidence to the **connected MCP client** — treat that client as a trust boundary
|
|
37
|
-
- No trace mutation; no agent tool invocation
|
|
52
|
+
- No trace mutation; no agent tool invocation; no default upload
|
|
38
53
|
|
|
39
54
|
## Limitations
|
|
40
55
|
|
|
41
56
|
- Preview surface — tool catalog and bounds may evolve
|
|
42
57
|
- Not a gateway or remote upload service
|
|
43
|
-
|
|
44
|
-
## API
|
|
45
|
-
|
|
46
|
-
CLI entry: read-only resources for trace listing/search.
|
|
47
|
-
|
|
48
|
-
## CLI
|
|
49
|
-
|
|
50
|
-
Prefer `agent-inspect list` / `view` for humans; MCP server for tool integrations.
|
|
58
|
+
- Not a substitute for hosted APM
|
|
51
59
|
|
|
52
60
|
## Docs
|
|
53
61
|
|
|
54
|
-
- [
|
|
62
|
+
- [CODING-AGENT-LOOP.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/CODING-AGENT-LOOP.md)
|
|
63
|
+
- [TRACE-FACTS.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/TRACE-FACTS.md)
|
|
64
|
+
- [NO-EGRESS-POLICY.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/NO-EGRESS-POLICY.md)
|
|
55
65
|
|
|
56
66
|
## Troubleshooting
|
|
57
67
|
|
|
58
68
|
- **Empty resources:** Confirm `--dir` points at JSONL traces
|
|
59
69
|
- **Security:** Do not expose server beyond localhost without redaction review
|
|
60
70
|
|
|
61
|
-
|
|
62
71
|
## Version
|
|
63
72
|
|
|
64
73
|
Part of the fixed AgentInspect release line. See the npm badge / package manifest for the current version.
|
|
@@ -2096,6 +2096,7 @@ function buildEvidenceManifest(parts) {
|
|
|
2096
2096
|
verificationPolicy: parts.verificationPolicy ?? parts.redactionProfile
|
|
2097
2097
|
},
|
|
2098
2098
|
assessment,
|
|
2099
|
+
...parts.semantics !== void 0 ? { semantics: { ...parts.semantics } } : {},
|
|
2099
2100
|
files: buildEvidenceFileEntries(parts.files)
|
|
2100
2101
|
};
|
|
2101
2102
|
}
|
|
@@ -2849,6 +2850,38 @@ function summarizeSemanticParity(events) {
|
|
|
2849
2850
|
diagnostics: projection.diagnostics
|
|
2850
2851
|
};
|
|
2851
2852
|
}
|
|
2853
|
+
function buildTraceFacts(events) {
|
|
2854
|
+
const projection = projectLogicalEvents(events);
|
|
2855
|
+
const toolsByName = /* @__PURE__ */ new Map();
|
|
2856
|
+
const llmEvents = [];
|
|
2857
|
+
const outcomeEvents = [];
|
|
2858
|
+
for (const event of projection.logicalEvents) {
|
|
2859
|
+
if (event.kind === "TOOL" && event.status !== "running") {
|
|
2860
|
+
const name = resolveCanonicalToolName(event);
|
|
2861
|
+
const list = toolsByName.get(name) ?? [];
|
|
2862
|
+
list.push(event);
|
|
2863
|
+
toolsByName.set(name, list);
|
|
2864
|
+
}
|
|
2865
|
+
if (event.kind === "LLM" && event.status !== "running") {
|
|
2866
|
+
llmEvents.push(event);
|
|
2867
|
+
}
|
|
2868
|
+
if (event.kind === "OUTCOME") {
|
|
2869
|
+
outcomeEvents.push(event);
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
for (const [name, list] of [...toolsByName.entries()]) {
|
|
2873
|
+
toolsByName.set(name, Object.freeze([...list]));
|
|
2874
|
+
}
|
|
2875
|
+
return {
|
|
2876
|
+
rawEvents: Object.freeze([...events]),
|
|
2877
|
+
logicalEvents: projection.logicalEvents,
|
|
2878
|
+
diagnostics: projection.diagnostics,
|
|
2879
|
+
toolsByName,
|
|
2880
|
+
llmEvents: Object.freeze(llmEvents),
|
|
2881
|
+
outcomeEvents: Object.freeze(outcomeEvents),
|
|
2882
|
+
summary: summarizeSemanticParity(events)
|
|
2883
|
+
};
|
|
2884
|
+
}
|
|
2852
2885
|
|
|
2853
2886
|
// packages/core/src/checks/index.ts
|
|
2854
2887
|
var SEVERITY_RANK = {
|
|
@@ -6921,6 +6954,11 @@ var FLAGSHIP_TOOLS = [
|
|
|
6921
6954
|
name: "get_adapter_diagnostics",
|
|
6922
6955
|
description: "Bounded adapter/source diagnostics for one run.",
|
|
6923
6956
|
inputSchema: RUN_ID_SCHEMA
|
|
6957
|
+
},
|
|
6958
|
+
{
|
|
6959
|
+
name: "get_trace_facts",
|
|
6960
|
+
description: "Bounded TraceFacts summary for one run (logical projection counts and finished tool names; no raw prompts).",
|
|
6961
|
+
inputSchema: RUN_ID_SCHEMA
|
|
6924
6962
|
}
|
|
6925
6963
|
];
|
|
6926
6964
|
var LEGACY_TOOLS = [
|
|
@@ -7093,6 +7131,23 @@ async function callReadOnlyTool(context, name, args = {}) {
|
|
|
7093
7131
|
context
|
|
7094
7132
|
);
|
|
7095
7133
|
}
|
|
7134
|
+
if (name === "get_trace_facts") {
|
|
7135
|
+
const runId = String(args.runId ?? "");
|
|
7136
|
+
const { read } = await openRunTrace(context, runId);
|
|
7137
|
+
const facts = buildTraceFacts(read.events);
|
|
7138
|
+
return deliverMcpPayload(
|
|
7139
|
+
{
|
|
7140
|
+
runId,
|
|
7141
|
+
projectionVersion: "logical-lifecycle-0.1",
|
|
7142
|
+
summary: facts.summary,
|
|
7143
|
+
toolNames: [...facts.toolsByName.keys()].sort((a, b) => a.localeCompare(b)),
|
|
7144
|
+
llmCount: facts.llmEvents.length,
|
|
7145
|
+
outcomeCount: facts.outcomeEvents.length,
|
|
7146
|
+
note: "Bounded TraceFacts summary only; raw events and prompts are not included."
|
|
7147
|
+
},
|
|
7148
|
+
context
|
|
7149
|
+
);
|
|
7150
|
+
}
|
|
7096
7151
|
if (name === "get_first_causal_failure") {
|
|
7097
7152
|
const runId = String(args.runId ?? "");
|
|
7098
7153
|
const { read } = await openRunTrace(context, runId);
|
|
@@ -7531,5 +7586,5 @@ async function runReadOnlyMcpServer(options = {}) {
|
|
|
7531
7586
|
}
|
|
7532
7587
|
|
|
7533
7588
|
export { MCP_MAX_REQUEST_BYTES, MCP_PROTOCOL_VERSION, READ_ONLY_TOOLS, callReadOnlyTool, createMcpServerContext, handleMcpProtocolLine, runReadOnlyMcpServer };
|
|
7534
|
-
//# sourceMappingURL=chunk-
|
|
7535
|
-
//# sourceMappingURL=chunk-
|
|
7589
|
+
//# sourceMappingURL=chunk-C6EBJS57.mjs.map
|
|
7590
|
+
//# sourceMappingURL=chunk-C6EBJS57.mjs.map
|