@yawlabs/mcp-compliance 0.2.1 → 0.3.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
@@ -1,22 +1,32 @@
1
1
  # @yawlabs/mcp-compliance
2
2
 
3
- CLI tool and MCP server that tests MCP servers for spec compliance. Runs a 43-test suite covering transport, lifecycle, tools, resources, prompts, error handling, and schema validation against the [MCP specification](https://modelcontextprotocol.io/specification/2025-11-25).
3
+ [![npm version](https://img.shields.io/npm/v/@yawlabs/mcp-compliance)](https://www.npmjs.com/package/@yawlabs/mcp-compliance)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![GitHub stars](https://img.shields.io/github/stars/YawLabs/mcp-compliance)](https://github.com/YawLabs/mcp-compliance/stargazers)
6
+ [![CI](https://github.com/YawLabs/mcp-compliance/actions/workflows/ci.yml/badge.svg)](https://github.com/YawLabs/mcp-compliance/actions/workflows/ci.yml)
4
7
 
5
- ## Install
8
+ **Test any MCP server for spec compliance.** 43-test suite covering transport, lifecycle, tools, resources, prompts, error handling, and schema validation against the [MCP specification](https://modelcontextprotocol.io/specification/2025-11-25). CLI, MCP server, and programmatic API.
9
+
10
+ Built and maintained by [YawLabs](https://yaw.sh).
11
+
12
+ ## Quick Start
13
+
14
+ **1. Run against any MCP server**
6
15
 
7
16
  ```bash
8
- npm install -g @yawlabs/mcp-compliance
17
+ npx @yawlabs/mcp-compliance test https://my-server.com/mcp
9
18
  ```
10
19
 
11
- Or run directly with npx:
20
+ **2. Or install globally**
12
21
 
13
22
  ```bash
14
- npx @yawlabs/mcp-compliance test https://my-server.com/mcp
23
+ npm install -g @yawlabs/mcp-compliance
24
+ mcp-compliance test https://my-server.com/mcp
15
25
  ```
16
26
 
17
- ## CLI Usage
27
+ That's it. You'll get a colored terminal report with a letter grade (A-F), per-test pass/fail, and a compliance score.
18
28
 
19
- ### Run compliance tests
29
+ ## CLI Usage
20
30
 
21
31
  ```bash
22
32
  # Terminal output with colors and grade
@@ -75,7 +85,9 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
75
85
 
76
86
  ## What the 43 tests check
77
87
 
78
- ### Transport (7 tests)
88
+ <details>
89
+ <summary><strong>Transport (7 tests)</strong></summary>
90
+
79
91
  - **transport-post** — Server accepts HTTP POST requests (required)
80
92
  - **transport-content-type** — Responds with application/json or text/event-stream (required)
81
93
  - **transport-notification-202** — Notifications return 202 Accepted
@@ -84,7 +96,11 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
84
96
  - **transport-delete** — DELETE accepted or returns 405
85
97
  - **transport-batch-reject** — Rejects JSON-RPC batch requests (required)
86
98
 
87
- ### Lifecycle (10 tests)
99
+ </details>
100
+
101
+ <details>
102
+ <summary><strong>Lifecycle (10 tests)</strong></summary>
103
+
88
104
  - **lifecycle-init** — Initialize handshake succeeds (required)
89
105
  - **lifecycle-proto-version** — Returns valid YYYY-MM-DD protocol version (required)
90
106
  - **lifecycle-server-info** — Includes serverInfo with name
@@ -96,25 +112,41 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
96
112
  - **lifecycle-logging** — logging/setLevel accepted (required if logging capability declared)
97
113
  - **lifecycle-completions** — completion/complete accepted (required if completions capability declared)
98
114
 
99
- ### Tools (4 tests)
115
+ </details>
116
+
117
+ <details>
118
+ <summary><strong>Tools (4 tests)</strong></summary>
119
+
100
120
  - **tools-list** — tools/list returns valid array (required if tools capability declared)
101
121
  - **tools-call** — tools/call responds with correct format
102
122
  - **tools-pagination** — tools/list supports cursor-based pagination
103
123
  - **tools-content-types** — Tool content items have valid types
104
124
 
105
- ### Resources (5 tests)
125
+ </details>
126
+
127
+ <details>
128
+ <summary><strong>Resources (5 tests)</strong></summary>
129
+
106
130
  - **resources-list** — resources/list returns valid array (required if resources capability declared)
107
131
  - **resources-read** — resources/read returns content items
108
132
  - **resources-templates** — resources/templates/list works or returns method-not-found
109
133
  - **resources-pagination** — resources/list supports cursor-based pagination
110
134
  - **resources-subscribe** — Resource subscribe/unsubscribe (required if subscribe capability declared)
111
135
 
112
- ### Prompts (3 tests)
136
+ </details>
137
+
138
+ <details>
139
+ <summary><strong>Prompts (3 tests)</strong></summary>
140
+
113
141
  - **prompts-list** — prompts/list returns valid array (required if prompts capability declared)
114
142
  - **prompts-get** — prompts/get returns valid messages
115
143
  - **prompts-pagination** — prompts/list supports cursor-based pagination
116
144
 
117
- ### Error Handling (8 tests)
145
+ </details>
146
+
147
+ <details>
148
+ <summary><strong>Error Handling (8 tests)</strong></summary>
149
+
118
150
  - **error-unknown-method** — Returns JSON-RPC error for unknown method (required)
119
151
  - **error-method-code** — Uses correct -32601 error code
120
152
  - **error-invalid-jsonrpc** — Handles malformed JSON-RPC (required)
@@ -124,7 +156,11 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
124
156
  - **error-invalid-request-code** — Returns -32600 for invalid request
125
157
  - **tools-call-unknown** — Returns error for nonexistent tool name
126
158
 
127
- ### Schema Validation (6 tests)
159
+ </details>
160
+
161
+ <details>
162
+ <summary><strong>Schema Validation (6 tests)</strong></summary>
163
+
128
164
  - **tools-schema** — All tools have valid name and inputSchema (required if tools capability declared)
129
165
  - **tools-annotations** — Tool annotations are valid if present
130
166
  - **tools-title-field** — Tools include title field (2025-11-25)
@@ -132,6 +168,8 @@ Outputs the markdown embed for a compliance badge hosted at [mcp.hosting](https:
132
168
  - **prompts-schema** — Prompts have valid name field (required if prompts capability declared)
133
169
  - **resources-schema** — Resources have valid uri and name (required if resources capability declared)
134
170
 
171
+ </details>
172
+
135
173
  ## Grading
136
174
 
137
175
  | Grade | Score |
@@ -166,13 +204,15 @@ Required tests are worth 70% of the score, optional tests 30%.
166
204
  run: npx @yawlabs/mcp-compliance test ${{ env.MCP_SERVER_URL }} --strict --retries 2 --timeout 30000
167
205
  ```
168
206
 
169
- ## MCP Server (for Claude Code)
207
+ ## MCP Server (for Claude Code, Cursor, etc.)
170
208
 
171
- This package also exposes an MCP server with 3 tools that can be used from Claude Code or any MCP client.
209
+ This package also exposes an MCP server with 3 tools that can be used from Claude Code, Cursor, or any MCP client.
172
210
 
173
211
  ### Setup
174
212
 
175
- Add to your Claude Code MCP config:
213
+ Create `.mcp.json` in your project root:
214
+
215
+ macOS / Linux / WSL:
176
216
 
177
217
  ```json
178
218
  {
@@ -185,12 +225,31 @@ Add to your Claude Code MCP config:
185
225
  }
186
226
  ```
187
227
 
228
+ Windows:
229
+
230
+ ```json
231
+ {
232
+ "mcpServers": {
233
+ "mcp-compliance": {
234
+ "command": "cmd",
235
+ "args": ["/c", "npx", "-y", "@yawlabs/mcp-compliance", "mcp"]
236
+ }
237
+ }
238
+ }
239
+ ```
240
+
241
+ > **Tip:** This file is safe to commit — it contains no secrets.
242
+
243
+ Restart your MCP client and approve the server when prompted.
244
+
188
245
  ### Tools
189
246
 
190
- - **mcp_compliance_test** — Run the full 43-test suite against a URL. Returns grade, score, and detailed results.
191
- - **mcp_compliance_badge** — Get the badge markdown/HTML for a server.
247
+ - **mcp_compliance_test** — Run the full 43-test suite against a URL. Supports auth, custom headers, timeout, retries, and category/test filtering. Returns grade, score, and detailed results.
248
+ - **mcp_compliance_badge** — Get the badge markdown/HTML for a server. Supports auth and custom headers.
192
249
  - **mcp_compliance_explain** — Explain what a specific test ID checks and why it matters.
193
250
 
251
+ All tools have [MCP tool annotations](https://modelcontextprotocol.io/specification/2025-11-25/server/tools#annotations) (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) so MCP clients can skip confirmation dialogs for safe operations.
252
+
194
253
  ## Programmatic Usage
195
254
 
196
255
  ```typescript
@@ -208,6 +267,10 @@ const report2 = await runComplianceSuite('https://my-server.com/mcp', {
208
267
  });
209
268
  ```
210
269
 
270
+ ## Requirements
271
+
272
+ - Node.js 18+
273
+
211
274
  ## Links
212
275
 
213
276
  - [mcp.hosting](https://mcp.hosting) — Hosted MCP server infrastructure