# MCP Hook Conformance

CLI test harness that audits MCP servers for Claude Code hook compatibility, verifying latency, idempotency, side effects, and determinism.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: studiomeyer-io
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/studiomeyer-io/mcp-hook-conformance
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-hook-conformance

## What it does

The harness audits MCP tools before they are attached to Claude Code lifecycle hooks such as `Stop` or `PreCompact`. It runs five targeted test suites covering output reproducibility, latency bounds under standard thresholds, floating-point drift, state mutations, and data retention disclosures.

Detecting mutations in read-only tools requires declaring a `stateProbe` in `hook-conformance.config.json`. Without that probe, the side-effects suite yields an `INDETERMINATE` verdict. The audit outputs specific finding codes, which can be examined with the `explain` command for remediation steps.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add hook-conformance -- npx -y mcp-hook-conformance
```

### Codex

**Platform CLI**
```bash
codex mcp add mcp-hook-conformance -- npx -y mcp-hook-conformance
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-hook-conformance": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-hook-conformance"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-hook-conformance": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mcp-hook-conformance"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcp-hook-conformance npx -y mcp-hook-conformance
```

## When to use it
- audit MCP server tools for Claude Code lifecycle hook readiness
- detect unexpected state changes during read operations
- measure roundtrip tool execution latency for p50 and p95
- verify response stability without undocumented timestamps or UUIDs

## Example prompts
- Run audit suites using config file `./hook-conformance.config.json`
- Scaffold a fresh config file for `my-mcp-server`
- Explain finding code `IDEMP-001` and suggest fixes

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
