mcp-witness
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-witnesslog this decision with cryptographic proof"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π MCP Witness
Cryptographic proof of every AI decision. An immutable, verifiable audit trail MCP server β because "trust me bro" isn't SOC2 compliant.
pip install mcp-witness
mcp-witness quickstart⨠Why mcp-witness?
AI agents make decisions. Regulators ask questions. mcp-witness provides cryptographic proof of what happened, when, and why β with hash chain integrity, Merkle tree verification, Ed25519 signatures, external trust anchoring (RFC 3161 TSA strict mode with optional local attestation, OpenTimestamps for structural verification, IPFS), and compliance presets for HIPAA, GDPR, SOC2, and more.
Feature | mcp-witness | Standard Logging |
Tamper detection | β SHA-256 hash chain + Merkle trees | β Text files, easy to edit |
O(log n) verification | β Merkle checkpoints with auto-backfill | β Linear scan only |
Non-repudiation | β οΈ Ed25519 record signing (requires persistent key) | β None |
External anchoring | β TSA, Bitcoin (OTS), IPFS | β None |
Compliance presets | β HIPAA, GDPR, SOX, PCI DSS, FedRAMP, SOC2 | β Manual configuration |
PII/PHI redaction | β Cryptographic hashing | β Plaintext or manual |
GDPR right to erasure | β
| β Destructive deletion |
Legal-grade proof | β οΈ RFC 3161 timestamps (strict mode default; local attestation in degraded mode) | β None |
Chain failure alerts | β Webhook notifications | β Silent failure |
Multi-tenancy | β org_id isolation | β None |
Reports | β HTML + PDF compliance reports | β Manual |
Dashboard | β Web dashboard with live API | β None |
Structured logging | β JSON log format option | β Unstructured |
π Assurance Levels
Level | Description | Current |
ASSURANCE-1 | Best-effort logging, no cryptographic guarantees | β |
ASSURANCE-2 | Hash chain + Merkle trees, tamper-EVIDENT, configurable anchoring | β |
ASSURANCE-3 | Non-repudiation (Ed25519), strict anchoring, encryption at rest, formal threat model | v1.0.0 |
As of v1.0.0, mcp-witness is secure-by-default: it refuses to start without a persistent signing key and fails closed if the chain does not verify at startup. Each default has an opt-out β see docs/configuration.md.
β οΈ Known Limitations
Anchoring is asynchronous. Records are created first, then anchored later when a
checkpoint triggers AnchorService. Between record creation and checkpoint anchoring,
records exist without external trust proof. Use witness_attest to anchor individual
records immediately.
Single-node storage. SQLite (default) and PostgreSQL backends are single-instance. No built-in replication, clustering, or HA. Back up your database regularly. See docs/backup.md.
Encryption at rest is opt-in. Set MCP_WITNESS_ENCRYPTION_KEY (32-byte hex) to
enable AES-256-GCM field-level envelope encryption. Without it, sensitive fields are
stored as plaintext JSON.
β¬οΈ Upgrading from 0.9.x
v1.0.0 changes several defaults. To upgrade smoothly:
Set a signing key:
export MCP_WITNESS_SIGNING_KEY=$(openssl rand -hex 32)(orMCP_WITNESS_REQUIRE_PERSISTENT_KEY=falseto keep ephemeral keys).Verify your chain first:
mcp-witness verify(or setMCP_WITNESS_FAIL_ON_STARTUP_VERIFICATION_FAILURE=false).If a webhook targets an internal collector, set
MCP_WITNESS_ALLOW_INTERNAL_WEBHOOKS=true.
See the full configuration reference and SECURITY.md for the threat model.
Related MCP server: cronozen-proof
π 30-Second Quickstart
# Install
pip install mcp-witness
# One command: init + serve
mcp-witness quickstart
# β
Database ready: ~/.mcp-witness/witness.db
# π Next Steps:
# 1. Configure signing: export MCP_WITNESS_SIGNING_KEY=$(openssl rand -hex 32)
# 2. Configure HMAC: export MCP_WITNESS_HMAC_KEY=$(openssl rand -hex 32)
# 3. Start dashboard: mcp-witness dashboard
# 4. Add to Claude: claude mcp add witness -- mcp-witness serve
# Or go step-by-step:
mcp-witness init # Initialize database
mcp-witness serve # Start MCP server
# Check system health
mcp-witness stats # Chain statistics
mcp-witness verify # Chain integrity check
mcp-witness dashboard # Web dashboard on :9090
mcp-witness report # Generate compliance reportClaude Desktop Integration
{
"mcpServers": {
"witness": {
"command": "mcp-witness",
"args": ["serve"],
"env": {
"MCP_WITNESS_DB": "~/.mcp-witness/witness.db",
"MCP_WITNESS_HMAC_KEY": "<32-byte hex key>",
"MCP_WITNESS_SIGNING_KEY": "<32-byte hex seed for Ed25519>",
"MCP_WITNESS_CHECKPOINT_INTERVAL": "1000",
"MCP_WITNESS_AUTO_ANCHOR": "false",
"MCP_WITNESS_WEBHOOK_URL": "https://alerts.example.com/witness",
"MCP_WITNESS_LOG_FORMAT": "json"
}
}
}
}π οΈ CLI Reference
mcp-witness quickstart One-command init + serve with next steps
mcp-witness serve Start the MCP server
mcp-witness init Initialize database
mcp-witness verify [--fast] Verify hash chain integrity
mcp-witness stats Chain health dashboard
mcp-witness export [--output] Export audit report
mcp-witness report [--format] Generate HTML/PDF compliance report
mcp-witness proof SEQUENCE Merkle proof for a record
mcp-witness search QUERY Full-text search across audit records
mcp-witness checkpoints List Merkle checkpoints
mcp-witness dashboard Start web dashboard (default :9090)
mcp-witness anchors create ID Anchor to TSA/Bitcoin/IPFS
mcp-witness anchors verify ID Verify external anchor receiptsπ οΈ MCP Tools (17 Total)
Tool | Description |
| Log an AI action to the immutable audit trail |
| Verify hash chain integrity (detect tampering) |
| O(log n) verification using Merkle checkpoints |
| Search records by session, actor, tool, time |
| Get full decision chain for a session |
| Get audit trail statistics and health |
| Check DB connectivity, signing status, anchors, version |
| RFC 3161 timestamp from external authority |
| Export records for compliance reporting |
| GDPR right to erasure (data redaction, chain preserved) |
| Full-text search across reasoning/input/output data |
| List Merkle checkpoints |
| Anchor checkpoint to TSA/Bitcoin/IPFS |
| Verify external anchor receipts |
| Get Merkle proof for a single record |
| Create checkpoints for existing records |
| Apply HIPAA/GDPR/SOX/FedRAMP/SOC2/PCI DSS preset |
| Create an Ed25519-signed JWT for client authentication |
ποΈ Compliance Presets
One command. Full compliance baseline.
# Via MCP tool:
witness_configure_compliance(preset="hipaa")
# β 6-year retention, auto-redacts 12 PHI fields, requires attestation
witness_configure_compliance(preset="gdpr")
# β Right-to-erasure support, consent records, 12 PII fields redacted
witness_configure_compliance(preset="soc2")
# β 1-year retention, API key redaction, quarterly audit schedulePreset | Retention | Auto-Redact | Attestation | Immutable |
HIPAA | 6 years | 12 PHI fields | β Required | β |
GDPR | Per-purpose | 12 PII fields | β Required | Right to erasure |
SOX | 7 years | 7 financial fields | β Required | β Yes |
FedRAMP | 3 years | 6 CUI fields | β Required | β |
SOC 2 | 1 year | 7 fields | β Required | β |
PCI DSS | 1 year | 7 card fields | β Required | β |
π How It Works
Hash Chain + Merkle Trees + Ed25519 Signatures
Records: [R0] β [R1] β [R2] β ... β [R999] β [R1000] β ...
βοΈπ βοΈπ βοΈπ βοΈπ βοΈπ
Ed25519 Ed25519 Ed25519 Ed25519 Ed25519
β
[Checkpoint #1]
Merkle Root: abc123
Covers: records 0-999
β
[External Anchors]
π TSA (RFC 3161)
βΏ OpenTimestamps
π IPFS
Merkle Tree: root_hash
/ \
hash_01 hash_23
/ \ / \
h_0 h_1 h_2 h_3
β β β β
R0:R0h R1:R1h R2:R2h R3:R3hEvery record is signed with Ed25519 for non-repudiation (signing key auto-generated if not configured).
Tamper Detection: Change any record β its hash changes β signature invalid β Merkle root changes β checkpoint invalidated β external anchors prove when the real root existed.
GDPR Right to Erasure: witness_delete nulls data fields but preserves the hash chain β records can be redacted without breaking integrity verification.
Verification Performance
Records | Full Chain | With Checkpoints |
1,000 | ~100ms | ~100ms |
10,000 | ~1s | ~100ms |
100,000 | ~10s | ~1s |
1,000,000 | ~100s | ~10s |
Single record: O(log n) with Merkle proof (vs O(n) linear scan).
π Security
SHA-256 hash chain with null-byte delimiters to prevent collision attacks
Ed25519 JWT assertions β signed JSON Web Tokens as alternative to shared API keys
Ed25519 record signing β persistent signing key required by default for non-repudiation (
MCP_WITNESS_SIGNING_KEY)SSRF-guarded webhooks β alert URLs are blocked from reaching internal/metadata addresses
HMAC key protection β optional server-side secret makes hashes un-recomputable
RFC 3161 TSA anchoring β legal-grade timestamps (strict mode; local attestation in degraded mode)
OpenTimestamps β structural verification (full Bitcoin confirmation requires external OTS client)
IPFS content addressing β CIDv0/CIDv1 computation with gateway verification
Domain-separated Merkle trees β prevents second-preimage attacks
Atomic transactions β
BEGIN IMMEDIATEprevents race conditions and chain forksRate limiting β configurable token bucket (DB-backed)
RBAC β role-based access control for read-only audit deployments
Error sanitization β stack traces never leak to clients
Path traversal protection β exports confined to allowed directories
Idempotency β nonce-based replay attack prevention with per-row TTL cleanup
Webhook alerts β POST to configurable URL on chain integrity failure
Structured logging β optional JSON log format for production monitoring
See CONTRIBUTING.md for the security disclosure policy.
π³ Docker
# Build
docker build -t mcp-witness .
# Run MCP server (stdio)
docker run -v witness-data:/data mcp-witness serve
# Run web dashboard
docker run -v witness-data:/data -p 9090:9090 mcp-witness dashboard
# With PostgreSQL
docker run -v witness-data:/data \
-e MCP_WITNESS_BACKEND=postgresql \
-e MCP_WITNESS_PG_URL=postgresql://user:pass@host:5432/db \
mcp-witness serveπ§ͺ Development
git clone https://github.com/edwiniac/mcp-witness.git
cd mcp-witness
pip install -e ".[dev]"
pytest -v # 343 unit tests
pytest --ignore=tests/test_storage_pg.py # Skip PG (needs PostgreSQL)CI/CD Pipeline
Job | Description |
lint | ruff + black formatting checks |
test | 251 tests across Python 3.10, 3.11, 3.12 with β₯65% coverage |
test-postgres | 12 PostgreSQL integration tests on Postgres 16 |
security | pip-audit vulnerability scanning |
build | Package build + smoke test |
πΊοΈ Roadmap
Core hash chain (v0.1.0)
Merkle checkpoints + external anchoring (v0.2.0)
CLI + compliance presets + security hardening (v0.3.0)
PostgreSQL backend (v0.5.0)
Ed25519 record signing + non-repudiation (v0.6.0)
GDPR right to erasure + schema migrations (v0.6.0)
Web dashboard with live API (v0.6.0)
HTML + PDF compliance reports (v0.6.0)
Structured JSON logging (v0.6.0)
Multi-tenancy (v0.6.0)
Webhook alerts on chain failure (v0.6.0)
Full-text search (v0.6.0)
Adversarial hardening β TSA strict mode, canonical signing, crypto agility, key lifecycle (v0.9.0)
Merkle proof strict validation + envelope encryption + metrics (v0.9.0)
PostgreSQL full backend parity + sensitive data log scrubbing (v0.9.0)
Secure-by-default hardening β required signing key, fail-closed startup, SSRF guard, ASSURANCE-3 (v1.0.0)
Streaming architecture (Kafka/NATS)
AWS KMS / cloud HSM signing
Grafana/Prometheus metrics endpoint
Plugin system for custom anchor providers
Post-quantum cryptographic algorithm support (tracking NIST PQC)
π License
MIT β see LICENSE
π€ Author
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/edwiniac/mcp-witness'
If you have feedback or need assistance with the MCP directory API, please join our Discord server