@yawlabs/mcp-compliance 0.14.0 → 0.14.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 CHANGED
@@ -700,7 +700,7 @@ function hasRegressions(summary) {
700
700
 
701
701
  // src/mcp/server.ts
702
702
  import { existsSync as existsSync2, readFileSync as readFileSync2, realpathSync } from "fs";
703
- import { dirname, join as join2, resolve as resolve2 } from "path";
703
+ import { basename, dirname, join as join2, resolve as resolve2 } from "path";
704
704
  import { fileURLToPath } from "url";
705
705
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
706
706
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -4678,7 +4678,11 @@ function isInvokedDirectly() {
4678
4678
  const argv1 = process.argv[1];
4679
4679
  if (!argv1) return false;
4680
4680
  try {
4681
- return realpathSync(argv1) === realpathSync(fileURLToPath(import.meta.url));
4681
+ const selfPath = realpathSync(fileURLToPath(import.meta.url));
4682
+ if (realpathSync(argv1) !== selfPath) return false;
4683
+ const file = basename(selfPath);
4684
+ const parent = basename(dirname(selfPath));
4685
+ return parent === "mcp" && (file === "server.js" || file === "server.ts");
4682
4686
  } catch {
4683
4687
  return false;
4684
4688
  }
@@ -6,7 +6,7 @@ import {
6
6
 
7
7
  // src/mcp/server.ts
8
8
  import { existsSync, readFileSync, realpathSync } from "fs";
9
- import { dirname, join, resolve } from "path";
9
+ import { basename, dirname, join, resolve } from "path";
10
10
  import { fileURLToPath } from "url";
11
11
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
12
12
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -215,7 +215,11 @@ function isInvokedDirectly() {
215
215
  const argv1 = process.argv[1];
216
216
  if (!argv1) return false;
217
217
  try {
218
- return realpathSync(argv1) === realpathSync(fileURLToPath(import.meta.url));
218
+ const selfPath = realpathSync(fileURLToPath(import.meta.url));
219
+ if (realpathSync(argv1) !== selfPath) return false;
220
+ const file = basename(selfPath);
221
+ const parent = basename(dirname(selfPath));
222
+ return parent === "mcp" && (file === "server.js" || file === "server.ts");
219
223
  } catch {
220
224
  return false;
221
225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/mcp-compliance",
3
- "version": "0.14.0",
3
+ "version": "0.14.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)",