@yawlabs/mcp-compliance 0.1.2 → 0.2.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.
- package/README.md +66 -28
- package/dist/chunk-SP24UFRC.js +987 -0
- package/dist/index.js +655 -85
- package/dist/mcp/server.js +8 -2
- package/dist/runner.d.ts +13 -1
- package/dist/runner.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-OOJ4PMF7.js +0 -563
package/dist/mcp/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TEST_DEFINITIONS,
|
|
3
3
|
runComplianceSuite
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SP24UFRC.js";
|
|
5
5
|
|
|
6
6
|
// src/mcp/server.ts
|
|
7
7
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -16,7 +16,7 @@ var server = new McpServer({
|
|
|
16
16
|
});
|
|
17
17
|
server.tool(
|
|
18
18
|
"mcp_compliance_test",
|
|
19
|
-
"Run the full MCP compliance test suite against a server URL. Returns grade (A-F), score, and detailed results for all
|
|
19
|
+
"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.",
|
|
20
20
|
{
|
|
21
21
|
url: z.string().url().describe("The MCP server URL to test (must be HTTP or HTTPS)")
|
|
22
22
|
},
|
|
@@ -35,6 +35,12 @@ server.tool(
|
|
|
35
35
|
if (report.serverInfo.name) {
|
|
36
36
|
summary.unshift(`Server: ${report.serverInfo.name} v${report.serverInfo.version || "?"}`);
|
|
37
37
|
}
|
|
38
|
+
if (report.warnings.length > 0) {
|
|
39
|
+
summary.push("", `Warnings (${report.warnings.length}):`);
|
|
40
|
+
for (const w of report.warnings) {
|
|
41
|
+
summary.push(` - ${w}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
return {
|
|
39
45
|
content: [
|
|
40
46
|
{ type: "text", text: summary.join("\n") },
|
package/dist/runner.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ type Grade = 'A' | 'B' | 'C' | 'D' | 'F';
|
|
|
13
13
|
type Overall = 'pass' | 'partial' | 'fail';
|
|
14
14
|
interface ComplianceReport {
|
|
15
15
|
specVersion: string;
|
|
16
|
+
toolVersion: string;
|
|
16
17
|
url: string;
|
|
17
18
|
timestamp: string;
|
|
18
19
|
score: number;
|
|
@@ -30,6 +31,7 @@ interface ComplianceReport {
|
|
|
30
31
|
total: number;
|
|
31
32
|
}>;
|
|
32
33
|
tests: TestResult[];
|
|
34
|
+
warnings: string[];
|
|
33
35
|
serverInfo: {
|
|
34
36
|
protocolVersion: string | null;
|
|
35
37
|
name: string | null;
|
|
@@ -39,7 +41,9 @@ interface ComplianceReport {
|
|
|
39
41
|
toolCount: number;
|
|
40
42
|
toolNames: string[];
|
|
41
43
|
resourceCount: number;
|
|
44
|
+
resourceNames: string[];
|
|
42
45
|
promptCount: number;
|
|
46
|
+
promptNames: string[];
|
|
43
47
|
badge: {
|
|
44
48
|
imageUrl: string;
|
|
45
49
|
reportUrl: string;
|
|
@@ -55,7 +59,7 @@ interface TestDefinition {
|
|
|
55
59
|
specRef: string;
|
|
56
60
|
description: string;
|
|
57
61
|
}
|
|
58
|
-
/** All
|
|
62
|
+
/** All 43 test IDs with descriptions for the explain command */
|
|
59
63
|
declare const TEST_DEFINITIONS: TestDefinition[];
|
|
60
64
|
|
|
61
65
|
declare function computeGrade(score: number): Grade;
|
|
@@ -92,6 +96,14 @@ interface RunOptions {
|
|
|
92
96
|
onProgress?: (testId: string, passed: boolean, details: string) => void;
|
|
93
97
|
/** Extra headers to include on all requests */
|
|
94
98
|
headers?: Record<string, string>;
|
|
99
|
+
/** Request timeout in milliseconds (default: 15000) */
|
|
100
|
+
timeout?: number;
|
|
101
|
+
/** Number of retries for failed tests (default: 0) */
|
|
102
|
+
retries?: number;
|
|
103
|
+
/** Only run tests matching these category names or test IDs */
|
|
104
|
+
only?: string[];
|
|
105
|
+
/** Skip tests matching these category names or test IDs */
|
|
106
|
+
skip?: string[];
|
|
95
107
|
}
|
|
96
108
|
/**
|
|
97
109
|
* Run the full MCP compliance test suite against a URL.
|
package/dist/runner.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yawlabs/mcp-compliance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "CLI tool and MCP server that tests MCP servers for spec compliance",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Yaw Labs (https://yaw.sh)",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"prepublishOnly": "npm run build"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
32
32
|
"chalk": "^5.4.1",
|
|
33
33
|
"commander": "^13.1.0",
|
|
34
34
|
"undici": "^7.8.0",
|