You have built an MCP server. It handles initialize, lists tools, returns results. It works in Claude Desktop. Ship it?
Maybe. But how do you know it is actually spec-compliant? Manually testing every edge case - malformed JSON-RPC, unknown methods, missing params - is tedious. CI pipelines catch application bugs but not protocol-level issues. And the MCP spec has enough surface area that “works in one client” does not mean “works everywhere.”
We built mcp-compliance to fix this. One command, a full compliance suite, a letter grade.
One command
npx -y @yawlabs/mcp-compliance test https://your-server.com/mcpThat is it. No config files, no setup. It connects to your server, runs the full compliance suite, and prints a report.
What it tests
88 tests across 8 categories - the same suite behind our findings from testing MCP servers against the spec:
- Transport (16) - HTTP POST acceptance, Content-Type validation (JSON/SSE), GET/DELETE handling, session ID enforcement, streaming
- Lifecycle (21) - Initialize handshake, protocol version, server info, capabilities, JSON-RPC 2.0 format, ping, cancellation, progress
- Tools (4) - List shape, call format, unknown tool handling, input schemas
- Resources (5) - List, read, templates, URI validation, subscribe (when declared)
- Prompts (3) - List, get, pagination (when declared)
- Errors (10) - Unknown method, error codes, malformed JSON-RPC, invalid JSON, missing params
- Schema (6) - Tool names,
inputSchemashape, resource URIs, prompt argument names - Security (23) - Auth & transport, input validation, tool-description injection, information disclosure, SSRF
Capability-gated tests (tools, resources, prompts, subscribe, logging, completions) only run if the server declares the capability - no false failures for features the server never claimed. Required tests are worth 70% of the score, optional tests 30%. You get a letter grade: A (90+), B (75+), C (60+), D (40+), F (<40). The suite targets the 2025-11-25 spec revision; for what the 2026-07-28 revision changes and the suite's support status, see the MCP testing tools comparison. The full rubric - stable rule IDs, per-test weights, spec references - is published under CC BY 4.0; see the open methodology behind the 88-test grading suite. This post is the how-to: running the suite from your terminal and wiring it into CI.
Example output
$ npx -y @yawlabs/mcp-compliance test https://my-server.example.com/mcp
Testing https://my-server.example.com/mcp...
MCP Compliance Report
Spec: 2025-11-25
Transport 16/16 PASS
Lifecycle 19/21 2 optional failures
Tools 4/4 PASS
Resources 5/5 PASS
Prompts 3/3 PASS
Errors 9/10 1 required failure
Schema 6/6 PASS
Security 22/23 1 optional failure
Required failures:
FAIL errors-04 JSON-RPC error code for unknown method must be -32601
Received: -32600 (invalid request)
Optional failures:
WARN lifecycle-15 Server did not echo client's protocolVersion
WARN lifecycle-17 initialized notification not acknowledged
WARN security-22 Tool description contains suspicious instruction phrasing
Grade: B Score: 86% Overall: PASS
Tests: 84 passed / 4 failed / 88 totalA grade B is typical. Most servers nail the basics but have gaps in error handling and the security long tail - exactly what we found when testing servers across the ecosystem.
CI integration
Add --strict and the CLI exits with code 1 if any required test fails. Drop it into GitHub Actions:
# .github/workflows/mcp-compliance.yml
name: MCP Compliance
on: [push]
jobs:
compliance:
runs-on: ubuntu-latest
steps:
- name: MCP Compliance Check
run: npx -y @yawlabs/mcp-compliance test ${{ env.MCP_SERVER_URL }} --strictWant JSON output for further processing? Use --format json:
npx -y @yawlabs/mcp-compliance test https://your-server.com/mcp --format json > compliance.jsonMCP server mode
mcp-compliance also runs as an MCP server itself. Add it to Claude Code and your agent can test servers from within conversations:
{
"mcpServers": {
"mcp-compliance": {
"command": "npx",
"args": ["-y", "@yawlabs/mcp-compliance", "mcp"]
}
}
}This exposes three tools: mcp_compliance_test (run the full suite), mcp_compliance_badge (get badge markdown), and mcp_compliance_explain (explain what a specific test checks). Useful when you are debugging a server and want your agent to run compliance checks as part of the conversation.
Compliance badge
Get an embeddable badge for your README:
npx -y @yawlabs/mcp-compliance badge https://your-server.com/mcpThis outputs markdown you can paste into your README. Report your current grade alongside a link back to @yawlabs/mcp-compliance so readers can re-run the suite themselves.
Open source
mcp-compliance is MIT-licensed and open source.
mcp-compliance is part of a broader set of tools we are building at Yaw Labs for AI infrastructure reliability:
- ctxlint - validates AI context files so stale CLAUDE.md references do not mislead agents
- Yaw MCP - the local-first orchestrator CLI. Every server in its public catalog is graded; set
YAW_MCP_MIN_COMPLIANCE=Band the CLI refuses to activate anything below the bar
What the tests found
The five official @modelcontextprotocol/server-* reference implementations all grade A (98-100%) with zero required-test failures; the interesting failures start once you leave that set. The biggest gap is error handling - HTTP 200 with an empty body or HTTP 500 with a stack trace instead of a proper -32601 JSON-RPC error for unknown methods, process crashes on malformed input, and a success envelope for tools/call on a nonexistent tool.
The security long tail recurs across the ecosystem: tokens echoed in error messages, unbounded input accepted (a trivial DoS vector), tool descriptions passed to the LLM unsanitized, and stack traces leaking file paths and versions - plus SSRF protection needed anywhere a URL is user-supplied, with DNS checked on every request, not just at config time. Session affinity behind load balancers and SSE streaming through proxies (nginx, Caddy, and Cloudflare all buffer by default) are two more gaps every operator is still solving alone.
Five suggestions came out of this, drafted as spec PRs: a recommended ~15-second SSE heartbeat interval, an informational proxy/load-balancer configuration section, SDK defaults that return proper JSON-RPC errors for unknown methods, an optional /.well-known/mcp discovery endpoint, and security guidance covering token handling, input size limits, tool-description sanitization and SSRF. For where this suite fits among the Inspector, MCPJam, conformance suites and security scanners, see what each MCP testing tool catches.
Jeff Yaw, Yaw Labs.