mcpspec 1.2.0 → 1.2.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/dist/index.js +24 -2
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1138,6 +1138,26 @@ var COLORS6 = {
|
|
|
1138
1138
|
cyan: "\x1B[36m",
|
|
1139
1139
|
blue: "\x1B[34m"
|
|
1140
1140
|
};
|
|
1141
|
+
function formatInputSummary(input) {
|
|
1142
|
+
const keys = Object.keys(input);
|
|
1143
|
+
if (keys.length === 0) return "";
|
|
1144
|
+
const parts = keys.map((k) => {
|
|
1145
|
+
const v = input[k];
|
|
1146
|
+
const val = typeof v === "string" ? v : JSON.stringify(v);
|
|
1147
|
+
const truncated = val != null && val.length > 30 ? val.slice(0, 27) + "..." : val;
|
|
1148
|
+
return `${k}=${truncated}`;
|
|
1149
|
+
});
|
|
1150
|
+
return ` ${COLORS6.gray}(${parts.join(", ")})${COLORS6.reset}`;
|
|
1151
|
+
}
|
|
1152
|
+
function formatOutputSummary(output) {
|
|
1153
|
+
if (!output || output.length === 0) return "";
|
|
1154
|
+
const first = output[0];
|
|
1155
|
+
if (!first) return "";
|
|
1156
|
+
const text = first["text"];
|
|
1157
|
+
if (!text) return "";
|
|
1158
|
+
const truncated = text.length > 50 ? text.slice(0, 47) + "..." : text;
|
|
1159
|
+
return ` ${COLORS6.gray}\u2192 ${truncated}${COLORS6.reset}`;
|
|
1160
|
+
}
|
|
1141
1161
|
var recordCommand = new Command11("record").description("Record, replay, and manage inspector session recordings");
|
|
1142
1162
|
recordCommand.command("start").description("Start a recording session (interactive REPL)").argument("<server>", 'Server command (e.g., "npx @modelcontextprotocol/server-filesystem /tmp")').action(async (serverCommand) => {
|
|
1143
1163
|
let client = null;
|
|
@@ -1347,11 +1367,13 @@ recordCommand.command("replay").description("Replay a recording against a server
|
|
|
1347
1367
|
const replayer = new RecordingReplayer();
|
|
1348
1368
|
const result = await replayer.replay(recording, client, {
|
|
1349
1369
|
onStepStart: (i, step) => {
|
|
1350
|
-
|
|
1370
|
+
const inputSummary = formatInputSummary(step.input);
|
|
1371
|
+
process.stdout.write(` ${i + 1}/${recording.steps.length} ${step.tool}${inputSummary}... `);
|
|
1351
1372
|
},
|
|
1352
1373
|
onStepComplete: (_i, replayed) => {
|
|
1374
|
+
const outputSummary = formatOutputSummary(replayed.output);
|
|
1353
1375
|
const status = replayed.isError ? `${COLORS6.red}ERROR${COLORS6.reset}` : `${COLORS6.green}OK${COLORS6.reset}`;
|
|
1354
|
-
console.log(`[${status}] ${COLORS6.gray}${replayed.durationMs}ms${COLORS6.reset}`);
|
|
1376
|
+
console.log(`[${status}] ${COLORS6.gray}${replayed.durationMs}ms${COLORS6.reset}${outputSummary}`);
|
|
1355
1377
|
}
|
|
1356
1378
|
});
|
|
1357
1379
|
const differ = new RecordingDiffer();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcpspec",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "The definitive MCP server testing platform",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@inquirer/prompts": "^7.0.0",
|
|
30
30
|
"commander": "^12.1.0",
|
|
31
31
|
"open": "^10.1.0",
|
|
32
|
-
"@mcpspec/
|
|
33
|
-
"@mcpspec/
|
|
34
|
-
"@mcpspec/
|
|
32
|
+
"@mcpspec/core": "1.2.1",
|
|
33
|
+
"@mcpspec/shared": "1.2.1",
|
|
34
|
+
"@mcpspec/server": "1.2.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"tsup": "^8.0.0",
|