Research in practice
mcp-consent-ledger: Authorisation Proof Library for Defensive MCP Servers
Reusable consent and authorisation-proof library for defensive MCP servers, with an auditable, local-only ledger.
Conceptual illustration of the project, not a measurement or product screenshot.
The question & approach
A small library that gives any MCP tool a single primitive: requireConsentOrThrow({ subject, scope, action }). Supports four proof methods (dns-txt, well-known-file, signed-statement, manual). Consent records are explicit, scoped, time-stamped, and stored locally with SHA-256 hashed tokens. Well-known fetches are SSRF-guarded; ships a CLI and a TypeScript library with zero runtime dependencies.
Methods
SHA-256 token hashing, DNS TXT and well-known proof, SSRF-guarded fetcher.
Evidence & evaluation
How it was assessed
Released library; verification logic validated against multi-string TXT records.
Project-reported evaluation. See the source repository for implementation and experimental context.
Contributions
- Four proof methods: dns-txt, well-known-file, signed-statement, manual.
- Drop-in API: requireConsentOrThrow / hasValidConsent.
- Local-only ledger with SHA-256 hashing and revocation.
- mcp-consent CLI for token issuance, verification, and listing.
- SSRF-guarded well-known fetcher; no telemetry.
The hard parts
- Designing a consent record shape that is auditable yet small enough to read by hand.
- Implementing DNS TXT verification across multi-string and wrapped records.
- Hardening the fetcher against SSRF, redirects, and oversized response bodies.