@gleanwork/mcp-server-tester 1.0.0-beta.0 → 1.0.0-beta.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/cli/index.js +14 -3
- package/dist/fixtures/mcp.d.ts +1 -1
- package/dist/fixtures/mcp.js +16 -6
- package/dist/fixtures/mcp.js.map +1 -1
- package/dist/index.cjs +123 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -49
- package/dist/index.d.ts +81 -49
- package/dist/index.js +123 -18
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/cli/index.js
CHANGED
|
@@ -80,7 +80,7 @@ function JsonPreview({ data, maxLines = 15 }) {
|
|
|
80
80
|
|
|
81
81
|
// package.json
|
|
82
82
|
var package_default = {
|
|
83
|
-
version: "1.0.0-beta.
|
|
83
|
+
version: "1.0.0-beta.1"};
|
|
84
84
|
|
|
85
85
|
// src/cli/templates/index.ts
|
|
86
86
|
function getPlaywrightConfigTemplate(answers) {
|
|
@@ -564,6 +564,7 @@ var StdioConfigSchema = z.object({
|
|
|
564
564
|
command: z.string().min(1, "command is required for stdio transport"),
|
|
565
565
|
args: z.array(z.string()).optional(),
|
|
566
566
|
cwd: z.string().optional(),
|
|
567
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
567
568
|
capabilities: MCPHostCapabilitiesSchema.optional(),
|
|
568
569
|
connectTimeoutMs: z.number().positive().optional(),
|
|
569
570
|
requestTimeoutMs: z.number().positive().optional(),
|
|
@@ -857,7 +858,14 @@ async function createMCPClientForConfig(config, options) {
|
|
|
857
858
|
args: validatedConfig.args ?? [],
|
|
858
859
|
...validatedConfig.cwd && { cwd: validatedConfig.cwd },
|
|
859
860
|
// Suppress server stderr when quiet mode is enabled
|
|
860
|
-
...validatedConfig.quiet && { stderr: "ignore" }
|
|
861
|
+
...validatedConfig.quiet && { stderr: "ignore" },
|
|
862
|
+
...validatedConfig.env && {
|
|
863
|
+
env: Object.fromEntries(
|
|
864
|
+
Object.entries({ ...process.env, ...validatedConfig.env }).filter(
|
|
865
|
+
(entry) => entry[1] !== void 0
|
|
866
|
+
)
|
|
867
|
+
)
|
|
868
|
+
}
|
|
861
869
|
});
|
|
862
870
|
debugClient("Connecting via stdio: %O", {
|
|
863
871
|
command: validatedConfig.command,
|
|
@@ -996,7 +1004,10 @@ async function closeMCPClient(client) {
|
|
|
996
1004
|
try {
|
|
997
1005
|
await client.close();
|
|
998
1006
|
} catch (error) {
|
|
999
|
-
|
|
1007
|
+
debugClient(
|
|
1008
|
+
"Error closing client: %s",
|
|
1009
|
+
error instanceof Error ? error.message : String(error)
|
|
1010
|
+
);
|
|
1000
1011
|
throw error;
|
|
1001
1012
|
} finally {
|
|
1002
1013
|
const agent = agentRegistry.get(client);
|
package/dist/fixtures/mcp.d.ts
CHANGED
|
@@ -206,7 +206,7 @@ type RubricSpec = BuiltInRubric | {
|
|
|
206
206
|
};
|
|
207
207
|
|
|
208
208
|
/** Valid LLM judge provider kinds. */
|
|
209
|
-
type ProviderKind = '
|
|
209
|
+
type ProviderKind = 'anthropic' | 'openai' | 'google';
|
|
210
210
|
|
|
211
211
|
/**
|
|
212
212
|
* Tool call validators for llm_host simulation results.
|
package/dist/fixtures/mcp.js
CHANGED
|
@@ -950,9 +950,8 @@ Validation errors: ${JSON.stringify(validation.error.issues)}`
|
|
|
950
950
|
|
|
951
951
|
// src/judge/judgeClient.ts
|
|
952
952
|
function createJudge(config = {}) {
|
|
953
|
-
const provider = config.provider ?? "
|
|
953
|
+
const provider = config.provider ?? "anthropic";
|
|
954
954
|
switch (provider) {
|
|
955
|
-
case "claude":
|
|
956
955
|
case "anthropic":
|
|
957
956
|
return createClaudeAgentJudge(config);
|
|
958
957
|
case "openai":
|
|
@@ -1215,7 +1214,7 @@ function validateToolCalls(response, expectation) {
|
|
|
1215
1214
|
).length;
|
|
1216
1215
|
const recall = requiredCalls.length > 0 ? calledRequiredCount / requiredCalls.length : 1;
|
|
1217
1216
|
const allowedNames = new Set(expectation.calls.map((c) => c.name));
|
|
1218
|
-
const precision = actual.length > 0
|
|
1217
|
+
const precision = actual.length > 0 ? actual.filter((c) => allowedNames.has(c.name)).length / actual.length : 1;
|
|
1219
1218
|
const metrics = { precision, recall };
|
|
1220
1219
|
const order = expectation.order ?? "any";
|
|
1221
1220
|
if (order === "strict") {
|
|
@@ -1360,6 +1359,7 @@ var StdioConfigSchema = z.object({
|
|
|
1360
1359
|
command: z.string().min(1, "command is required for stdio transport"),
|
|
1361
1360
|
args: z.array(z.string()).optional(),
|
|
1362
1361
|
cwd: z.string().optional(),
|
|
1362
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
1363
1363
|
capabilities: MCPHostCapabilitiesSchema.optional(),
|
|
1364
1364
|
connectTimeoutMs: z.number().positive().optional(),
|
|
1365
1365
|
requestTimeoutMs: z.number().positive().optional(),
|
|
@@ -1423,7 +1423,7 @@ var debugHttp = createDebug(`${NAMESPACE}:http`);
|
|
|
1423
1423
|
|
|
1424
1424
|
// package.json
|
|
1425
1425
|
var package_default = {
|
|
1426
|
-
version: "1.0.0-beta.
|
|
1426
|
+
version: "1.0.0-beta.1"};
|
|
1427
1427
|
var debug = createDebug("mcp-server-tester:oauth-flow");
|
|
1428
1428
|
async function generatePKCE() {
|
|
1429
1429
|
const codeVerifier = oauth.generateRandomCodeVerifier();
|
|
@@ -1657,7 +1657,14 @@ async function createMCPClientForConfig(config, options) {
|
|
|
1657
1657
|
args: validatedConfig.args ?? [],
|
|
1658
1658
|
...validatedConfig.cwd && { cwd: validatedConfig.cwd },
|
|
1659
1659
|
// Suppress server stderr when quiet mode is enabled
|
|
1660
|
-
...validatedConfig.quiet && { stderr: "ignore" }
|
|
1660
|
+
...validatedConfig.quiet && { stderr: "ignore" },
|
|
1661
|
+
...validatedConfig.env && {
|
|
1662
|
+
env: Object.fromEntries(
|
|
1663
|
+
Object.entries({ ...process.env, ...validatedConfig.env }).filter(
|
|
1664
|
+
(entry) => entry[1] !== void 0
|
|
1665
|
+
)
|
|
1666
|
+
)
|
|
1667
|
+
}
|
|
1661
1668
|
});
|
|
1662
1669
|
debugClient("Connecting via stdio: %O", {
|
|
1663
1670
|
command: validatedConfig.command,
|
|
@@ -1796,7 +1803,10 @@ async function closeMCPClient(client) {
|
|
|
1796
1803
|
try {
|
|
1797
1804
|
await client.close();
|
|
1798
1805
|
} catch (error) {
|
|
1799
|
-
|
|
1806
|
+
debugClient(
|
|
1807
|
+
"Error closing client: %s",
|
|
1808
|
+
error instanceof Error ? error.message : String(error)
|
|
1809
|
+
);
|
|
1800
1810
|
throw error;
|
|
1801
1811
|
} finally {
|
|
1802
1812
|
const agent = agentRegistry.get(client);
|