@yawlabs/mcp-compliance 0.8.0 → 0.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.
@@ -969,7 +969,7 @@ async function runComplianceSuite(url, options = {}) {
969
969
  ...options.headers
970
970
  },
971
971
  body: JSON.stringify({ jsonrpc: "2.0", id: 0, method: "ping" }),
972
- signal: AbortSignal.timeout(Math.min(options.timeout || 15e3, 1e4))
972
+ signal: AbortSignal.timeout(options.preflightTimeout ?? Math.min(options.timeout || 15e3, 1e4))
973
973
  });
974
974
  await preflight.body.text();
975
975
  } catch {
@@ -2072,7 +2072,8 @@ async function runComplianceSuite(url, options = {}) {
2072
2072
  );
2073
2073
  }
2074
2074
  const hasResources = !!serverInfo.capabilities.resources;
2075
- const hasSubscribe = !!serverInfo.capabilities.resources?.subscribe;
2075
+ const resourcesCap = serverInfo.capabilities.resources;
2076
+ const hasSubscribe = !!(typeof resourcesCap === "object" && resourcesCap !== null && "subscribe" in resourcesCap && resourcesCap.subscribe);
2076
2077
  if (hasResources) {
2077
2078
  let cachedResourcesList = null;
2078
2079
  await test(
@@ -3353,7 +3354,7 @@ async function runComplianceSuite(url, options = {}) {
3353
3354
  return { passed: false, details: `HTTP ${res.statusCode}` };
3354
3355
  }
3355
3356
  );
3356
- const MAX_WARNINGS = 50;
3357
+ const MAX_WARNINGS = 100;
3357
3358
  if (warnings.length > MAX_WARNINGS) {
3358
3359
  const truncated = warnings.length - MAX_WARNINGS;
3359
3360
  warnings.splice(MAX_WARNINGS, truncated, `... and ${truncated} more warning(s) suppressed`);
package/dist/index.js CHANGED
@@ -984,7 +984,7 @@ async function runComplianceSuite(url, options = {}) {
984
984
  ...options.headers
985
985
  },
986
986
  body: JSON.stringify({ jsonrpc: "2.0", id: 0, method: "ping" }),
987
- signal: AbortSignal.timeout(Math.min(options.timeout || 15e3, 1e4))
987
+ signal: AbortSignal.timeout(options.preflightTimeout ?? Math.min(options.timeout || 15e3, 1e4))
988
988
  });
989
989
  await preflight.body.text();
990
990
  } catch {
@@ -2087,7 +2087,8 @@ async function runComplianceSuite(url, options = {}) {
2087
2087
  );
2088
2088
  }
2089
2089
  const hasResources = !!serverInfo.capabilities.resources;
2090
- const hasSubscribe = !!serverInfo.capabilities.resources?.subscribe;
2090
+ const resourcesCap = serverInfo.capabilities.resources;
2091
+ const hasSubscribe = !!(typeof resourcesCap === "object" && resourcesCap !== null && "subscribe" in resourcesCap && resourcesCap.subscribe);
2091
2092
  if (hasResources) {
2092
2093
  let cachedResourcesList = null;
2093
2094
  await test(
@@ -3368,7 +3369,7 @@ async function runComplianceSuite(url, options = {}) {
3368
3369
  return { passed: false, details: `HTTP ${res.statusCode}` };
3369
3370
  }
3370
3371
  );
3371
- const MAX_WARNINGS = 50;
3372
+ const MAX_WARNINGS = 100;
3372
3373
  if (warnings.length > MAX_WARNINGS) {
3373
3374
  const truncated = warnings.length - MAX_WARNINGS;
3374
3375
  warnings.splice(MAX_WARNINGS, truncated, `... and ${truncated} more warning(s) suppressed`);
@@ -3826,7 +3827,7 @@ var program = new Command();
3826
3827
  program.name("mcp-compliance").description("Test MCP servers for spec compliance").version(version2);
3827
3828
  program.command("test").description("Run the full compliance test suite against an MCP server").argument("<url>", "MCP server URL to test").addOption(
3828
3829
  new Option("--format <format>", "Output format").choices(["terminal", "json", "sarif"]).default("terminal")
3829
- ).option("--strict", "Exit with code 1 on any required test failure (for CI)").option("-H, --header <header>", 'Add header to all requests (format: "Key: Value", repeatable)', parseHeaderArg, {}).option("--auth <token>", 'Shorthand for -H "Authorization: <token>"').option("--timeout <ms>", "Request timeout in milliseconds", "15000").option("--retries <n>", "Number of retries for failed tests", "0").option(
3830
+ ).option("--strict", "Exit with code 1 on any required test failure (for CI)").option("-H, --header <header>", 'Add header to all requests (format: "Key: Value", repeatable)', parseHeaderArg, {}).option("--auth <token>", 'Shorthand for -H "Authorization: <token>"').option("--timeout <ms>", "Request timeout in milliseconds", "15000").option("--preflight-timeout <ms>", "Preflight connectivity check timeout in milliseconds").option("--retries <n>", "Number of retries for failed tests", "0").option(
3830
3831
  "--only <items>",
3831
3832
  'Only run matching categories or test IDs, comma-separated (e.g., "transport,lifecycle" or "transport-post,lifecycle-init")',
3832
3833
  parseList
@@ -3847,6 +3848,7 @@ Testing ${url}...
3847
3848
  const report = await runComplianceSuite(url, {
3848
3849
  headers,
3849
3850
  timeout: parsePositiveInt(opts.timeout, "--timeout", 1),
3851
+ preflightTimeout: opts.preflightTimeout ? parsePositiveInt(opts.preflightTimeout, "--preflight-timeout", 1) : void 0,
3850
3852
  retries: parsePositiveInt(opts.retries, "--retries"),
3851
3853
  only: opts.only,
3852
3854
  skip: opts.skip,
@@ -2,7 +2,7 @@ import {
2
2
  SPEC_BASE,
3
3
  TEST_DEFINITIONS,
4
4
  runComplianceSuite
5
- } from "../chunk-DOIOJVEE.js";
5
+ } from "../chunk-4RNSPRSQ.js";
6
6
 
7
7
  // src/mcp/server.ts
8
8
  import { createRequire } from "module";
package/dist/runner.d.ts CHANGED
@@ -115,6 +115,8 @@ interface RunOptions {
115
115
  only?: string[];
116
116
  /** Skip tests matching these category names or test IDs */
117
117
  skip?: string[];
118
+ /** Preflight connectivity check timeout in milliseconds (default: min(timeout, 10000)) */
119
+ preflightTimeout?: number;
118
120
  }
119
121
  /**
120
122
  * Run the full MCP compliance test suite against a URL.
package/dist/runner.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  generateBadge,
8
8
  parseSSEResponse,
9
9
  runComplianceSuite
10
- } from "./chunk-DOIOJVEE.js";
10
+ } from "./chunk-4RNSPRSQ.js";
11
11
  export {
12
12
  SPEC_BASE,
13
13
  SPEC_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/mcp-compliance",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "CLI tool and MCP server that tests MCP servers for spec compliance",
5
5
  "license": "MIT",
6
6
  "author": "Yaw Labs <contact@yaw.sh> (https://yaw.sh)",