@yawlabs/mcp-compliance 0.6.0 → 0.8.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 +24 -12
- package/dist/{chunk-QLFYT4I7.js → chunk-DOIOJVEE.js} +600 -41
- package/dist/index.js +608 -47
- package/dist/mcp/server.js +5 -5
- package/dist/runner.d.ts +1 -1
- package/dist/runner.js +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/YawLabs/mcp-compliance/stargazers)
|
|
6
6
|
[](https://github.com/YawLabs/mcp-compliance/actions/workflows/ci.yml)
|
|
7
7
|
|
|
8
|
-
**Test any MCP server for spec compliance.**
|
|
8
|
+
**Test any MCP server for spec compliance.** 81-test suite covering transport, lifecycle, tools, resources, prompts, error handling, schema validation, and security against the [MCP specification](https://modelcontextprotocol.io/specification/2025-11-25). CLI, MCP server, and programmatic API.
|
|
9
9
|
|
|
10
10
|
Built and maintained by [Yaw Labs](https://yaw.sh).
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ MCP servers are multiplying fast — but most ship without compliance testing. B
|
|
|
15
15
|
|
|
16
16
|
This tool solves that:
|
|
17
17
|
|
|
18
|
-
- **
|
|
18
|
+
- **81 tests across 8 categories** — transport, lifecycle, tools, resources, prompts, error handling, schema validation, and security. No gaps.
|
|
19
19
|
- **Capability-driven** — tests adapt to what the server declares. If it says it supports tools, tool tests become required. No false failures for features the server doesn't claim.
|
|
20
20
|
- **Graded scoring** — A-F letter grade with a weighted score (required tests 70%, optional 30%). One number to communicate compliance.
|
|
21
21
|
- **CI-ready** — `--strict` mode exits with code 1 on required test failures. Drop it into any pipeline.
|
|
@@ -100,26 +100,29 @@ mcp-compliance badge https://my-server.com/mcp
|
|
|
100
100
|
|
|
101
101
|
Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https://mcp.hosting).
|
|
102
102
|
|
|
103
|
-
## What the
|
|
103
|
+
## What the 81 tests check
|
|
104
104
|
|
|
105
105
|
<details>
|
|
106
|
-
<summary><strong>Transport (
|
|
106
|
+
<summary><strong>Transport (13 tests)</strong></summary>
|
|
107
107
|
|
|
108
108
|
- **transport-post** — Server accepts HTTP POST requests (required)
|
|
109
109
|
- **transport-content-type** — Responds with application/json or text/event-stream (required)
|
|
110
|
-
- **transport-notification-202** — Notifications return 202 Accepted
|
|
110
|
+
- **transport-notification-202** — Notifications return exactly 202 Accepted
|
|
111
|
+
- **transport-content-type-reject** — Rejects non-JSON request Content-Type
|
|
111
112
|
- **transport-session-id** — Enforces MCP-Session-Id after initialization
|
|
113
|
+
- **transport-session-invalid** — Returns 404 for unknown session ID
|
|
112
114
|
- **transport-get** — GET returns SSE stream or 405
|
|
113
115
|
- **transport-delete** — DELETE accepted or returns 405
|
|
114
116
|
- **transport-batch-reject** — Rejects JSON-RPC batch requests (required)
|
|
115
117
|
- **transport-content-type-init** — Initialize response has valid content type
|
|
116
118
|
- **transport-get-stream** — GET with session returns SSE or 405
|
|
117
119
|
- **transport-concurrent** — Handles concurrent requests
|
|
120
|
+
- **transport-sse-event-field** — SSE responses include required event: message field
|
|
118
121
|
|
|
119
122
|
</details>
|
|
120
123
|
|
|
121
124
|
<details>
|
|
122
|
-
<summary><strong>Lifecycle (
|
|
125
|
+
<summary><strong>Lifecycle (17 tests)</strong></summary>
|
|
123
126
|
|
|
124
127
|
- **lifecycle-init** — Initialize handshake succeeds (required)
|
|
125
128
|
- **lifecycle-proto-version** — Returns valid YYYY-MM-DD protocol version (required)
|
|
@@ -129,10 +132,15 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
|
|
|
129
132
|
- **lifecycle-ping** — Responds to ping method (required)
|
|
130
133
|
- **lifecycle-instructions** — Instructions field is valid string if present
|
|
131
134
|
- **lifecycle-id-match** — Response ID matches request ID (required)
|
|
135
|
+
- **lifecycle-string-id** — Supports string request IDs (JSON-RPC 2.0)
|
|
136
|
+
- **lifecycle-version-negotiate** — Handles unknown protocol version gracefully
|
|
137
|
+
- **lifecycle-reinit-reject** — Rejects second initialize request
|
|
132
138
|
- **lifecycle-logging** — logging/setLevel accepted (required if logging capability declared)
|
|
133
139
|
- **lifecycle-completions** — completion/complete accepted (required if completions capability declared)
|
|
134
140
|
- **lifecycle-cancellation** — Handles cancellation notifications
|
|
135
|
-
- **lifecycle-progress** —
|
|
141
|
+
- **lifecycle-progress** — Handles progress notifications gracefully
|
|
142
|
+
- **lifecycle-list-changed** — Accepts listChanged notifications for declared capabilities
|
|
143
|
+
- **lifecycle-progress-token** — Supports progress tokens in requests via SSE
|
|
136
144
|
|
|
137
145
|
</details>
|
|
138
146
|
|
|
@@ -167,7 +175,7 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
|
|
|
167
175
|
</details>
|
|
168
176
|
|
|
169
177
|
<details>
|
|
170
|
-
<summary><strong>Error Handling (
|
|
178
|
+
<summary><strong>Error Handling (10 tests)</strong></summary>
|
|
171
179
|
|
|
172
180
|
- **error-unknown-method** — Returns JSON-RPC error for unknown method (required)
|
|
173
181
|
- **error-method-code** — Uses correct -32601 error code
|
|
@@ -177,6 +185,8 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
|
|
|
177
185
|
- **error-parse-code** — Returns -32700 for invalid JSON
|
|
178
186
|
- **error-invalid-request-code** — Returns -32600 for invalid request
|
|
179
187
|
- **tools-call-unknown** — Returns error for nonexistent tool name
|
|
188
|
+
- **error-capability-gated** — Rejects methods for undeclared capabilities
|
|
189
|
+
- **error-invalid-cursor** — Handles invalid pagination cursor gracefully
|
|
180
190
|
|
|
181
191
|
</details>
|
|
182
192
|
|
|
@@ -193,16 +203,18 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
|
|
|
193
203
|
</details>
|
|
194
204
|
|
|
195
205
|
<details>
|
|
196
|
-
<summary><strong>Security (
|
|
206
|
+
<summary><strong>Security (23 tests)</strong></summary>
|
|
197
207
|
|
|
198
208
|
- **security-auth-required** — Rejects unauthenticated requests
|
|
209
|
+
- **security-www-authenticate** — 401 responses include WWW-Authenticate header
|
|
199
210
|
- **security-auth-malformed** — Rejects malformed auth credentials
|
|
200
211
|
- **security-tls-required** — Enforces HTTPS/TLS
|
|
201
212
|
- **security-session-entropy** — Session IDs are high-entropy
|
|
202
213
|
- **security-session-not-auth** — Session ID does not bypass auth
|
|
203
|
-
- **security-oauth-metadata** —
|
|
214
|
+
- **security-oauth-metadata** — Protected Resource Metadata endpoint exists (RFC 9728)
|
|
204
215
|
- **security-token-in-uri** — Rejects auth tokens in query string
|
|
205
216
|
- **security-cors-headers** — CORS headers are restrictive
|
|
217
|
+
- **security-origin-validation** — Validates Origin header for DNS rebinding protection
|
|
206
218
|
- **security-command-injection** — Resists command injection in tool params
|
|
207
219
|
- **security-sql-injection** — Resists SQL injection in tool params
|
|
208
220
|
- **security-path-traversal** — Resists path traversal in tool params
|
|
@@ -309,7 +321,7 @@ Restart your MCP client and approve the server when prompted.
|
|
|
309
321
|
|
|
310
322
|
### Tools
|
|
311
323
|
|
|
312
|
-
- **mcp_compliance_test** — Run the full
|
|
324
|
+
- **mcp_compliance_test** — Run the full 81-test suite against a URL. Supports auth, custom headers, timeout, retries, and category/test filtering. Returns grade, score, and detailed results.
|
|
313
325
|
- **mcp_compliance_badge** — Get the badge markdown/HTML for a server. Supports auth and custom headers.
|
|
314
326
|
- **mcp_compliance_explain** — Explain what a specific test ID checks and why it matters.
|
|
315
327
|
|
|
@@ -336,7 +348,7 @@ const report2 = await runComplianceSuite('https://my-server.com/mcp', {
|
|
|
336
348
|
|
|
337
349
|
The compliance testing methodology is published as an open specification:
|
|
338
350
|
|
|
339
|
-
- **[MCP Compliance Testing Specification](./MCP_COMPLIANCE_SPEC.md)** — test execution model, scoring algorithm, all
|
|
351
|
+
- **[MCP Compliance Testing Specification](./MCP_COMPLIANCE_SPEC.md)** — test execution model, scoring algorithm, all 81 test rules with pass/fail criteria (CC BY 4.0)
|
|
340
352
|
- **[Machine-readable rule catalog](./mcp-compliance-rules.json)** — JSON Schema-compliant catalog for programmatic consumption
|
|
341
353
|
|
|
342
354
|
These are complementary to (not competing with) the [official MCP specification](https://modelcontextprotocol.io/specification/2025-11-25). The MCP spec defines what servers must do; this spec defines how to verify compliance.
|