@yawlabs/mcp-compliance 0.6.0 → 0.7.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 CHANGED
@@ -5,7 +5,7 @@
5
5
  [![GitHub stars](https://img.shields.io/github/stars/YawLabs/mcp-compliance)](https://github.com/YawLabs/mcp-compliance/stargazers)
6
6
  [![CI](https://github.com/YawLabs/mcp-compliance/actions/workflows/ci.yml/badge.svg)](https://github.com/YawLabs/mcp-compliance/actions/workflows/ci.yml)
7
7
 
8
- **Test any MCP server for spec compliance.** 69-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.
8
+ **Test any MCP server for spec compliance.** 78-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
- - **69 tests across 8 categories** — transport, lifecycle, tools, resources, prompts, error handling, schema validation, and security. No gaps.
18
+ - **78 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 69 tests check
103
+ ## What the 78 tests check
104
104
 
105
105
  <details>
106
- <summary><strong>Transport (10 tests)</strong></summary>
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 (12 tests)</strong></summary>
125
+ <summary><strong>Lifecycle (15 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,13 @@ 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** — Accepts progress notifications
141
+ - **lifecycle-progress** — Handles progress notifications gracefully
136
142
 
137
143
  </details>
138
144
 
@@ -167,7 +173,7 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
167
173
  </details>
168
174
 
169
175
  <details>
170
- <summary><strong>Error Handling (8 tests)</strong></summary>
176
+ <summary><strong>Error Handling (10 tests)</strong></summary>
171
177
 
172
178
  - **error-unknown-method** — Returns JSON-RPC error for unknown method (required)
173
179
  - **error-method-code** — Uses correct -32601 error code
@@ -177,6 +183,8 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
177
183
  - **error-parse-code** — Returns -32700 for invalid JSON
178
184
  - **error-invalid-request-code** — Returns -32600 for invalid request
179
185
  - **tools-call-unknown** — Returns error for nonexistent tool name
186
+ - **error-capability-gated** — Rejects methods for undeclared capabilities
187
+ - **error-invalid-cursor** — Handles invalid pagination cursor gracefully
180
188
 
181
189
  </details>
182
190
 
@@ -193,16 +201,17 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
193
201
  </details>
194
202
 
195
203
  <details>
196
- <summary><strong>Security (21 tests)</strong></summary>
204
+ <summary><strong>Security (22 tests)</strong></summary>
197
205
 
198
206
  - **security-auth-required** — Rejects unauthenticated requests
199
207
  - **security-auth-malformed** — Rejects malformed auth credentials
200
208
  - **security-tls-required** — Enforces HTTPS/TLS
201
209
  - **security-session-entropy** — Session IDs are high-entropy
202
210
  - **security-session-not-auth** — Session ID does not bypass auth
203
- - **security-oauth-metadata** — OAuth metadata endpoint exists
211
+ - **security-oauth-metadata** — Protected Resource Metadata endpoint exists (RFC 9728)
204
212
  - **security-token-in-uri** — Rejects auth tokens in query string
205
213
  - **security-cors-headers** — CORS headers are restrictive
214
+ - **security-origin-validation** — Validates Origin header for DNS rebinding protection
206
215
  - **security-command-injection** — Resists command injection in tool params
207
216
  - **security-sql-injection** — Resists SQL injection in tool params
208
217
  - **security-path-traversal** — Resists path traversal in tool params
@@ -309,7 +318,7 @@ Restart your MCP client and approve the server when prompted.
309
318
 
310
319
  ### Tools
311
320
 
312
- - **mcp_compliance_test** — Run the full 69-test suite against a URL. Supports auth, custom headers, timeout, retries, and category/test filtering. Returns grade, score, and detailed results.
321
+ - **mcp_compliance_test** — Run the full 78-test suite against a URL. Supports auth, custom headers, timeout, retries, and category/test filtering. Returns grade, score, and detailed results.
313
322
  - **mcp_compliance_badge** — Get the badge markdown/HTML for a server. Supports auth and custom headers.
314
323
  - **mcp_compliance_explain** — Explain what a specific test ID checks and why it matters.
315
324
 
@@ -336,7 +345,7 @@ const report2 = await runComplianceSuite('https://my-server.com/mcp', {
336
345
 
337
346
  The compliance testing methodology is published as an open specification:
338
347
 
339
- - **[MCP Compliance Testing Specification](./MCP_COMPLIANCE_SPEC.md)** — test execution model, scoring algorithm, all 69 test rules with pass/fail criteria (CC BY 4.0)
348
+ - **[MCP Compliance Testing Specification](./MCP_COMPLIANCE_SPEC.md)** — test execution model, scoring algorithm, all 78 test rules with pass/fail criteria (CC BY 4.0)
340
349
  - **[Machine-readable rule catalog](./mcp-compliance-rules.json)** — JSON Schema-compliant catalog for programmatic consumption
341
350
 
342
351
  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.