alvabillwu

✅ mcp-compliance-lite

Community alvabillwu
Updated

✅ MCP spec conformance tester — validate JSON-RPC compliance, tool schemas, error codes against the Model Context Protocol spec

✅ mcp-compliance-lite

npmLicenseNodeCI

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 server
  • mcp-guard — Security scanner for MCP server tool manifests
  • mcpindex — Searchable index and discovery tool for MCP servers

License

MIT © alvabillwu

MCP Server · Populars

MCP Server · New

    cbtw-apac

    QDrant Loader

    Enterprise-ready vector database toolkit for building searchable knowledge bases from multiple data sources. Supports multi-project management, automatic ingestion from Confluence/JIRA/Git, intelligent file conversion (PDF/Office/images), and semantic search. Includes MCP server for seamless AI assistant integration.

    Community cbtw-apac
    aks129

    HealthClaw Guardrails

    Open-source guardrails between AI agents and FHIR clinical data — PHI redaction, immutable audit, step-up auth, tenant isolation. MCP server + OpenAI/Gemini adapters. A healthclaw.io project.

    Community aks129
    opentargets

    Open Targets Platform MCP

    Official MCP server implementation for accessing Open Targets Data

    Community opentargets
    longsizhuo

    openInvest

    基于multiple LLM的风险投资助手

    Community longsizhuo
    CCCpan

    Gebaini

    中国数据核验 MCP Server | 身份核验/企业查询/车辆信息/OCR识别/风险评估 | 10个Tool覆盖5大类 | 微信: chenganp | 邮箱: [email protected]

    Community CCCpan