@inspectr/mcplab-mcp-server 1.8.0 → 1.8.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.
|
@@ -22,6 +22,7 @@ Use this workflow when the user wants to understand or improve a test case from
|
|
|
22
22
|
6. Optionally execute. Use `mcplab_run_eval` for an immediate run. Use `mcplab_queue_run` when the APP should pick it up, and report its queue URL. Do not run or queue merely because an update was saved.
|
|
23
23
|
|
|
24
24
|
Authoring constraints:
|
|
25
|
+
|
|
25
26
|
- Use raw MCP tool names in checks (for example `mcplab_list_runs`), never client display prefixes such as `MCPLab:`.
|
|
26
27
|
- `eval.tool_sequence` is a flat ordered `string[]`; do not emit `allowed_tool_sequences` or `tool_sequence.allow`.
|
|
27
28
|
- Prefer scenario-owned `mcp_servers: [{ ref: ... }]` over deprecated top-level `servers`.
|
|
@@ -36,12 +37,14 @@ Authoring constraints:
|
|
|
36
37
|
## Workflow Router
|
|
37
38
|
|
|
38
39
|
1. Classify the request:
|
|
40
|
+
|
|
39
41
|
- Config authoring/edits -> follow "Config Workflow".
|
|
40
42
|
- Command execution/help -> follow "CLI Workflow".
|
|
41
43
|
- Failure/debugging -> follow "Troubleshooting Workflow".
|
|
42
44
|
- Results interpretation/comparison -> follow "Output Analysis Workflow".
|
|
43
45
|
|
|
44
46
|
2. Load only needed references:
|
|
47
|
+
|
|
45
48
|
- Config patterns: `references/config-recipes.md`
|
|
46
49
|
- Command patterns: `references/cli-recipes.md`
|
|
47
50
|
- Error diagnosis: `references/troubleshooting.md`
|
|
@@ -63,16 +66,20 @@ Use concrete file paths and command lines. Avoid generic advice.
|
|
|
63
66
|
When the request is about creating or editing MCPLab config, the assistant must:
|
|
64
67
|
|
|
65
68
|
1. Ask for only missing critical inputs:
|
|
69
|
+
|
|
66
70
|
- MCP endpoint URL(s)
|
|
67
71
|
- target agent/model(s)
|
|
68
72
|
- scenario intent
|
|
69
73
|
- auth mode (`bearer`, `oauth_client_credentials`, or `oauth_authorization_code`)
|
|
74
|
+
|
|
70
75
|
2. Produce a minimal valid config first (single scenario), then optional expansions.
|
|
71
76
|
3. Return copy-ready YAML plus one verification command (`mcplab run -c ...`).
|
|
72
77
|
4. Include a short validation checklist:
|
|
78
|
+
|
|
73
79
|
- schema shape valid
|
|
74
80
|
- env var names present (never values)
|
|
75
81
|
- scenario references resolve
|
|
82
|
+
|
|
76
83
|
5. If user provides a broken config, return the smallest patch instead of full rewrites.
|
|
77
84
|
|
|
78
85
|
## LLM Report Analysis Mode
|
|
@@ -80,24 +87,32 @@ When the request is about creating or editing MCPLab config, the assistant must:
|
|
|
80
87
|
When the request is about analyzing results, the assistant must:
|
|
81
88
|
|
|
82
89
|
1. Prefer MCP analysis tools first to reduce context/token usage:
|
|
90
|
+
|
|
83
91
|
- `mcplab_aggregate_runs` for multi-run trends and compact metric summaries
|
|
84
92
|
- `mcplab_compare_runs` for structured run-to-run regressions/improvements
|
|
85
93
|
- `mcplab_search_markdown_reports` to locate report files
|
|
86
94
|
- `mcplab_search_tool_analysis_results` to query stored tool analysis data
|
|
95
|
+
|
|
87
96
|
2. Read artifacts directly only when needed:
|
|
97
|
+
|
|
88
98
|
- `results.json`
|
|
89
99
|
- `summary.md`
|
|
90
100
|
- `trace.jsonl` (for failing scenarios or unclear tool behavior)
|
|
91
101
|
- `report.html` (optional, interactive confirmation)
|
|
102
|
+
|
|
92
103
|
3. Return analysis with:
|
|
104
|
+
|
|
93
105
|
- overall pass/fail summary
|
|
94
106
|
- failing scenario IDs and failure reason category
|
|
95
107
|
- tool-usage observations (missing required tools, forbidden tool usage, sequence drift)
|
|
96
108
|
- concrete remediation steps per failing scenario
|
|
109
|
+
|
|
97
110
|
4. For multi-agent runs, include side-by-side comparison:
|
|
111
|
+
|
|
98
112
|
- pass rate per agent
|
|
99
113
|
- median/typical latency
|
|
100
114
|
- scenario-level win/loss notes
|
|
115
|
+
|
|
101
116
|
5. Always reference exact artifact paths and scenario IDs in findings.
|
|
102
117
|
|
|
103
118
|
## Config Workflow
|
|
@@ -106,25 +121,35 @@ When the request is about analyzing results, the assistant must:
|
|
|
106
121
|
2. Add explicit scenario MCP connectivity with `scenarios[].mcp_servers` entries (`ref` or inline server object).
|
|
107
122
|
3. Add one working agent, then add variants if needed.
|
|
108
123
|
4. Add scenarios with:
|
|
124
|
+
|
|
109
125
|
- unique kebab-case `id`
|
|
110
126
|
- optional `agent` key when scenario should pin to one model
|
|
111
127
|
- at least one `servers` entry (labels available to the scenario)
|
|
112
128
|
- `prompt`
|
|
129
|
+
|
|
113
130
|
5. For reusable test-cases across environments, prefer referenced scenario overlays:
|
|
131
|
+
|
|
114
132
|
- `scenarios: [{ ref: "<test-case-id>", mcp_servers: [{ ref: "<env-server-id>" }] }]`
|
|
115
133
|
- This keeps prompt/eval in library test-case and swaps only MCP target per eval.
|
|
134
|
+
|
|
116
135
|
6. Add optional `eval` and `extract` blocks after baseline run succeeds.
|
|
136
|
+
- The scenario authoring MCP tools also accept a canonical `eval` object containing `tool_constraints`, flat `tool_sequence`, `response_assertions` (`regex`, `contains`, `not_contains`, `starts_with`, `ends_with`, `equals`, and JSONPath variants), `tool_input_assertions` (`contains`, `regex`, `jsonpath`), `agent_assertions`, and `agent_context`.
|
|
137
|
+
- Existing convenience fields (`required_tools`, `forbidden_tools`, `tool_sequence`, and `response_regex_patterns`) remain supported; do not provide a convenience field and its canonical equivalent in the same request.
|
|
117
138
|
7. Prefer literal response assertions first (`contains`, `equals`, etc.), then `regex` only when variability requires it.
|
|
118
139
|
8. Add deterministic tool-input assertions when the requirement is structural:
|
|
140
|
+
|
|
119
141
|
- `contains`: select one raw MCP tool name and require case-insensitive text anywhere in serialized arguments.
|
|
120
142
|
- `regex`: select one raw MCP tool name and match a JavaScript regular expression against serialized arguments; use `pattern` in direct core/YAML config and `value` in app eval-rule/assistant suggestion shapes.
|
|
121
143
|
- `jsonpath`: select one raw MCP tool name and inspect `path`; omit `equals` to require existence, or set a string/number/boolean primitive for equality.
|
|
144
|
+
|
|
122
145
|
9. Add `agent_check` only for semantic, fuzzy, or intent-based validation. Give it a stable `label` and a precise `prompt`.
|
|
123
146
|
10. When using `agent_check`, optionally set `agent_context` once per scenario:
|
|
147
|
+
|
|
124
148
|
- `include_prompt`: pass the scenario prompt to the Judge.
|
|
125
149
|
- `include_tool_sequence`: pass called MCP tool names.
|
|
126
150
|
- `include_tool_inputs`: pass called MCP tool names and their arguments.
|
|
127
|
-
These context fields are shared across all Judge checks and sent in the batched Judge request.
|
|
151
|
+
These context fields are shared across all Judge checks and sent in the batched Judge request.
|
|
152
|
+
|
|
128
153
|
11. Validate references and shape against `config-schema.json`; also verify `agent_assertions` and `agent_context` against the current core types and website reference because older schema copies may not list these newer fields.
|
|
129
154
|
12. Prefer minimal deterministic edits over large rewrites.
|
|
130
155
|
|
|
@@ -137,27 +162,34 @@ These context fields are shared across all Judge checks and sent in the batched
|
|
|
137
162
|
Use this workflow when MCP execution tools are not available or when the user explicitly asks for shell commands.
|
|
138
163
|
|
|
139
164
|
1. Choose command by intent:
|
|
165
|
+
|
|
140
166
|
- Execute evaluations -> `mcplab run`
|
|
141
167
|
- Open local UI/API bridge -> `mcplab app`
|
|
142
168
|
- Rebuild HTML report from existing run -> `mcplab report`
|
|
143
169
|
- Query run artifacts in LLM-friendly format -> `mcplab results`
|
|
170
|
+
|
|
144
171
|
2. Use only documented flags from CLI source.
|
|
145
172
|
3. For model comparison, use `mcplab run --agents ...`.
|
|
146
173
|
4. For runtime environment switching without YAML edits, prefer:
|
|
174
|
+
|
|
147
175
|
- `mcplab run ... --server-override-all <serverRef[,serverRef...]>`
|
|
148
176
|
- Add per-test exceptions with repeatable `--server-override <scenarioId>=<serverRef[,serverRef...]>`
|
|
177
|
+
|
|
149
178
|
5. Runtime server overrides are ephemeral (current run only) and do not persist to eval files.
|
|
150
179
|
6. If a run fails, capture exact error and switch to troubleshooting workflow.
|
|
151
180
|
|
|
152
181
|
## Troubleshooting Workflow
|
|
153
182
|
|
|
154
183
|
1. Match error to category:
|
|
184
|
+
|
|
155
185
|
- Connectivity/auth (`fetch failed`, missing token/env)
|
|
156
186
|
- Config reference mismatch (unknown agent/server/scenario linkage)
|
|
157
187
|
- Invalid numeric options (`--runs`, `--port`)
|
|
188
|
+
|
|
158
189
|
2. Apply smallest corrective change.
|
|
159
190
|
3. Re-run same command to verify fix.
|
|
160
191
|
4. If still failing, ask for:
|
|
192
|
+
|
|
161
193
|
- failing command
|
|
162
194
|
- relevant config snippet
|
|
163
195
|
- exact stderr text
|
|
@@ -166,13 +198,19 @@ Use this workflow when MCP execution tools are not available or when the user ex
|
|
|
166
198
|
## Output Analysis Workflow
|
|
167
199
|
|
|
168
200
|
1. Start with LLM-first MCP results triage:
|
|
201
|
+
|
|
169
202
|
- `mcplab_results_search` for compact candidate hits
|
|
170
203
|
- `mcplab_results_context` for focused excerpts
|
|
204
|
+
|
|
171
205
|
2. Use low-level artifact reads only when exact/raw evidence is required:
|
|
206
|
+
|
|
172
207
|
- `mcplab_read_run_artifact` with optional `line_start`/`line_end`
|
|
208
|
+
|
|
173
209
|
3. Then use MCP comparison tools for trend/delta analysis:
|
|
210
|
+
|
|
174
211
|
- `mcplab_aggregate_runs` for historical trends
|
|
175
212
|
- `mcplab_compare_runs` for deterministic run deltas
|
|
213
|
+
|
|
176
214
|
4. For multi-agent runs, compare by pass rate, tool efficiency, and latency.
|
|
177
215
|
5. Highlight regressions with concrete scenario IDs and observed behavior deltas.
|
|
178
216
|
6. When quality drift is requested, compare deterministic run metrics first, then inspect targeted artifact excerpts (`results.json`, `trace.jsonl`) for output-level drift.
|
|
@@ -203,6 +241,7 @@ User request:
|
|
|
203
241
|
"Help me write mcplab eval YAML with OAuth auth."
|
|
204
242
|
|
|
205
243
|
Assistant behavior:
|
|
244
|
+
|
|
206
245
|
1. Provide minimal valid YAML with `agents`, `scenarios`, and scenario-scoped `mcp_servers`.
|
|
207
246
|
2. Use `auth.type: oauth_client_credentials` with `token_url`, `client_id_env`, and `client_secret_env`.
|
|
208
247
|
3. List required env var names and provide one `mcplab run -c ...` verification command.
|
|
@@ -213,6 +252,7 @@ User request:
|
|
|
213
252
|
"How do I compare agents?"
|
|
214
253
|
|
|
215
254
|
Assistant behavior:
|
|
255
|
+
|
|
216
256
|
1. Provide one `mcplab run --agents ...` command for comparison.
|
|
217
257
|
2. Provide one follow-up analysis step using `mcplab results search ...` then `mcplab results context ...`.
|
|
218
258
|
|
|
@@ -222,6 +262,7 @@ User request:
|
|
|
222
262
|
"Compare historical run quality and spot regressions."
|
|
223
263
|
|
|
224
264
|
Assistant behavior:
|
|
265
|
+
|
|
225
266
|
1. Use `mcplab_aggregate_runs` for compact trend metrics over selected runs.
|
|
226
267
|
2. Use `mcplab_compare_runs` to identify deterministic regressions/improvements.
|
|
227
268
|
3. If semantic output quality is requested, use `mcplab_results_search` then `mcplab_results_context` for representative scenario deltas; fallback to `mcplab_read_run_artifact` only if needed.
|
|
@@ -233,6 +274,7 @@ User request:
|
|
|
233
274
|
"My run fails with fetch failed."
|
|
234
275
|
|
|
235
276
|
Assistant behavior:
|
|
277
|
+
|
|
236
278
|
1. Ask for exact command, relevant server config block, and error text.
|
|
237
279
|
2. Check URL reachability, auth env variable names, and server auth mode match.
|
|
238
280
|
3. Provide smallest retry command (`mcplab run -c ... -s ... -n 1`) and next artifact to inspect (`trace.jsonl`).
|
|
@@ -243,6 +285,7 @@ User request:
|
|
|
243
285
|
"Analyze this run and tell me why it failed."
|
|
244
286
|
|
|
245
287
|
Assistant behavior:
|
|
288
|
+
|
|
246
289
|
1. Start with `mcplab_results_search` to list likely failing scenarios.
|
|
247
290
|
2. Use `mcplab_results_context` for focused scenario evidence.
|
|
248
291
|
3. Use `mcplab_read_run_artifact` only when exact raw lines or full artifact slices are required.
|
|
@@ -254,6 +297,7 @@ User request:
|
|
|
254
297
|
"Verify that search_tags receives TM5-BP2 and that the answer is complete."
|
|
255
298
|
|
|
256
299
|
Assistant behavior:
|
|
300
|
+
|
|
257
301
|
1. Prefer a deterministic tool-input check for the required text:
|
|
258
302
|
|
|
259
303
|
```yaml
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inspectr/mcplab-mcp-server",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "MCP server that exposes MCPLab evaluation tools — query runs, results, and traces via the Model Context Protocol",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"vitest": "^4.1.8"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@inspectr/mcplab-core": "1.22.
|
|
58
|
-
"@inspectr/mcplab-reporting": "1.2.
|
|
57
|
+
"@inspectr/mcplab-core": "1.22.1",
|
|
58
|
+
"@inspectr/mcplab-reporting": "1.2.3",
|
|
59
59
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
60
60
|
"yaml": "^2.8.4",
|
|
61
61
|
"zod": "^3.25.0"
|