✅ mcp-compliance-lite
MCP spec conformance tester. Validate any MCP server against the Model Context Protocol specification: JSON-RPC 2.0 compliance, initialize handshake, tool schema validation, and error code correctness.
In 2026, there are 9,400+ public MCP servers — but "almost none are tested against the spec." The official MCP roadmap lists "Conformance Test Suites" as future work. mcp-compliance-lite fills the gap: 14 spec checks across 4 categories, zero dependencies.
Complements mcp-guard (security scanner — checks what tools can do) — mcp-compliance-lite checks whether the server follows the protocol spec.
Features
- 📋 14 spec checks across 4 categories: JSON-RPC, handshake, tools, errors
- 🔌 Live testing — run against any MCP server via stdio
- 📄 Trace file validation — check pre-recorded JSONL traces
- 🎨 CLI — human-readable report or JSON output
- ✅ CI-ready — exits non-zero on non-compliance
- 🚫 Zero runtime dependencies
Quick Start
npm install -g mcp-compliance-lite
Usage
Test a live server
mcp-compliance test npx @anthropic/mcp-server
mcp-compliance test python my_mcp_server.py
mcp-compliance test node dist/server.js --json
Validate a pre-recorded trace
# Record a trace
mcp-probe tools my-server | tee trace.jsonl
# Check compliance
mcp-compliance check trace.jsonl
List spec rules
mcp-compliance rules
Output:
COMPLIANT (with warnings) 12/14 passed (86%) 0 errors, 2 warnings
✓ json-rpc JSON-RPC version must be '2.0'
✓ json-rpc All responses include a request id
✓ handshake Initialize response is valid
✓ handshake Initialize must include protocolVersion
✓ handshake Initialize must include capabilities
⚠ handshake Server info should include a name
serverInfo.name is missing or empty
⚠ tools Server must respond to tools/list
No tools/list response found in trace
...
Spec Checks
| ID | Category | Severity |
|---|---|---|
jsonrpc-version |
json-rpc | error |
response-id |
json-rpc | error |
initialize-response |
handshake | warning |
initialize-protocol-version |
handshake | warning |
initialize-capabilities |
handshake | error |
initialize-server-name |
handshake | warning |
tools-list |
tools | warning |
tools-list-array |
tools | error |
tool-name |
tools | error |
tool-input-schema-type |
tools | error |
tool-input-schema-props |
tools | error |
error-code-format |
errors | error |
error-code-unknown |
errors | warning |
notification-no-response |
notifications | info |
Programmatic API
import { validate, runServer } from "mcp-compliance-lite";
// Validate a trace
const report = validate(messages);
console.log(report.summary);
// Run against a live server
const { messages, errors } = await runServer("python", ["server.py"]);
const report = validate(messages);
Development
git clone https://github.com/alvabillwu/mcp-compliance-lite.git
cd mcp-compliance-lite
npm install && npm test
🔗 Ecosystem
Part of the alvabillwu AI/LLM DevTools suite:
mcp-probe— CLI probe to inspect any MCP servermcp-guard— Security scanner for MCP server tool manifestsmcpindex— Searchable index and discovery tool for MCP servers
License
MIT © alvabillwu