The audit and governance layer for MCP.
Drop mcpose between any LLM client and any MCP server. Intercept, transform, and govern every tool call through composable onion middleware — and log it in a tamper-evident, compliance-grade audit trail. Nothing upstream changes.
// Wrap any upstream MCP server — unmodified
const backend = await createBackendClient({
command: 'node',
args: ['./es-server.mjs'],
});
const audit = createAuditMiddleware({
signingKey: createDefaultSigningKeyProvider(process.env.AUDIT_SECRET!),
onEvent: (e) => auditLog.append(e), // HMAC-chained, tamper-evident
});
await startHttpProxy(backend, {
hiddenTools: ['delete_index'], // rejections are audited too
toolMiddleware: [redactPii, audit.middleware],
}); // audit only ever sees redacted dataCross-cutting concerns, composed.
RejectionReason.Identity on every request.@mcpose/audit.One proxy in the middle.
mcpose mirrors the upstream MCP surface and routes supported calls through middleware. Capabilities, abort signals, progress, and list-changed notifications pass through intact.
Omitted from list responses; rejected with TOOL_HIDDEN at call time. The rejection still hits the audit trail.
Forwarded raw. Transformers are skipped; observers wrapped in markPassThroughObserver() still run.
Routed through the full toolMiddleware / resourceMiddleware pipeline.
Audit trails an examiner can verify.
Built for DORA Art. 17 and SR 11-7. Every event chains to the last; every session closes with a signed Merkle manifest. Extracted from a production financial deployment.
| Tier | Stored fields |
|---|---|
| low | inputRaw, outputRaw (plaintext) |
| medium | inputRaw, outputRaw (PII redacted upstream) |
| high | inputEncrypted, outputEncrypted (AES-256-GCM) |
Three packages, one surface.
| Package | What it does | Version |
|---|---|---|
| mcpose | Proxy core — pipeline, transports, identity, governance. | v2.x |
| @mcpose/audit | Tamper-evident HMAC audit chain + Merkle replay manifest. | v3.0 · format v2 |
| @mcpose/testing | Runner-agnostic compliance assertions for the audit chain. | devDependency |
@modelcontextprotocol/sdk ≥ 1.0 — installed separately.Drop it in front of any MCP server.
Ten lines of glue. Nothing upstream changes.