@gleanwork/mcp-server-tester 1.0.0-beta.2 → 1.0.0-beta.3

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 CHANGED
@@ -30,18 +30,19 @@ Playwright tests are fast, deterministic, and designed for CI. Use them for regr
30
30
 
31
31
  Available matchers:
32
32
 
33
- | Matcher | Description |
34
- | ------------------------ | ----------------------------------------------- |
35
- | `toContainToolText` | Response contains expected substrings |
36
- | `toMatchToolSchema` | Response validates against a Zod schema |
37
- | `toMatchToolPattern` | Response matches a regex pattern |
38
- | `toMatchToolSnapshot` | Response matches a saved baseline |
39
- | `toBeToolError` | Response is (or is not) an error |
40
- | `toHaveToolResponseSize` | Response size is within bounds |
41
- | `toSatisfyToolPredicate` | Response satisfies a custom function |
42
- | `toHaveToolCalls` | LLM called the expected tools |
43
- | `toHaveToolCallCount` | LLM made N tool calls |
44
- | `toPassToolJudge` | LLM evaluates response quality against a rubric |
33
+ | Matcher | Description |
34
+ | ------------------------ | ---------------------------------------------------- |
35
+ | `toMatchToolResponse` | Response exactly matches expected value (deep equal) |
36
+ | `toContainToolText` | Response contains expected substrings |
37
+ | `toMatchToolSchema` | Response validates against a Zod schema |
38
+ | `toMatchToolPattern` | Response matches a regex pattern |
39
+ | `toMatchToolSnapshot` | Response matches a saved baseline |
40
+ | `toBeToolError` | Response is (or is not) an error |
41
+ | `toHaveToolResponseSize` | Response size is within bounds |
42
+ | `toSatisfyToolPredicate` | Response satisfies a custom function |
43
+ | `toHaveToolCalls` | LLM called the expected tools |
44
+ | `toHaveToolCallCount` | LLM made N tool calls |
45
+ | `toPassToolJudge` | LLM evaluates response quality against a rubric |
45
46
 
46
47
  ## Eval Datasets
47
48
 
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.2"};
83
+ version: "1.0.0-beta.3"};
84
84
 
85
85
  // src/cli/templates/index.ts
86
86
  function getPlaywrightConfigTemplate(answers) {
@@ -877,7 +877,10 @@ async function createMCPClientForConfig(config, options) {
877
877
  validatedConfig.connectTimeoutMs !== void 0 ? { timeout: validatedConfig.connectTimeoutMs } : void 0
878
878
  );
879
879
  } else if (isHttpConfig(validatedConfig)) {
880
- const headers = { ...validatedConfig.headers };
880
+ const headers = {
881
+ "User-Agent": `@gleanwork/mcp-server-tester/${package_default.version}`,
882
+ ...validatedConfig.headers
883
+ };
881
884
  if (validatedConfig.auth?.clientCredentials && true) {
882
885
  const ccConfig = validatedConfig.auth.clientCredentials;
883
886
  const clientId = ccConfig.clientId ?? process.env["MCP_CLIENT_ID"];
@@ -169,6 +169,14 @@ declare function toMatchToolPattern(this: {
169
169
  /**
170
170
  * Creates the toMatchToolSnapshot matcher function
171
171
  *
172
+ * @remarks
173
+ * **Requires Playwright test context.** This matcher calls `expect(content).toMatchSnapshot()`
174
+ * internally, which only works inside a Playwright test (i.e., when `testInfo` is available).
175
+ * Calling it outside a Playwright test will throw a cryptic context error.
176
+ *
177
+ * To test sanitizer logic without a Playwright context, use the exported `applySanitizers`
178
+ * function directly.
179
+ *
172
180
  * Note: This is an async matcher that uses Playwright's snapshot testing.
173
181
  */
174
182
  declare function toMatchToolSnapshot(this: {
@@ -1434,7 +1434,7 @@ var debugHttp = createDebug(`${NAMESPACE}:http`);
1434
1434
 
1435
1435
  // package.json
1436
1436
  var package_default = {
1437
- version: "1.0.0-beta.2"};
1437
+ version: "1.0.0-beta.3"};
1438
1438
  var debug = createDebug("mcp-server-tester:oauth-flow");
1439
1439
  async function generatePKCE() {
1440
1440
  const codeVerifier = oauth.generateRandomCodeVerifier();
@@ -1687,7 +1687,10 @@ async function createMCPClientForConfig(config, options) {
1687
1687
  validatedConfig.connectTimeoutMs !== void 0 ? { timeout: validatedConfig.connectTimeoutMs } : void 0
1688
1688
  );
1689
1689
  } else if (isHttpConfig(validatedConfig)) {
1690
- const headers = { ...validatedConfig.headers };
1690
+ const headers = {
1691
+ "User-Agent": `@gleanwork/mcp-server-tester/${package_default.version}`,
1692
+ ...validatedConfig.headers
1693
+ };
1691
1694
  if (validatedConfig.auth?.clientCredentials && !options?.authProvider) {
1692
1695
  const ccConfig = validatedConfig.auth.clientCredentials;
1693
1696
  const clientId = ccConfig.clientId ?? process.env["MCP_CLIENT_ID"];