@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.
- package/LICENSE +21 -0
- package/README.md +77 -12
- package/dist/{chunk-U66YZGE5.js → chunk-KNOSZ3TD.js} +86 -43
- package/dist/index.js +208 -62
- package/dist/mcp/server.d.ts +11 -1
- package/dist/mcp/server.js +26 -13
- package/dist/runner.d.ts +1 -0
- package/dist/runner.js +1 -1
- package/package.json +13 -5
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-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(
|
|
14
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
package/dist/runner.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yawlabs/mcp-compliance",
|
|
3
|
-
"version": "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
|
-
"
|
|
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",
|