@yawlabs/mcp-compliance 0.3.0 → 0.4.0

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TEST_DEFINITIONS,
3
3
  runComplianceSuite
4
- } from "../chunk-U66YZGE5.js";
4
+ } from "../chunk-KNOSZ3TD.js";
5
5
 
6
6
  // src/mcp/server.ts
7
7
  import { createRequire } from "module";
@@ -10,8 +10,8 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
10
10
 
11
11
  // src/mcp/tools.ts
12
12
  import { z } from "zod";
13
- function registerTools(server2) {
14
- server2.tool(
13
+ function registerTools(server) {
14
+ server.tool(
15
15
  "mcp_compliance_test",
16
16
  "Run the full MCP compliance test suite against a server URL. Returns grade (A-F), score, and detailed results for all 43 tests covering transport, lifecycle, tools, resources, prompts, errors, and schema validation.",
17
17
  {
@@ -76,7 +76,7 @@ ${JSON.stringify(report, null, 2)}` }
76
76
  }
77
77
  }
78
78
  );
79
- server2.tool(
79
+ server.tool(
80
80
  "mcp_compliance_badge",
81
81
  "Get the badge markdown embed code for an MCP server. Runs the compliance test suite first to determine the grade.",
82
82
  {
@@ -125,7 +125,7 @@ ${JSON.stringify(report, null, 2)}` }
125
125
  }
126
126
  }
127
127
  );
128
- server2.tool(
128
+ server.tool(
129
129
  "mcp_compliance_explain",
130
130
  "Explain what a specific compliance test ID checks and why it matters.",
131
131
  {
@@ -165,7 +165,9 @@ ${TEST_DEFINITIONS.map((t) => t.id).join(", ")}`
165
165
  `Required: ${def.required ? "Yes" : "No"}`,
166
166
  `Spec reference: https://modelcontextprotocol.io/specification/2025-11-25/${def.specRef}`,
167
167
  "",
168
- def.description
168
+ def.description,
169
+ "",
170
+ `Fix: ${def.recommendation}`
169
171
  ].join("\n")
170
172
  }
171
173
  ]
@@ -177,13 +179,24 @@ ${TEST_DEFINITIONS.map((t) => t.id).join(", ")}`
177
179
  // src/mcp/server.ts
178
180
  var require2 = createRequire(import.meta.url);
179
181
  var { version } = require2("../../package.json");
180
- var server = new McpServer({ name: "mcp-compliance", version });
181
- registerTools(server);
182
- async function main() {
182
+ function createComplianceServer() {
183
+ const server = new McpServer({ name: "mcp-compliance", version });
184
+ registerTools(server);
185
+ return server;
186
+ }
187
+ async function startServer() {
188
+ const server = createComplianceServer();
183
189
  const transport = new StdioServerTransport();
184
190
  await server.connect(transport);
185
191
  }
186
- main().catch((err) => {
187
- console.error("MCP server error:", err);
188
- process.exit(1);
189
- });
192
+ var isDirectRun = process.argv[1]?.endsWith("mcp/server.js") || process.argv[1]?.endsWith("mcp\\server.js");
193
+ if (isDirectRun) {
194
+ startServer().catch((err) => {
195
+ console.error("MCP server error:", err);
196
+ process.exit(1);
197
+ });
198
+ }
199
+ export {
200
+ createComplianceServer,
201
+ startServer
202
+ };
package/dist/runner.d.ts CHANGED
@@ -58,6 +58,7 @@ interface TestDefinition {
58
58
  required: boolean;
59
59
  specRef: string;
60
60
  description: string;
61
+ recommendation: string;
61
62
  }
62
63
  /** All 43 test IDs with descriptions for the explain command */
63
64
  declare const TEST_DEFINITIONS: TestDefinition[];
package/dist/runner.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  computeScore,
5
5
  generateBadge,
6
6
  runComplianceSuite
7
- } from "./chunk-U66YZGE5.js";
7
+ } from "./chunk-KNOSZ3TD.js";
8
8
  export {
9
9
  TEST_DEFINITIONS,
10
10
  computeGrade,
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@yawlabs/mcp-compliance",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "CLI tool and MCP server that tests MCP servers for spec compliance",
5
5
  "license": "MIT",
6
- "author": "Yaw Labs (https://yaw.sh)",
6
+ "author": "Yaw Labs <contact@yaw.sh> (https://yaw.sh)",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": {
@@ -18,7 +18,9 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
- "README.md"
21
+ "!dist/**/*.test.*",
22
+ "README.md",
23
+ "LICENSE"
22
24
  ],
23
25
  "scripts": {
24
26
  "build": "tsup",
@@ -28,7 +30,8 @@
28
30
  "lint:fix": "biome check --write src/",
29
31
  "typecheck": "tsc --noEmit",
30
32
  "test:ci": "npm run build && npm test",
31
- "prepublishOnly": "npm run build"
33
+ "prepublishOnly": "npm run build",
34
+ "start": "node dist/index.js"
32
35
  },
33
36
  "dependencies": {
34
37
  "@modelcontextprotocol/sdk": "^1.29.0",
@@ -52,7 +55,12 @@
52
55
  "model-context-protocol",
53
56
  "compliance",
54
57
  "testing",
55
- "cli"
58
+ "cli",
59
+ "mcp-server",
60
+ "spec",
61
+ "validation",
62
+ "json-rpc",
63
+ "ai"
56
64
  ],
57
65
  "repository": {
58
66
  "type": "git",